Commit 597a33c4 authored by Niels Möller's avatar Niels Möller
Browse files

Include .test-rules.make, which contains

the rules for all the test executables.
(test-rules): New rule, to update this file.

Rev: src/nettle/testsuite/
parent fcfa3e73
...@@ -33,35 +33,30 @@ EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT)) ...@@ -33,35 +33,30 @@ EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT))
SOURCES = $(TS_SOURCES) testutils.c SOURCES = $(TS_SOURCES) testutils.c
DISTFILES = $(SOURCES) $(TS_SH) run-tests teardown-env \ DISTFILES = $(SOURCES) .test-rules.make $(TS_SH) run-tests teardown-env \
rfc1750.txt testutils.h rfc1750.txt testutils.h
# BSD (and Solaris) make doesn't allow extra dependencies together one
# single-suffix rules. So in the common case of $(EXEEXT) empty, we
# need a rule -test.$(OBJEXT)-test$(EXEEXT): rather than the simpler
.SUFFIXES: -test.c -test.$(OBJEXT) -test$(EXEEXT)
.c.$(OBJEXT): .c.$(OBJEXT):
$(COMPILE) -c $< && $(DEP_PROCESS) $(COMPILE) -c $< && $(DEP_PROCESS)
# It seems really tricky to write suffix rules for the transformation # BSD (and Solaris) make doesn't allow extra dependencies together one
# foo-test.o -> foo-test, that work with all make variants. We use a a # single-suffix rules, which makes it impossible or almost impossible
# %-rule that works with Solaris make and GNU-make and a two-suffix # to use suffix rules to build the test executables. So we use an
# -test.o-test: that works for BSD make and GNU make. For BSD make, we # explicit rule for each and every executable.
# also need a -test.c-test.o rule.
%$(EXEEXT): %.$(OBJEXT) TEST_OBJS = testutils.$(OBJEXT) -lnettle $(LIBS)
$(LINK) $< testutils.$(OBJEXT) -lnettle $(LIBS) -o $@
-test.c-test.$(OBJEXT): .PHONY: test-rules
$(COMPILE) -c $< && $(DEP_PROCESS) test-rules:
for f in $(TARGETS) $(EXTRA_TARGETS) ; do \
echo $$f'$$(EXEEXT): '$$f'.$$(OBJEXT)' ; \
echo ' $$(LINK) '$$f'.$$(OBJEXT) $$(TEST_OBJS) -o '$$f'$$(EXEEXT)' ; \
echo ; \
done > $(srcdir)/.test-rules.make
-test.$(OBJEXT)-test$(EXEEXT): include $(srcdir)/.test-rules.make
$(LINK) $< testutils.$(OBJEXT) -lnettle $(LIBS) -o $@
$(TARGETS) $(EXTRA_TARGETS) : testutils.$(OBJEXT) ../libnettle.a $(TARGETS) $(EXTRA_TARGETS) : testutils.$(OBJEXT) ../libnettle.a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment