2012-01-28 19:54:10 +01:00
|
|
|
# See LICENSE file for license and copyright information
|
|
|
|
|
|
|
|
include ../config.mk
|
|
|
|
include ../common.mk
|
|
|
|
include config.mk
|
|
|
|
|
|
|
|
PROJECT = tests
|
|
|
|
SOURCE = tests.c $(wildcard test_*.c)
|
|
|
|
OBJECTS = ${SOURCE:.c=.o}
|
|
|
|
|
2012-03-08 17:50:54 +01:00
|
|
|
ZOSOURCE = $(filter-out ../main.c,$(wildcard ../*.c))
|
2012-01-28 19:54:10 +01:00
|
|
|
|
2012-03-05 09:51:27 +01:00
|
|
|
ifneq (${WITH_SQLITE},0)
|
2012-01-31 01:29:41 +01:00
|
|
|
INCS += $(SQLITE_INC)
|
|
|
|
LIBS += $(SQLITE_LIB)
|
2012-03-08 17:50:54 +01:00
|
|
|
ZSOURCE += $(ZOSOURCE)
|
2012-03-05 09:51:27 +01:00
|
|
|
ifeq (,$(findstring -DWITH_SQLITE,${CPPFLAGS}))
|
|
|
|
CPPFLAGS += -DWITH_SQLITE
|
2012-01-28 19:54:10 +01:00
|
|
|
endif
|
2012-03-08 17:50:54 +01:00
|
|
|
else
|
2012-03-19 20:10:15 +01:00
|
|
|
ZSOURCE = $(filter-out ../database-sqlite.c,$(ZOSOURCE))
|
2012-01-28 19:54:10 +01:00
|
|
|
endif
|
|
|
|
|
2012-03-08 17:50:54 +01:00
|
|
|
ZOBJECTS = ${ZSOURCE:.c=.o}
|
|
|
|
|
2012-02-21 19:05:35 +01:00
|
|
|
all: ${PROJECT}
|
2012-01-28 19:54:10 +01:00
|
|
|
|
2012-01-28 20:14:21 +01:00
|
|
|
run: ${PROJECT}
|
2012-01-28 19:54:10 +01:00
|
|
|
$(QUIET)./${PROJECT}
|
|
|
|
|
|
|
|
options:
|
|
|
|
@echo ${PROJECT} build options:
|
|
|
|
@echo "CFLAGS = ${CFLAGS}"
|
|
|
|
@echo "LDFLAGS = ${LDFLAGS}"
|
|
|
|
@echo "DFLAGS = ${DFLAGS}"
|
|
|
|
@echo "CC = ${CC}"
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(ECHO) CC $<
|
|
|
|
@mkdir -p .depend
|
|
|
|
$(QUIET)${CC} -c -I.. ${CPPFLAGS} ${CFLAGS} -o $@ $< -MMD -MF .depend/$@.dep
|
|
|
|
|
2012-02-08 15:36:08 +01:00
|
|
|
${PROJECT}: options ${OBJECTS}
|
|
|
|
$(QUIET)make -C ..
|
2012-01-28 19:54:10 +01:00
|
|
|
$(ECHO) CC -o $@
|
|
|
|
$(QUIET)${CC} ${SFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${ZOBJECTS} ${LIBS}
|
|
|
|
|
|
|
|
${OBJECTS}: ../config.mk
|
|
|
|
|
|
|
|
clean:
|
2012-03-01 03:04:09 +01:00
|
|
|
$(QUIET)rm -rf ${OBJECTS} ${PROJECT} *.gcno *.gcda .depend
|
2012-01-28 19:54:10 +01:00
|
|
|
|
2012-02-21 19:05:35 +01:00
|
|
|
.PHONY: all options clean debug run
|
2012-01-28 19:54:10 +01:00
|
|
|
|
|
|
|
-include $(wildcard .depend/*.dep)
|