Skip to content

Commit

Permalink
tests: prevent duplication in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
DerDakon committed Nov 8, 2020
1 parent 63e5f20 commit 56ffd3b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ default: it

TESTBINS = unittest_stralloc unittest_blast unittest_prioq

CHECK_INCLUDES := `pkg-config --cflags check`
CHECK_LIBS := `pkg-config --libs check`

clean:
rm -f $(TESTBINS) *.o blast.c

Expand All @@ -24,12 +27,12 @@ test: it
unittest_stralloc: \
../load unittest_stralloc.o ../stralloc.a ../str.a ../error.a
../load unittest_stralloc ../stralloc.a ../str.a ../error.a \
`pkg-config --libs check`
$(CHECK_LIBS)

unittest_stralloc.o: \
../compile unittest_stralloc.c ../alloc.h ../stralloc.h
../compile unittest_stralloc.c -I.. \
`pkg-config --cflags check`
$(CHECK_INCLUDES)

blast.c: ../qmail-remote.c
`head -n $$(grep -n '^int main(' ../qmail-remote.c | sed 's/:.*//') ../qmail-remote.c | sed '/^int main(/d' > blast.c`
Expand All @@ -46,19 +49,19 @@ unittest_blast: \
../timeoutread.o ../timeoutwrite.o ../quote.o \
../stralloc.a ../str.a ../error.a ../substdio.a ../fs.a ../open.a \
../getln.a ../str.a ../case.a \
`pkg-config --libs check`
$(CHECK_LIBS)

unittest_blast.o: \
../compile unittest_blast.c ../alloc.h ../stralloc.h
../compile unittest_blast.c -I.. \
`pkg-config --cflags check`
$(CHECK_INCLUDES)

unittest_prioq: \
../load unittest_prioq.o ../prioq.o ../error.a
../load unittest_prioq ../prioq.o ../error.a \
`pkg-config --libs check`
$(CHECK_LIBS)

unittest_prioq.o: \
../compile unittest_prioq.c
../compile unittest_prioq.c -I.. \
`pkg-config --cflags check`
$(CHECK_INCLUDES)

0 comments on commit 56ffd3b

Please sign in to comment.