...
 
Commits (2)
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
dependency .d files. Delete dependency files on make clean.
* examples/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise. Also use $(OBJEXT) properly.
* tools/Makefile.in: Likewise.
* configure.ac (dummy-dep-files): Delete these config commands.
2020-01-10 Niels Möller <nisse@lysator.liu.se>
From Dmitry Eremin-Solenikov: Consistently rename ecc files and
......
......@@ -269,7 +269,11 @@ libhogweed.a: $(hogweed_OBJS)
$(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)
......@@ -296,36 +300,12 @@ $(LIBHOGWEED_FORLINK): $(hogweed_OBJS) $(LIBNETTLE_FORLINK)
&& $(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
......@@ -408,29 +388,24 @@ ecc-secp256r1.$(OBJEXT): ecc-secp256r1.h
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
......@@ -658,7 +633,7 @@ distcheck: dist
$(rm_distcheck)
clean-here:
-rm -f $(TARGETS) *.$(OBJEXT) *.s *.so *.dll *.a \
-rm -f $(TARGETS) *.$(OBJEXT) *.$(OBJEXT).d *.s *.so *.dll *.a \
ecc-curve25519.h ecc-curve448.h \
ecc-secp192r1.h ecc-secp224r1.h ecc-secp256r1.h \
ecc-secp384r1.h ecc-secp521r1.h \
......@@ -683,4 +658,4 @@ tags-here:
etags -o $(srcdir)/TAGS $(srcdir)/*.c $(srcdir)/*.h
DEP_FILES = $(SOURCES:.c=.$(OBJEXT).d)
@DEP_INCLUDE@ $(DEP_FILES)
-include $(DEP_FILES)
......@@ -456,13 +456,6 @@ if test x$enable_dependency_tracking = xyes ; then
fi
fi
if test x$enable_dependency_tracking = xyes ; then
DEP_INCLUDE='include '
else
DEP_INCLUDE='# '
fi
AC_SUBST([DEP_INCLUDE])
AC_SUBST([DEP_FLAGS])
AC_SUBST([DEP_PROCESS])])
......
......@@ -77,17 +77,11 @@ LINK_CXX = $(CXX) $(CXXFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
# usual targets.
default: all
# For some reason the suffixes list must be set before the rules.
# Otherwise BSD make won't build binaries e.g. aesdata. On the other
# hand, AIX make has the opposite idiosyncrasies to BSD, and the AIX
# compile was broken when .SUFFIXES was moved here from Makefile.in.
# Don't use any old-fashioned suffix rules.
.SUFFIXES:
.SUFFIXES: .asm .c .$(OBJEXT) .html .dvi .info .exe .pdf .ps .texinfo
# Disable builtin rule
%$(EXEEXT) : %.c
.c:
# Keep object files
.PRECIOUS: %.o
......
......@@ -163,19 +163,6 @@ GMP_PROG_EXEEXT_FOR_BUILD
LSH_DEPENDENCY_TRACKING
if test x$enable_dependency_tracking = xyes ; then
# Since the makefiles use include to get the dependency files, we must
# make sure that the files exist. We generate some more files than are
# actually needed.
AC_CONFIG_COMMANDS([dummy-dep-files],
[(cd "$srcdir" && find . '(' -name '*.c' -o -name '*.cxx' ')' -print) \
| sed 's/\.cx*$//' | (while read f; do \
test -f "$f.o.d" || echo > "$f.o.d"; \
done)
])
fi
if test "x$enable_gcov" = "xyes"; then
CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs"
fi
......
......@@ -40,7 +40,7 @@ DISTFILES= $(SOURCES) Makefile.in $(TS_ALL) setup-env teardown-env \
all: $(TARGETS)
.c.$(OBJEXT):
%.$(OBJEXT): %.c
$(COMPILE) -c $< && $(DEP_PROCESS)
# NOTE: If we required GNU make, we could use a single rule with $(@F)
......@@ -131,7 +131,7 @@ distdir: $(DISTFILES)
cp $? $(distdir)
clean:
-rm -f $(TARGETS) *.$(OBJEXT)
-rm -f $(TARGETS) *.$(OBJEXT) *.$(OBJEXT).d
distclean: clean
-rm -f Makefile *.d
......@@ -139,4 +139,4 @@ distclean: clean
tags:
etags -o $(srcdir)/TAGS --include $(top_srcdir) $(srcdir)/*.c $(srcdir)/*.h
@DEP_INCLUDE@ $(SOURCES:.c=.$(OBJEXT).d)
-include $(SOURCES:.c=.$(OBJEXT).d)
......@@ -79,11 +79,10 @@ DISTFILES = $(SOURCES) $(CXX_SOURCES) Makefile.in .test-rules.make \
all: $(EXTRA_TARGETS)
.c.$(OBJEXT):
%.$(OBJEXT): %.c
$(COMPILE) -c $< && $(DEP_PROCESS)
.SUFFIXES: .cxx
.cxx.$(OBJEXT):
%.$(OBJEXT): %.cxx
$(COMPILE_CXX) -c $< && $(DEP_PROCESS)
# BSD (and Solaris) make doesn't allow extra dependencies together one
......@@ -156,7 +155,7 @@ distdir: $(DISTFILES)
clean:
-rm -f $(TARGETS) $(EXTRA_TARGETS) dlopen-test$(EXEEXT) \
*.o test.in test1.out test2.out
*.$(OBJEXT) *.$(OBJEXT).d test.in test1.out test2.out
distclean: clean
-rm -f Makefile *.d
......@@ -167,4 +166,4 @@ tags:
# Includes dependency files for everything, including objects which
# the current configuration will not build.
DEP_FILES = $(SOURCES:.c=.$(OBJEXT).d) $(CXX_SOURCES:.cxx=.$(OBJEXT).d)
@DEP_INCLUDE@ $(DEP_FILES)
-include $(DEP_FILES)
......@@ -56,7 +56,7 @@ nettle-pbkdf2$(EXEEXT): $(nettle_pbkdf2_OBJS) ../libnettle.stamp
$(LINK) $(nettle_pbkdf2_OBJS) -lnettle -o $@
.c.$(OBJEXT):
%.$(OBJEXT): %.c
$(COMPILE) -c $< && $(DEP_PROCESS)
# NOTE: If we required GNU make, we could use a single rule with $(@F)
......@@ -89,7 +89,7 @@ distdir: $(DISTFILES)
cp $? $(distdir)
clean:
-rm -f $(TARGETS) *.o
-rm -f $(TARGETS) *.$(OBJEXT) *.$(OBJEXT).d
distclean: clean
-rm -f Makefile *.d
......@@ -97,4 +97,4 @@ distclean: clean
tags:
etags -o $(srcdir)/TAGS --include $(top_srcdir) $(srcdir)/*.c $(srcdir)/*.h
@DEP_INCLUDE@ $(SOURCES:.c=.$(OBJEXT).d)
-include $(SOURCES:.c=.$(OBJEXT).d)