zathura/tests/Makefile

62 lines
1.3 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}
ZOSOURCE = $(filter-out ../main.c,$(wildcard ../*.c) $(wildcard ../synctex/*.c))
2012-01-28 19:54:10 +01:00
ifneq (${WITH_SQLITE},0)
2012-01-31 01:29:41 +01:00
INCS += $(SQLITE_INC)
LIBS += $(SQLITE_LIB)
ZSOURCE += $(ZOSOURCE)
ifeq (,$(findstring -DWITH_SQLITE,${CPPFLAGS}))
CPPFLAGS += -DWITH_SQLITE
2012-01-28 19:54:10 +01:00
endif
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
ifneq ($(WITH_MAGIC),0)
INCS += $(MAGIC_INC)
LIBS += $(MAGIC_LIB)
CPPFLAGS += -DWITH_MAGIC
endif
ZOBJECTS = ${ZSOURCE:.c=.o}
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:
$(QUIET)rm -rf ${OBJECTS} ${PROJECT} *.gcno *.gcda .depend
2012-01-28 19:54:10 +01:00
.PHONY: all options clean debug run
2012-01-28 19:54:10 +01:00
-include $(wildcard .depend/*.dep)