Test suite Makefile overhaul.

* Use variables for compiler and linker flags.

* Use variables for source/object files and binaries.

* Use proper targets instead of phony targets to build the timetest
  program.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2011-04-27 19:32:29 +02:00
parent 52c30f866d
commit 9b62bb4f38

View File

@@ -1,18 +1,27 @@
CC = gcc
all: testprog test
CFLAGS = -DFAKE_STAT
LDFLAGS = -lrt
testprog: timetest.c
${CC} -DFAKE_STAT -o timetest timetest.c -lrt
SRC = timetest.c
OBJ = ${SRC:.c=.o}
test: testprog
all: timetest test
.c.o:
${CC} -c ${CFLAGS} $<
timetest: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS}
test: timetest
@echo
@./test.sh
clean:
@rm -f timetest
@rm -f ${OBJ} timetest
distclean: clean
@echo
.PHONY: all testprog test clean distclean
.PHONY: all test clean distclean