2020-01-15 Niels Möller <nisse@lysator.liu.se>
+ * Makefile.in: Replace suffix rules by pattern rules. Move .asm
+ rule above .c rule, since now the order of rules in the Makefile
+ matters, rather than the order in the .SUFFIXES list.
+ (aesdata, desdata, twofishdata, shadata, gcmdata, eccparams):
+ Individual rules replaced by a pattern rule.
+ (eccdata): Add explicit dependencies, to complement the pattern
+ rule.
+ * examples/Makefile.in: Replace suffix rules by pattern rules.
+ * testsuite/Makefile.in: Likewise.
+ * tools/Makefile.in: Likewise.
+
+ * config.make.in: Empty .SUFFIXES, to not accidentally use any
+ suffix rules.
+
* aclocal.m4 (DEP_INCLUDE): Delete substituted variable.
* Makefile.in: Use the GNU make directive -include to include
$(RANLIB) $@
echo hogweed > libhogweed.stamp
-.c.$(OBJEXT):
+%.$(OBJEXT): %.asm $(srcdir)/asm.m4 machine.m4 config.m4
+ $(M4) $(srcdir)/asm.m4 machine.m4 config.m4 $< >$*.s
+ $(COMPILE) -c $*.s
+
+%.$(OBJEXT): %.c
$(COMPILE) -c $< \
&& $(DEP_PROCESS)
&& $(LN_S) $(LIBHOGWEED_FORLINK) $(LIBHOGWEED_SONAME) ; } )
echo hogweed > libhogweed.stamp
-# For Solaris and BSD make, we have to use an explicit rule for each
-# executable. Avoid object file targets to make it easy to run the
-# right compiler.
-aesdata$(EXEEXT_FOR_BUILD): aesdata.c
- $(CC_FOR_BUILD) `test -f aesdata.c || echo '$(srcdir)/'`aesdata.c \
- -o aesdata$(EXEEXT_FOR_BUILD)
-
-desdata$(EXEEXT_FOR_BUILD): desdata.c
- $(CC_FOR_BUILD) `test -f desdata.c || echo '$(srcdir)/'`desdata.c \
- -o desdata$(EXEEXT_FOR_BUILD)
-
-twofishdata$(EXEEXT_FOR_BUILD): twofishdata.c
- $(CC_FOR_BUILD) `test -f twofishdata.c || echo '$(srcdir)/'`twofishdata.c \
- -o twofishdata$(EXEEXT_FOR_BUILD)
-
-shadata$(EXEEXT_FOR_BUILD): shadata.c
- $(CC_FOR_BUILD) `test -f shadata.c || echo '$(srcdir)/'`shadata.c -lm \
- -o shadata$(EXEEXT_FOR_BUILD)
+# For building the various *data.c programs. -lm needed for shadata.
+%$(EXEEXT_FOR_BUILD): %.c
+ $(CC_FOR_BUILD) $< -lm -o $@
-gcmdata$(EXEEXT_FOR_BUILD): gcmdata.c
- $(CC_FOR_BUILD) `test -f gcmdata.c || echo '$(srcdir)/'`gcmdata.c \
- -o gcmdata$(EXEEXT_FOR_BUILD)
-
-eccdata$(EXEEXT_FOR_BUILD): eccdata.c mini-gmp.c mini-gmp.h
- $(CC_FOR_BUILD) `test -f eccdata.c || echo '$(srcdir)/'`eccdata.c \
- -o eccdata$(EXEEXT_FOR_BUILD)
-
-eccparams$(EXEEXT_FOR_BUILD): eccparams.c
- $(CC_FOR_BUILD) `test -f eccparams.c || echo '$(srcdir)/'`eccparams.c \
- -o eccparams$(EXEEXT_FOR_BUILD)
+# Explicit dependency.
+eccdata$(EXEEXT_FOR_BUILD): mini-gmp.c mini-gmp.h
# desCore rules
# It seems using $(srcdir)/ doesn't work with GNU make 3.79.1
ecc-secp384r1.$(OBJEXT): ecc-secp384r1.h
ecc-secp521r1.$(OBJEXT): ecc-secp521r1.h
-.asm.$(OBJEXT): $(srcdir)/asm.m4 machine.m4 config.m4
- $(M4) $(srcdir)/asm.m4 machine.m4 config.m4 $< >$*.s
- $(COMPILE) -c $*.s
- @echo "$@ : $< $(srcdir)/asm.m4 machine.m4 config.m4" >$@.d
-
# Texinfo rules
-.texinfo.info:
+%.info: %.texinfo
cd $(srcdir) && $(MAKEINFO) --output $@ `basename "$<"`
-.texinfo.html:
+%.html: %.texinfo
cd $(srcdir) && $(MAKEINFO) --html --no-split \
--output $@T `basename "$<"` \
&& test -s $@T && mv -f $@T $@
-.texinfo.dvi:
+%.dvi: %.texinfo
cd $(srcdir) && texi2dvi -b `basename "$<"`
-.dvi.ps:
+%.ps: %.dvi
cd $(srcdir) && dvips -Ppdf -G0 -o `basename "$<" .dvi`.ps `basename "$<"`
# Avoid rebuilding .dvi and .ps files when the .texinfo source is unchanged.
PS2PDFFLAGS=-dCompatibilityLevel=1.3 -dMAxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true
-.texinfo.pdf:
+%.pdf: %.texinfo
$(MAKE) `basename "$<" .texinfo`.ps
cd $(srcdir) && ps2pdf $(PS2PDFFLAGS) `basename "$<" .texinfo`.ps