am-ft: make the environment available earlier
[platform/upstream/automake.git] / t / insthook.sh
old mode 100755 (executable)
new mode 100644 (file)
index db243df..d2558e2
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,9 +27,9 @@ cat >Makefile.am <<'END'
 dist_bin_SCRIPTS = foo
 
 install-exec-hook:
-       cd "$(DESTDIR)$(bindir)" && \
-       mv -f foo foo-$(VERSION) && \
-       $(LN_S) foo-$(VERSION) foo
+       cd "$(DESTDIR)$(bindir)" \
+         && mv -f foo foo-$(VERSION) \
+         && $(LN_S) foo-$(VERSION) foo
 
 installcheck-local:
        test -f "$(bindir)/foo"
@@ -40,7 +40,7 @@ uninstall-hook:
        rm -f $(DESTDIR)$(bindir)/foo-$(VERSION)
 END
 
-echo 1 > foo
+echo a > foo
 
 $ACLOCAL
 $AUTOCONF
@@ -58,11 +58,11 @@ test -f ok
 # version.)
 ./configure "--bindir=$(pwd)/bin"
 $MAKE install
-echo 2 > foo
-VERSION=2.0 $MAKE -e install
-grep 1 bin/foo-1.0
-grep 2 bin/foo-2.0
-grep 2 bin/foo
+echo b > foo
+run_make VERSION=2.0 install
+test $(cat bin/foo-1.0) = a
+test $(cat bin/foo-2.0) = b
+test $(cat bin/foo)     = b
 
 # install-hook is an error.
 cat >>Makefile.am <<EOF