Build pakrd as shared object instead of static
This commit is contained in:
parent
2f3d8106ea
commit
fb1d1697f1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
.cache
|
.cache
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
pckr
|
pckr
|
||||||
libpakrd.a
|
libpakrd.so
|
||||||
dist
|
dist
|
||||||
|
14
compile
14
compile
@ -21,7 +21,6 @@ FG_BR_CYAN="\033[96"
|
|||||||
FG_BR_WHITE="\033[97"
|
FG_BR_WHITE="\033[97"
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
AR=ar
|
|
||||||
CFLAGS="-Wall -Werror -pedantic -Iinclude -Iintern/c-cpp-aliases -Iintern/cpath/include "
|
CFLAGS="-Wall -Werror -pedantic -Iinclude -Iintern/c-cpp-aliases -Iintern/cpath/include "
|
||||||
|
|
||||||
PCKR_SRC="\
|
PCKR_SRC="\
|
||||||
@ -38,7 +37,7 @@ PAKRD_SRC="\
|
|||||||
src/io.c \
|
src/io.c \
|
||||||
src/darr.c \
|
src/darr.c \
|
||||||
src/pak.c"
|
src/pak.c"
|
||||||
PAKRD_FLAGS="-c -fPIC"
|
PAKRD_FLAGS="-fPIC -rdynamic -shared "
|
||||||
|
|
||||||
PCKR_TEST_SRC="\
|
PCKR_TEST_SRC="\
|
||||||
intern/cpath/src/cpath.c \
|
intern/cpath/src/cpath.c \
|
||||||
@ -74,13 +73,13 @@ done
|
|||||||
if [[ $BUILD_TYPE == "debug" ]]; then
|
if [[ $BUILD_TYPE == "debug" ]]; then
|
||||||
CFLAGS+="-g "
|
CFLAGS+="-g "
|
||||||
PCKR_OUT="pckr"
|
PCKR_OUT="pckr"
|
||||||
PAKRD_OUT="libpakrd.a"
|
PAKRD_OUT="libpakrd.so"
|
||||||
else
|
else
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
cp ./include/pak.h dist
|
cp ./include/pak.h dist
|
||||||
CFLAGS+="-O3 -g "
|
CFLAGS+="-O3 "
|
||||||
PCKR_OUT="dist/pckr"
|
PCKR_OUT="dist/pckr"
|
||||||
PAKRD_OUT="dist/libpakrd.a"
|
PAKRD_OUT="dist/libpakrd.so"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -88,9 +87,8 @@ fi
|
|||||||
(set -x ; $CC $CFLAGS $PCKR_SRC -o $PCKR_OUT)
|
(set -x ; $CC $CFLAGS $PCKR_SRC -o $PCKR_OUT)
|
||||||
|
|
||||||
|
|
||||||
# Build pakrd static library
|
# Build pakrd shared library
|
||||||
(set -x ; $CC $CFLAGS $PAKRD_FLAGS $PAKRD_SRC ; $AR r $PAKRD_OUT *.o)
|
(set -x ; $CC $CFLAGS $PAKRD_FLAGS $PAKRD_SRC -o $PAKRD_OUT)
|
||||||
rm *.o
|
|
||||||
|
|
||||||
|
|
||||||
# Build pckr_test executable
|
# Build pckr_test executable
|
||||||
|
Loading…
Reference in New Issue
Block a user