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