]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
* Makefile.in (distdir): Handle absolute $distdir.
authorNiels Möller <nisse@lysator.liu.se>
Sun, 28 Nov 2004 10:38:19 +0000 (11:38 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Sun, 28 Nov 2004 10:38:19 +0000 (11:38 +0100)
Avoid using the GNU extension $^.

* examples/Makefile.in: Avoid using the GNU extension $^.
* tools/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.

Rev: src/nettle/ChangeLog:1.308
Rev: src/nettle/Makefile.in:1.15
Rev: src/nettle/examples/Makefile.in:1.10
Rev: src/nettle/testsuite/Makefile.in:1.10
Rev: src/nettle/tools/Makefile.in:1.11

ChangeLog
Makefile.in
examples/Makefile.in
testsuite/Makefile.in
tools/Makefile.in

index 63339a5de6f806778cb8d10b2da8fb11f7742646..347e6a025b997cc6e8ec3fb8392f279127aa1b85 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-11-28  Niels Möller  <nisse@lysator.liu.se>
+
+       * Makefile.in (distdir): Handle absolute $distdir.
+       Avoid using the GNU extension $^.
+
+       * examples/Makefile.in: Avoid using the GNU extension $^.
+       * tools/Makefile.in: Likewise.
+       * testsuite/Makefile.in: Likewise.
+
 2004-11-24  Niels Möller  <niels@s3.kth.se>
 
        * configure.ac: Fixed typo, preventing the creation of dependency
index 2c9ea82c0afb517cdc534e4fa231d9404c944a0b..c5419fe4006c9d0408db5cae210cfb3ccd8adc05 100644 (file)
@@ -108,9 +108,12 @@ DISTFILES = $(SOURCES) $(HEADERS) .bootstrap aclocal.m4 configure.ac \
 
 # Rules building libnettle.a
 # FIXME: Do we really need to delete the archive first?
-libnettle.a: $(nettle_SOURCES:.c=.o) $(LIBOBJS)
+nettle_OBJS = $(nettle_SOURCES:.c=.$(OBJEXT)) $(LIBOBJS)
+nettle_PURE_OBJS = $(nettle_OBJS:.$(OBJEXT)=.p$(OBJEXT))
+
+libnettle.a: $(nettle_OBJS)
        -rm -f $@
-       $(AR) $(ARFLAGS) $@ $^
+       $(AR) $(ARFLAGS) $@ $(nettle_OBJS)
        $(RANLIB) $@
 
 .c.$(OBJEXT):
@@ -118,8 +121,8 @@ libnettle.a: $(nettle_SOURCES:.c=.o) $(LIBOBJS)
        && $(DEP_PROCESS)
 
 # Rules building libnettle.so
-$(SHLIBFORLINK): $(nettle_SOURCES:.c=.p$(OBJEXT)) $(LIBOBJS:.$(OBJEXT)=.p$(OBJEXT))
-       $(SHLIBLINK) $^ -o $@ $(SHLIBLIBS)
+$(SHLIBFORLINK): $(nettle_PURE_OBJS)
+       $(SHLIBLINK) $(nettle_PURE_OBJS) -o $@ $(SHLIBLIBS)
        -mkdir .lib 2>/dev/null
        [ -z "$(SHLIBSONAME)" ] || (cd .lib \
           && ln -sf ../$(SHLIBFORLINK) $(SHLIBSONAME))
@@ -129,22 +132,16 @@ $(SHLIBFORLINK): $(nettle_SOURCES:.c=.p$(OBJEXT)) $(LIBOBJS:.$(OBJEXT)=.p$(OBJEX
        && $(DEP_PROCESS)
 
 .o$(EXEEXT):
-       $(LINK) $^ $(LIBS) -o $@
+       $(LINK) $< $(LIBS) -o $@
 
-# aesdata.$(OBJEXT) : aesdata.c
-#      $(COMPILE) -c $< && $(DEP_PROCESS)
 aesdata$(EXEEXT): aesdata.$(OBJEXT)
-       $(LINK) $^ $(LIBS) -o $@
+       $(LINK) $< $(LIBS) -o $@
 
-# desdata.$(OBJEXT) : desdata.c
-#      $(COMPILE)  -c $< && $(DEP_PROCESS)
 desdata$(EXEEXT): desdata.$(OBJEXT)
-       $(LINK) $^ $(LIBS) -o $@
+       $(LINK) $< $(LIBS) -o $@
 
-# shadata.$(OBJEXT) : shadata.c
-#      $(COMPILE)  -c $< && $(DEP_PROCESS)
 shadata$(EXEEXT): shadata.$(OBJEXT)
-       $(LINK) $^ $(LIBS) -lm -o $@
+       $(LINK) $< $(LIBS) -lm -o $@
 
 # desCore rules
 # It seems using $(srcdir)/ doesn't work with GNU make 3.79.1
@@ -231,9 +228,11 @@ install-info: nettle.info
          install-info --info-dir="$(DESTDIR)$(infodir)" $< ; \
        else : ; fi
 
+# NOTE: I'd like to use $^, but that's a GNU extension. $? should be
+# more portable, and equivalent for phony targets.
 install-headers: $(INSTALL_HEADERS)
        $(INSTALL) -d $(DESTDIR)$(includedir)/nettle
-       $(INSTALL_DATA) $^ $(DESTDIR)$(includedir)/nettle
+       $(INSTALL_DATA) $? $(DESTDIR)$(includedir)/nettle
 
 # Uninstall
 uninstall-here: uninstall-info uninstall-headers uninstall-shared
@@ -259,18 +258,22 @@ uninstall-shared:
 distdir = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 top_distdir = $(distdir)
 
-# $(distdir) must always be a relative path!
+# NOTE: Depending on the automake version in the parent dir,
+# we must handle both absolute and relative $destdir.
+
+# NOTE: I'd like to use $^, but that's a GNU extension. $? should be
+# more portable, and equivalent for phony targets.
 distdir: $(DISTFILES)
-       rm -rf $(distdir)
-       mkdir $(distdir)
-       cp $^ $(distdir)
+       rm -rf "$(distdir)"
+       mkdir "$(distdir)"
+       cp $? "$(distdir)"
        set -e; for d in sparc x86 ; do \
-         mkdir $(distdir)/$$d ; \
-         cp $(srcdir)/$$d/*.asm $(srcdir)/$$d/*.m4 $(distdir)/$$d ; \
+         mkdir "$(distdir)/$$d" ; \
+         cp $(srcdir)/$$d/*.asm $(srcdir)/$$d/*.m4 "$(distdir)/$$d" ; \
        done
        set -e; for d in $(SUBDIRS); do \
-         sd=$(distdir)/$$d ; \
-         mkdir $$sd && $(MAKE) -C $$d distdir=../$$sd $@ ; \
+         sd="$(distdir)/$$d" ; \
+         mkdir "$$sd" && $(MAKE) -C $$d distdir="`cd $$sd && pwd`" $@ ; \
        done
 
 dist: distdir
index 79892d62194bdf65a26e5a34f33e5717a88597b3..f742124bad12b0e3561a4899babbe5db99d9cfc4 100644 (file)
@@ -26,10 +26,11 @@ all: $(TARGETS)
 .c.$(OBJEXT):
        $(COMPILE) -c $<
 .o$(EXEEXT):
-       $(LINK) $^ -lnettle $(LIBS) -o $@
+       $(LINK) $< io.o -lnettle $(LIBS) -o $@
 
-nettle-benchmark: nettle-benchmark.o nettle-openssl.o ../libnettle.a
-       $(LINK) $^ -lnettle $(LIBS) $(OPENSSL_LIBFLAGS) -o $@
+nettle-benchmark: nettle-benchmark.o nettle-openssl.o
+       $(LINK) nettle-benchmark.o nettle-openssl.o io.o \
+       -lnettle $(LIBS) $(OPENSSL_LIBFLAGS) -o $@
 
 $(TARGETS) : io.o ../libnettle.a
 
@@ -45,7 +46,7 @@ install uninstall:
        true
 
 distdir: $(DISTFILES)
-       cp $^ $(distdir)
+       cp $? $(distdir)
 
 clean:
        -rm -f $(TARGETS) *.o
index 90d172d903ebaf578d8f685d484bec93d835bfa8..dc8ba6faede1cea25fb507b9ded4f83ccce72729 100644 (file)
@@ -58,7 +58,7 @@ install uninstall:
        true
 
 distdir: $(DISTFILES)
-       cp $^ $(distdir)
+       cp $? $(distdir)
 
 clean:
        -rm -f $(TARGETS) *.o test.in test1.out test2.out
index 895ffd041dd7196e40a5702154a3f1437b2eceac..7928e6eb6d4e00045b58762ca8f1ee04060f99d7 100644 (file)
@@ -21,11 +21,12 @@ SOURCES = $(sexp_conv_SOURCES) nettle-lfib-stream.c
 
 DISTFILES = $(SOURCES) Makefile.in getopt.h input.h misc.h output.h parse.h
 
-sexp-conv: $(sexp_conv_SOURCES:.c=.$(OBJEXT)) ../libnettle.a
-       $(LINK) $^ -lnettle $(LIBS) -o $@
+sexp_conv_OBJS = $(sexp_conv_SOURCES:.c=.$(OBJEXT))
+sexp-conv: $(sexp_conv_OBJS) ../libnettle.a
+       $(LINK) $(sexp_conv_OBJS) -lnettle $(LIBS) -o $@
 
 nettle-lfib-stream: nettle-lfib-stream.$(OBJEXT) ../libnettle.a
-       $(LINK) $^ -lnettle $(LIBS) -o $@
+       $(LINK) $< -lnettle $(LIBS) -o $@
 
 .c.$(OBJEXT):
        $(COMPILE) -c $< && $(DEP_PROCESS)
@@ -46,8 +47,10 @@ uninstall:
          rm -f $(DESTDIR)$(bindir)/$$f ; \
        done
 
+# NOTE: I'd like to use $^, but that's a GNU extension. $? should be
+# more portable, equivalent for phony targets.
 distdir: $(DISTFILES)
-       cp $^ $(distdir)
+       cp $? $(distdir)
 
 clean:
        -rm -f $(TARGETS) *.o