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}
|
|
|
|
|
2014-06-30 13:55:53 +02: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
|
|
|
|
|
2013-02-22 15:58:13 +01:00
|
|
|
ifneq ($(WITH_MAGIC),0)
|
|
|
|
INCS += $(MAGIC_INC)
|
|
|
|
LIBS += $(MAGIC_LIB)
|
|
|
|
CPPFLAGS += -DWITH_MAGIC
|
|
|
|
endif
|
|
|
|
|
2014-06-30 13:55:53 +02:00
|
|
|
ifneq ($(WITH_SYSTEM_SYNCTEX),0)
|
|
|
|
INCS += $(SYNCTEX_INC)
|
|
|
|
LIBS += $(SYNCTEX_LIB)
|
|
|
|
else
|
|
|
|
INCS += $(ZLIB_INC)
|
|
|
|
LIBS += $(ZLIB_LIB)
|
|
|
|
ZSOURCE += $(wildcard ../synctex/*.c)
|
|
|
|
CPPFLAGS += -I../synctex
|
|
|
|
|
|
|
|
ifeq (,$(findstring -DSYNCTEX_VERBOSE=0,${CPPFLAGS}))
|
|
|
|
CPPFLAGS += -DSYNCTEX_VERBOSE=0
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (,$(findstring -Isynctex,${CPPFLAGS}))
|
|
|
|
CPPFLAGS += -Isynctex
|
|
|
|
endif
|
|
|
|
ifeq (,$(findstring -DSYNCTEX_VERBOSE=0,${CPPFLAGS}))
|
|
|
|
CPPFLAGS += -DSYNCTEX_VERBOSE=0
|
|
|
|
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)
|