From 2c56a79c6b9a65bf3a624b35604fb8a11de5a7ef Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 24 Mar 2009 17:48:46 +0000 Subject: Port to new buildsystem svn path=/trunk/libparserutils/; revision=6854 --- test/Makefile | 109 ++++------------------------------------------------------ 1 file changed, 6 insertions(+), 103 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index e864cb3..48ba2e7 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,105 +1,8 @@ -# Child makefile fragment -# -# Toolchain is provided by top-level makefile -# -# Variables provided by top-level makefile -# -# COMPONENT The name of the component -# EXPORT The location of the export directory -# TOP The location of the source tree root -# RELEASEDIR The place to put release objects -# DEBUGDIR The place to put debug objects -# -# do_include Canned command sequence to include a child makefile -# -# Variables provided by parent makefile: -# -# DIR The name of the directory we're in, relative to $(TOP) -# -# Variables we can manipulate: -# -# ITEMS_CLEAN The list of items to remove for "make clean" -# ITEMS_DISTCLEAN The list of items to remove for "make distclean" -# TARGET_TESTS The list of target names to run for "make test" -# -# SOURCES The list of sources to build for $(COMPONENT) -# -# Plus anything from the toolchain - -# Push parent directory onto the directory stack -sp := $(sp).x -dirstack_$(sp) := $(d) -d := $(DIR) - -# Extend toolchain settings -CFLAGS := $(CFLAGS) -I$(TOP)/src/ -I$(d) - # Tests -TESTS_$(d) := aliases cscodec-8859 cscodec-ext8 cscodec-utf8 cscodec-utf16 \ - charset filter inputstream parserutils -TESTS_$(d) := $(TESTS_$(d)) regression/cscodec-segv regression/filter-segv \ - regression/stream-nomem regression/filter-badenc-segv - -# Items for top-level makefile to use -ITEMS_CLEAN := $(ITEMS_CLEAN) \ - $(addprefix $(d), $(addsuffix $(EXEEXT), $(TESTS_$(d)))) \ - $(addprefix $(d), $(addsuffix .gcda, $(TESTS_$(d)))) \ - $(addprefix $(d), $(addsuffix .gcno, $(TESTS_$(d)))) \ - $(addprefix $(d), $(addsuffix .d, $(TESTS_$(d)))) -ITEMS_DISTCLEAN := $(ITEMS_DISTCLEAN) $(d)log - -# Targets for top-level makefile to run -TARGET_TESTS := $(TARGET_TESTS) test_$(d) - -# Now we get to hack around so that we know what directory we're in. -# $(d) no longer exists when running the commands for a target, so we can't -# simply use it verbatim. Assigning to a variable doesn't really help, as -# there's no guarantee that someone else hasn't overridden that variable. -# So, what we do is make the target depend on $(d), then pick it out of the -# dependency list when running commands. This isn't pretty, but is effective. -test_$(d): $(d) $(addprefix $(d), $(TESTS_$(d))) - @$(PERL) $(TOP)/$ $(1)" - @$$(CC) -c -g $$(DEBUGCFLAGS) -o $$@.o $(1) - @$$(LD) -g -o $$@ $$@.o $$(LDFLAGS) -lparserutils-debug - @$$(RM) $$(RMFLAGS) $$@.o - -endef - -$(eval $(foreach TEST,$(addprefix $(d), $(TESTS_$(d))), \ - $(call dep_test,$(addsuffix .c, $(TEST)),$(addsuffix .d, $(TEST)),$(TEST)))) - -ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) --include $(sort $(DEP_$(d))) -endif - -$(eval $(foreach TEST,$(addprefix $(d), $(TESTS_$(d))), \ - $(call compile_test,$(addsuffix .c, $(TEST)),$(TEST)))) - -# Now include any children we may have -MAKE_INCLUDES := $(wildcard $(d)*/Makefile) -$(eval $(foreach INC, $(MAKE_INCLUDES), $(call do_include,$(INC)))) +DIR_TEST_SOURCES := aliases cscodec-8859 cscodec-ext8 cscodec-utf8 \ + cscodec-utf16 charset filter inputstream parserutils +DIR_TEST_SOURCES := $(DIR_TEST_SOURCES) regression/cscodec-segv \ + regression/filter-segv regression/stream-nomem \ + regression/filter-badenc-segv -# Finally, pop off the directory stack -d := $(dirstack_$(sp)) -sp := $(basename $(sp)) +include build/makefiles/Makefile.subdir -- cgit v1.2.3