automake
[Top][All Lists]
Advanced

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

47-use-if-endif.patch


From: Akim Demaille
Subject: 47-use-if-endif.patch
Date: Sun, 11 Mar 2001 19:09:56 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * distdir.am: Use and abuse of if/endif.
        * scripts.am: Using if/endif with variables is fine.

Index: distdir.am
--- distdir.am Sat, 10 Mar 2001 16:24:49 +0100 akim (am/h/17_distdir.am 1.15 
644)
+++ distdir.am Sun, 11 Mar 2001 18:23:31 +0100 akim (am/h/17_distdir.am 1.15 
644)
@@ -33,10 +33,15 @@
 ## For Gnits users, this is pretty handy.  Look at 15 lines
 ## in case some explanatory text is desirable.
 ##
-?TOPDIR??CK-NEWS?      @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" 
>/dev/null; then :; else \
-?TOPDIR??CK-NEWS?        echo "NEWS not updated; not releasing" 1>&2; \
-?TOPDIR??CK-NEWS?        exit 1; \
-?TOPDIR??CK-NEWS?      fi
+if %?TOPDIR%
+if  %?CK-NEWS%
+       @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null;
+       then :; else \
+         echo "NEWS not updated; not releasing" 1>&2; \
+         exit 1; \
+       fi
+endif  %?CK-NEWS%
+endif %?TOPDIR%
 ##
 ## Only for the top dir.
 ##
@@ -80,27 +85,31 @@
 ## directory, then we use `distdir' instead of `top_distdir'; this lets
 ## us work correctly with an enclosing package.
 ##
-?SUBDIRS?      for subdir in $(%DIST_SUBDIR_NAME%); do \
-?SUBDIRS?        if test "$$subdir" = .; then :; else \
-?SUBDIRS?          test -d $(distdir)/$$subdir \
-?SUBDIRS?          || mkdir $(distdir)/$$subdir \
-?SUBDIRS?          || exit 1; \
-?SUBDIRS?          (cd $$subdir && \
-?SUBDIRS?            $(MAKE) $(AM_MAKEFLAGS) \
-?SUBDIRS?              top_distdir="$(top_distdir)" \
-?SUBDIRS?              distdir=../$(distdir)/$$subdir \
-?SUBDIRS?              distdir) \
-?SUBDIRS?            || exit 1; \
-?SUBDIRS?        fi; \
-?SUBDIRS?      done
+if %?SUBDIRS%
+       for subdir in $(%DIST_SUBDIR_NAME%); do \
+         if test "$$subdir" = .; then :; else \
+           test -d $(distdir)/$$subdir \
+           || mkdir $(distdir)/$$subdir \
+           || exit 1; \
+           (cd $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$(top_distdir)" \
+               distdir=../$(distdir)/$$subdir \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+endif %?SUBDIRS%
 ##
 ## We might have to perform some last second updates, such as updating
 ## info files.
 ## We must explicitly set distdir and top_distdir for these sub-makes.
 ##
-?DIST-TARGETS? $(MAKE) $(AM_MAKEFLAGS) \
-?DIST-TARGETS?   top_distdir="${top_distdir}" distdir="$(distdir)" \
-?DIST-TARGETS?   %DIST-TARGETS%
+if %?DIST-TARGETS%
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="${top_distdir}" distdir="$(distdir)" \
+         %DIST-TARGETS%
+endif %?DIST-TARGETS%
 ##
 ## This complex find command will try to avoid changing the modes of
 ## links into the source tree, in case they're hard-linked.  It will
@@ -119,11 +128,13 @@
 ## We use $(install_sh) because that is a known-portable way to modify
 ## the file in place in the source tree.
 ##
-?TOPDIR?       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; 
-o \
-?TOPDIR?         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
-?TOPDIR?         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
-?TOPDIR?         ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r 
{} {} \; \
-?TOPDIR?       || chmod -R a+r $(distdir)
+if %?TOPDIR%
+       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} 
\; \
+       || chmod -R a+r $(distdir)
+endif %?TOPDIR%



@@ -136,38 +147,48 @@
 ## the only reason) is that some versions of tar (e.g., OSF1)
 ## interpret `-z' differently.

-?TOPDIR?GZIP_ENV = --best
-?TOPDIR?.PHONY: dist-all dist
-?TOPDIR?dist-all: dist
-?TOPDIR?dist: distdir
-?TOPDIR?       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c 
>$(distdir).tar.gz
-?TOPDIR?       -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
-
-
-?TOPDIR??BZIP2?.PHONY dist-all: dist-bzip2
-?TOPDIR??BZIP2?dist-bzip2: distdir
-?TOPDIR??BZIP2?        $(AMTAR) chof - $(distdir) | bzip2 -9 -c 
>$(distdir).tar.bz2
-?TOPDIR??BZIP2?        -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf 
$(distdir)
-
-
-?TOPDIR??COMPRESS?.PHONY dist-all: dist-tarZ
-?TOPDIR??COMPRESS?dist-tarZ: distdir
-?TOPDIR??COMPRESS?     $(AMTAR) chof - $(distdir) | compress -c 
>$(distdir).tar.Z
-?TOPDIR??COMPRESS?     -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf 
$(distdir)
-
-
-?TOPDIR??SHAR?.PHONY dist-all: dist-shar
-?TOPDIR??SHAR?dist-shar: distdir
-?TOPDIR??SHAR? shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-?TOPDIR??SHAR? -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
-
+if %?TOPDIR%

-?TOPDIR??ZIP?.PHONY dist-all: dist-zip
-?TOPDIR??ZIP?dist-zip: distdir
-?TOPDIR??ZIP?  -rm -f $(distdir).zip
-?TOPDIR??ZIP?  zip -rq $(distdir).zip $(distdir)
-?TOPDIR??ZIP?  -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+GZIP_ENV = --best
+.PHONY: dist-all dist
+dist-all: dist
+dist: distdir
+       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+
+if  %?BZIP2%
+.PHONY dist-all: dist-bzip2
+dist-bzip2: distdir
+       $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+       -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+endif  %?BZIP2%
+
+
+if  %?COMPRESS%
+.PHONY dist-all: dist-tarZ
+dist-tarZ: distdir
+       $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
+       -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+endif  %?COMPRESS%
+
+
+if  %?SHAR%
+.PHONY dist-all: dist-shar
+dist-shar: distdir
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+endif  %?SHAR%
+
+
+if  %?ZIP%
+.PHONY dist-all: dist-zip
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+endif  %?ZIP%

+endif %?TOPDIR%


 ## ------------------------- ##
@@ -175,43 +196,45 @@
 ## ------------------------- ##


-?TOPDIR?# This target untars the dist file and tries a VPATH configuration.  
Then
-?TOPDIR?# it guarantees that the distribution is self-contained by making 
another
-?TOPDIR?# tarfile.
-?TOPDIR?.PHONY: distcheck
-?TOPDIR?distcheck: dist
+if %?TOPDIR%
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+.PHONY: distcheck
+distcheck: dist
 ## Make sure we can remove distdir before trying to remove it.
-?TOPDIR?       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
-?TOPDIR?       GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+       GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
 ## Make the new source tree read-only.  Distributions ought to work in
 ## this case.  However, make the top-level directory writable so we
 ## can make our new subdirs.
-?TOPDIR?       chmod -R a-w $(distdir); chmod a+w $(distdir)
-?TOPDIR?       mkdir $(distdir)/=build
-?TOPDIR?       mkdir $(distdir)/=inst
+       chmod -R a-w $(distdir); chmod a+w $(distdir)
+       mkdir $(distdir)/=build
+       mkdir $(distdir)/=inst
 ## Undo the write access.
-?TOPDIR?       chmod a-w $(distdir)
-?TOPDIR?       dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
-?TOPDIR??DISTCHECK-HOOK?         && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
-?TOPDIR?         && cd $(distdir)/=build \
-?TOPDIR?         && ../configure --srcdir=.. --prefix=$$dc_install_base \
-?TOPDIR??GETTEXT?          --with-included-gettext \
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) \
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) dvi \
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) check \
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) install \
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+       chmod a-w $(distdir)
+       dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
+?DISTCHECK-HOOK?         && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
+         && cd $(distdir)/=build \
+         && ../configure --srcdir=.. --prefix=$$dc_install_base \
+?GETTEXT?          --with-included-gettext \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
 ## We use -le 1 because the `dir' file might still exist after uninstall.
-?TOPDIR?         && test `find $$dc_install_base -type f -print | wc -l` -le 1 
\
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) dist \
-?TOPDIR?         && $(MAKE) $(AM_MAKEFLAGS) distclean \
+         && test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && $(MAKE) $(AM_MAKEFLAGS) distclean \
 ## Make sure to remove the dist file we created in the test build
 ## directory.
-?TOPDIR?         && rm -f $(distdir).tar.gz \
-?TOPDIR?         && (test `find . -type f -print | wc -l` -eq 0 \
-?TOPDIR?            || (echo "Error: files left after distclean" 1>&2; \
-?TOPDIR?                exit 1) )
-?TOPDIR?       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
-?TOPDIR?       @echo "$(distdir).tar.gz is ready for distribution" | \
-?TOPDIR?         sed 'h;s/./=/g;p;x;p;x'
+         && rm -f $(distdir).tar.gz \
+         && (test `find . -type f -print | wc -l` -eq 0 \
+            || (echo "Error: files left after distclean" 1>&2; \
+                exit 1) )
+       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+       @echo "$(distdir).tar.gz is ready for distribution" | \
+         sed 'h;s/./=/g;p;x;p;x'
+endif %?TOPDIR%
Index: scripts.am
--- scripts.am Fri, 09 Mar 2001 00:28:22 +0100 akim (am/g/15_scripts.am 1.9 644)
+++ scripts.am Sun, 11 Mar 2001 17:33:21 +0100 akim (am/g/15_scripts.am 1.9 644)
@@ -23,7 +23,7 @@

 if %?INSTALL%
 ## if doesn't work properly for Automake variables yet.
-?INSTALL?_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+_am_installdirs += $(DESTDIR)$(%NDIR%dir)
 ?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
 ?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
 install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
Index: Makefile.in
--- Makefile.in Sun, 11 Mar 2001 16:22:45 +0100 akim (am/h/16_Makefile.i 1.43 
644)
+++ Makefile.in Sun, 11 Mar 2001 18:27:52 +0100 akim (am/h/16_Makefile.i 1.43 
644)
@@ -406,7 +406,8 @@
 GZIP_ENV = --best

 distdir: $(DISTFILES)
-       @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; then :; 
else \
+       @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null;
+       then :; else \
          echo "NEWS not updated; not releasing" 1>&2; \
          exit 1; \
        fi



reply via email to

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