]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
src/Makefile.am: fix detection of .bak files
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 2 Aug 2019 20:16:31 +0000 (22:16 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 5 Aug 2019 11:23:57 +0000 (13:23 +0200)
This fixes detection in a way to work in builds outside the
source directory.

Resolves: #810

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
src/Makefile.am

index 501bca58c160c4ebea9ec3d802eeb72f3be0010c..b2409fff2ec2c23f7c0d06666da8820dac836d73 100644 (file)
@@ -275,16 +275,15 @@ SUFFIXES = .stamp .def .c.bak .h.bak
 if NEED_LIBOPTS
 # case --enable-local-libopts: We do not call AUTOGEN unless the .bak files are missing
 .def.stamp:
-       @b=`echo $@ | sed 's/.stamp$$//'`; \
-       if ! test -f $${srcdir}$${b}.c.bak;then \
+       $(AM_V_GEN) b=`echo $@ | sed 's/.stamp$$//'`; \
+       if ! test -f $(srcdir)/$${b}.c.bak;then \
                echo "No .bak files found; will call autogen"; \
-               $(AM_V_GEN) $(AUTOGEN) $<; \
+               $(AUTOGEN) $<; \
        else \
                echo "Re-using .bak files"; \
-               srcdir=$(srcdir)/; \
                rm -f $${b}.c $${b}.h; \
-               cp -p $${srcdir}$${b}.c.bak $${b}.c; \
-               cp -p $${srcdir}$${b}.h.bak $${b}.h; \
+               cp -p $(srcdir)/$${b}.c.bak $${b}.c; \
+               cp -p $(srcdir)/$${b}.h.bak $${b}.h; \
        fi
        touch $@
 else