diff options
Diffstat (limited to 'src/test/Makefile.in')
-rw-r--r-- | src/test/Makefile.in | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/test/Makefile.in b/src/test/Makefile.in index 8f999fb37..4d8f55e1f 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -24,10 +24,12 @@ MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o MT19937AR_H = $(MT19937AR_D)/mt19937ar.h -TEST_SPINLOCK_OBJ = obj/test_spinlock.o -TEST_SPINLOCK_C = test_spinlock.c -TEST_SPINLOCK_H = -TEST_SPINLOCK_DEPENDS = $(TEST_SPINLOCK_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ $(SYSINFO_INC)) +TEST_C = test_libconfig.c test_spinlock.c +TEST_OBJ = $(addprefix obj/, $(patsubst %c,%o,%(TEST_C))) +TEST_H = +TEST_DEPENDS = $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) $(SYSINFO_INC) + +TESTS_ALL = test_libconfig test_spinlock @SET_MAKE@ @@ -35,9 +37,9 @@ CC = @CC@ export CC ##################################################################### -.PHONY: all test_spinlock clean buildclean +.PHONY: all $(TESTS_ALL) clean buildclean -all: test_spinlock Makefile +all: $(TESTS_ALL) Makefile buildclean: @echo " CLEAN test (build temp files)" @@ -45,14 +47,14 @@ buildclean: clean: buildclean @echo " CLEAN test" - @rm -rf ../../test_spinlock@EXEEXT@ + @rm -rf ../../test_*@EXEEXT@ ##################################################################### Makefile: Makefile.in @$(MAKE) -C ../.. src/test/Makefile -$(SYSINFO_INC): $(TEST_SPINLOCK_C) $(TEST_SPINLOCK_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) +$(SYSINFO_INC): $(TEST_C) $(TEST_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) @echo " MAKE $@" @$(MAKE) -C ../.. sysinfo @@ -62,17 +64,21 @@ obj: @echo " MKDIR obj" @-mkdir obj -#executables +# executables + +$(TESTS_ALL): test_%: ../../test_%@EXEEXT@ + @echo " TEST $@" -test_spinlock: $(TEST_SPINLOCK_DEPENDS) Makefile - @echo " LD $@" - @$(CC) @LDFLAGS@ -o ../../test_spinlock@EXEEXT@ $(TEST_SPINLOCK_DEPENDS) @LIBS@ @MYSQL_LIBS@ +../../test_%@EXEEXT@: obj/test_%.o $(TEST_DEPENDS) Makefile + @echo " LD $(notdir $@)" + @$(CC) @STATIC@ @LDFLAGS@ -o $@ $< $(COMMON_D)/obj_sql/common_sql.a \ + $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ # object files -obj/%.o: %.c $(TEST_SPINLOCK_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj +obj/%.o: %.c $(TEST_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: |