aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Lockwood2021-07-02 11:48:34 -0600
committerAlexis Lockwood2021-07-02 13:54:57 -0400
commit8a08c406f4690ad9a2a3109b69d4963a474a32f2 (patch)
tree6f283245f71cfeab9cc3cdbc30c572837342f8dc
parent2cf5e9c68932e9b54eabc5788a7278e99d274726 (diff)
makefile tidying
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f3b7e14..b055fef 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@ LS_SOURCES := src/ls_internal.c src/ls_kws.c src/ls_expr.c src/ls.c \
LS_ARGS := -I${LS_INCLUDE} -Lsrc -lls
TEST_ARGS := -Imunit -Lmunit -lmunit test/tsupport.c
LIBEXPLAIN_ARGS := $(shell pkg-config --libs --cflags libexplain)
+LIBS_ARGS := ${LIBEXPLAIN_ARGS}
TESTS := test/test_internal.test
@@ -37,10 +38,10 @@ include ${LS_SOURCES:.c=.d}
munit/munit.o: CFLAGS := $(filter-out -Wconversion -Wshadow, ${CFLAGS})
ls_run: ls_run.c src/libls.a
- ${CC} $^ ${LS_ARGS} ${LIBEXPLAIN_ARGS} -o $@ ${CFLAGS}
+ ${BUILD_TOOL}
ls_minify: ls_minify.c ls_minify_identgen.c src/libls.a
- ${CC} $^ ${LS_ARGS} ${LIBEXPLAIN_ARGS} -o $@ ${CFLAGS}
+ ${BUILD_TOOL}
src/ls_kws.c: gen_kws.py
$(PYTHON) gen_kws.py source > $@
@@ -62,3 +63,6 @@ src/libls.a: ${LS_SOURCES:.c=.o}
%.test: %.c munit/libmunit.a src/libls.a
${CC} $< ${LS_ARGS} ${TEST_ARGS} -o $@ ${CFLAGS}
+
+BUILD_TOOL = \
+ ${CC} $(filter-out %.a,$^) ${LS_ARGS} ${LIBS_ARGS} -o $@ ${CFLAGS}