aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--libs.config.mk14
2 files changed, 14 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 2b0f5a4..1e10800 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,6 @@ LDFLAGS = ${LIBS}
dist: static shared
-# ar -rc libaz.a libabc.a libxyz.a
static: libs
@make OPT='-O2 -pipe -Werror' ${LIBNAME:=.a}
rm -f ${OBJ}
@@ -29,13 +28,18 @@ ${LIBNAME:=.so}: ${OBJ}
${CC} ${LDFLAGS} -shared ${OBJ} -o $@
${LIBNAME:=.a}: ${OBJ}
- ar rcs $@ ${OBJ}
+# ar rcs $@ ${OBJ}
+ mkdir build
+ cd build && ar -x ../${LIBSTR_PATH}
+ ar rcs $@ ${OBJ} build/*
+ rm -rf build
.c.o:
${CC} ${CFLAGS} -c $< -o $@
clean:
rm -f ${OBJ} ${LIBNAME}.* *.core
+ rm -rf build
cd test && make clean
tests: dist
diff --git a/libs.config.mk b/libs.config.mk
index 606718f..8854860 100644
--- a/libs.config.mk
+++ b/libs.config.mk
@@ -2,10 +2,12 @@
LIBDIR = lib
-LIBSTR_VER = 0.0.0-a1
-LIBSTR = cstr-${LIBSTR_VER}
-LIBSTR_INC = -I${LIBDIR}/${LIBSTR}/src
-LIBSTR_LIB = -L${LIBDIR}/${LIBSTR} -l:libstr.a
+LIBSTR_VER = 0.0.0-a1
+LIBSTR = cstr-${LIBSTR_VER}
+LIBSTR_INC = -I${LIBDIR}/${LIBSTR}/src
+LIBSTR_LIB = -L${LIBDIR}/${LIBSTR} -l:libstr.a
+LIBSTR_PATH = ${LIBDIR}/${LIBSTR}/libstr.a
-LIBINC = ${LIBSTR_INC}
-LIBS = ${LIBSTR_LIB}
+LIBINC = ${LIBSTR_INC}
+LIBS = ${LIBSTR_LIB}
+LIBSPATH = ${LIBSTR_PATH}