X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/3c8d8c60a5e3f08f84c327e7476c6095843e23ab..645fcce0830342b644cc16e71e28790c838d9415:/vars.am diff --git a/vars.am b/vars.am index feb75884..41f57a49 100644 --- a/vars.am +++ b/vars.am @@ -110,12 +110,24 @@ AM_CPPFLAGS = $(CATACOMB_INCLUDES) TEST_EXTENSIONS = .t SUFFIXES += .c .t$(EXEEXT) .to + +## This unpleasant duplication of rules makes the build system basically work +## for non-GNU make(1) variants, while GNU Make will associate useful +## additional dependencies with the test programs. GNU Make seems not to +## mind the duplicate rules, and uses the second (better) set; non-GNU Make +## will think the second set refer to bizarrely-named targets which nobody is +## apparently interested in. .c.to: $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@ .to.t$(EXEEXT): $(AM_V_CCLD)$(LINK) $< $(TEST_LIBS) $(top_builddir)/libcatacomb.la \ $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS) -.PRECIOUS: %.to +%.to: %.c %.lo + $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@ +%.t$(EXEEXT): %.to $(TEST_LIBS) $(top_builddir)/libcatacomb.la + $(AM_V_CCLD)$(LINK) $+ $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS) + +.PRECIOUS: %.to %.t$(EXEEXT) CLEANFILES += *.to *.t$(EXEEXT) ###----- That's all, folks --------------------------------------------------