zathura/tests/Makefile

54 lines
1.1 KiB
Makefile
Raw Normal View History

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}
ZSOURCE = $(shell find ../ -iname "*.c" -a ! -iname "database-*" ! -iname "main.c" ! -path "*tests*")
ZOBJECTS = ${ZSOURCE:.c=.o}
ifeq (${DATABASE}, sqlite)
2012-01-31 01:29:41 +01:00
INCS += $(SQLITE_INC)
LIBS += $(SQLITE_LIB)
2012-01-28 19:54:10 +01:00
ZSOURCE += ../database-sqlite.c
else
ifeq (${DATABASE}, plain)
ZSOURCE += ../database-plain.c
endif
endif
2012-02-08 15:36:08 +01:00
all: ${PROJECT} run
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:
$(QUIET)rm -rf ${OBJECTS} ${PROJECT}
.PHONY: all options clean debug
-include $(wildcard .depend/*.dep)