automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] am: stop using "%KEY:iffalse?iftrue%" transforms


From: Stefano Lattarini
Subject: [PATCH 1/2] am: stop using "%KEY:iffalse?iftrue%" transforms
Date: Fri, 15 Jun 2012 00:06:30 +0200

And the similar "reduced forms" "%KEY:iffalse%" and "%KEY?iftrue%"
as well.

They are harder to grasp, can be easily reformulated in function of
other "plainer" transforms ("?KEY?" and "?!KEY?"), and we'll remove
support for them anyway in a later change.

* lib/am/data.am, lib/am/libs.am, lib/am/lisp.am, lib/am/ltlib.am,
lib/am/progs.am, lib/am/python.am, lib/am/scripts.am: Adjusted not
to rely on those kinds of transforms.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 lib/am/data.am    |    3 ++-
 lib/am/libs.am    |    6 ++++--
 lib/am/lisp.am    |   12 +++++++++---
 lib/am/ltlib.am   |    9 +++++++--
 lib/am/progs.am   |   16 +++++++++++-----
 lib/am/python.am  |    3 ++-
 lib/am/scripts.am |    3 ++-
 7 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/lib/am/data.am b/lib/am/data.am
index b8b6588..b91f55c 100644
--- a/lib/am/data.am
+++ b/lib/am/data.am
@@ -24,7 +24,8 @@ endif %?INSTALL%
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%%PRIMARY%
+?EXEC?.PHONY install-exec-am: install-%DIR%%PRIMARY%
+?!EXEC?.PHONY install-data-am: install-%DIR%%PRIMARY%
 install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
        @$(NORMAL_INSTALL)
 if %?BASE%
diff --git a/lib/am/libs.am b/lib/am/libs.am
index d1f63ae..f94a712 100644
--- a/lib/am/libs.am
+++ b/lib/am/libs.am
@@ -24,7 +24,8 @@ endif %?INSTALL%
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LIBRARIES
+?EXEC?.PHONY install-exec-am: install-%DIR%LIBRARIES
+?!EXEC?.PHONY install-data-am: install-%DIR%LIBRARIES
 install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
        @$(NORMAL_INSTALL)
 if %?BASE%
@@ -69,7 +70,8 @@ endif !%?BASE%
        @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
        for p in $$list; do \
          if test -f $$p; then \
-           %BASE?$(am__strip_dir):f=$$p;% \
+?BASE?     $(am__strip_dir) \
+?!BASE?            f=$$p; \
 ## Must ranlib after installing because mod time changes.
 ## cd to target directory because AIX ranlib messes up with whitespace
 ## in the argument.
diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index ba5c92a..e32bc50 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -83,8 +83,13 @@ $(am__ELCFILES): elc-stamp
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-%DIR%LISP_INSTALL = %BASE?$(INSTALL_DATA):$(install_sh_DATA)%
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LISP
+
+?BASE?%DIR%LISP_INSTALL = $(INSTALL_DATA)
+?!BASE?%DIR%LISP_INSTALL = $(install_sh_DATA)
+
+?EXEC?.PHONY install-exec-am: install-%DIR%LISP
+?!EXEC?.PHONY install-data-am: install-%DIR%LISP
+
 install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
        @$(NORMAL_INSTALL)
 ## Do not install anything if EMACS was not found.
@@ -100,7 +105,8 @@ install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
          for p in $$list; do \
 ## A lisp file can be in the source directory or the build directory.
            if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-           %BASE?$(am__strip_dir):$(am__vpath_adj)% \
+?BASE?     $(am__strip_dir) \
+?!BASE?            $(am__vpath_adj) \
            echo " $(%DIR%LISP_INSTALL) '$$d$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; 
\
            $(%DIR%LISP_INSTALL) "$$d$$p" "$(DESTDIR)$(%NDIR%dir)/$$f" || exit 
$$?; \
 ## Only install .elc file if it exists.
diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am
index 1ca26b5..af3a256 100644
--- a/lib/am/ltlib.am
+++ b/lib/am/ltlib.am
@@ -23,8 +23,12 @@ endif %?INSTALL%
 ## ------------ ##
 
 if %?INSTALL%
+
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LTLIBRARIES
+
+?EXEC?.PHONY install-exec-am: install-%DIR%LTLIBRARIES
+?!EXEC?.PHONY install-data-am: install-%DIR%LTLIBRARIES
+
 install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
        @$(NORMAL_INSTALL)
 if %?BASE%
@@ -89,7 +93,8 @@ uninstall-%DIR%LTLIBRARIES:
        @$(NORMAL_UNINSTALL)
        @list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
        for p in $$list; do \
-         %BASE?$(am__strip_dir):f=$$p;% \
+?BASE?   $(am__strip_dir) \
+?!BASE?          f=$$p; \
 ?LIBTOOL?        echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=uninstall rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
 ?LIBTOOL?        $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=uninstall rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
 ?!LIBTOOL?       echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
diff --git a/lib/am/progs.am b/lib/am/progs.am
index 2be8bca..104270c 100644
--- a/lib/am/progs.am
+++ b/lib/am/progs.am
@@ -20,7 +20,8 @@
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%PROGRAMS
+?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
+?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
 install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
        @$(NORMAL_INSTALL)
 ## Funny invocation because Makefile variable can be empty, leading to
@@ -34,13 +35,16 @@ install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
 ## On Cygwin with libtool test won't see 'foo.exe' but instead 'foo'.
 ## So we check for both.
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p%LIBTOOL? || test -f $$p1%; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+?LIBTOOL?       || test -f $$p1 \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
 ## We now have a list of sourcefile pairs, separated by newline.
 ## Turn that into "sourcefile source_base target_dir xformed_target_base",
 ## with newlines being turned into spaces in a second step.
-       sed -e 'p;s,.*/,,;n;h' -e '%BASE?s|.*|.|:s|[^/]*$$||; s|^$$|.|%' \
+       sed -e 'p;s,.*/,,;n;h' \
+?BASE?     -e 's|.*|.|' \
+?!BASE?            -e 's|[^/]*$$||; s|^$$|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
 ## The following awk script turns that into one line containing directories
@@ -86,7 +90,9 @@ uninstall-%DIR%PROGRAMS:
 ## but keep the directory part in the hold buffer, in order to
 ## reapply it again afterwards in the nobase case.  Append $(EXEEXT).
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/'%BASE? : -e 'x;s,[^/]*$$,,;G;s,\n,,'%`; \
+             -e 's/$$/$(EXEEXT)/' \
+?!BASE?              -e 'x;s,[^/]*$$,,;G;s,\n,,' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
diff --git a/lib/am/python.am b/lib/am/python.am
index cab6129..f9b7790 100644
--- a/lib/am/python.am
+++ b/lib/am/python.am
@@ -26,7 +26,8 @@ endif %?INSTALL%
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON
+?EXEC?.PHONY install-exec-am: install-%DIR%PYTHON
+?!EXEC?.PHONY install-data-am: install-%DIR%PYTHON
 install-%DIR%PYTHON: $(%DIR%_PYTHON)
        @$(NORMAL_INSTALL)
 if %?BASE%
diff --git a/lib/am/scripts.am b/lib/am/scripts.am
index 64e093e..88c1c92 100644
--- a/lib/am/scripts.am
+++ b/lib/am/scripts.am
@@ -25,7 +25,8 @@ endif %?INSTALL%
 if %?INSTALL%
 ## if doesn't work properly for Automake variables yet.
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%SCRIPTS
+?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
+?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
 install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
        @$(NORMAL_INSTALL)
 ## Funny invocation because Makefile variable can be empty, leading to
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]