about summary refs log tree commit diff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-04-11 23:00:45 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-04-11 23:00:45 +0000
commitb8da51f799c914cdcf4b5665a75abee488cb1007 (patch)
tree82d0bf3ea743cd07c2d7117a07dcf0145c560a75 /GNUmakefile
parent6a4d2dc5363140a6571d12593cf7aa3cc599ce47 (diff)
downloadnetpbm-mirror-b8da51f799c914cdcf4b5665a75abee488cb1007.tar.gz
netpbm-mirror-b8da51f799c914cdcf4b5665a75abee488cb1007.tar.xz
netpbm-mirror-b8da51f799c914cdcf4b5665a75abee488cb1007.zip
Exploit .DELETE_ON_ERROR feature of GNU Make
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@279 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile28
1 files changed, 14 insertions, 14 deletions
diff --git a/GNUmakefile b/GNUmakefile
index a65ac0d4..0103aa9f 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -106,10 +106,8 @@ $(TYPEGEN) $(ENDIANGEN): $(BUILDDIR)/buildtools
 	$(MAKE) -C $(dir $@) -f $(SRCDIR)/buildtools/Makefile \
 	    SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) $(notdir $@) 
 
-DELETEIT = (rm -f $@ || false)
-
 inttypes_netpbm.h: $(TYPEGEN)
-	$(TYPEGEN) >$@ || $(DELETEIT)
+	$(TYPEGEN) >$@
 
 # We run a couple of programs on the build machine in computing the
 # contents of pm_config.h.  We need to give the user a way not to do
@@ -119,27 +117,29 @@ inttypes_netpbm.h: $(TYPEGEN)
 pm_config.h: \
   $(SRCDIR)/pm_config.in.h Makefile.config inttypes_netpbm.h \
   $(ENDIANGEN)
-	echo '/* pm_config.h GENERATED BY A MAKE RULE */' >$@ || $(DELETEIT)
-	echo '#ifndef PM_CONFIG_H' >>$@ || $(DELETEIT)
-	echo '#define PM_CONFIG_H' >>$@ || $(DELETEIT)
+# Note that this rule depends on the effect of the .DELETE_ON_ERROR
+# target we get from Makefile.common
+	echo '/* pm_config.h GENERATED BY A MAKE RULE */' >$@
+	echo '#ifndef PM_CONFIG_H' >>$@
+	echo '#define PM_CONFIG_H' >>$@
 ifeq ($(INTTYPES_H)x,x)
 	echo '/* Don't need to #include any inttypes.h-type thing */
 else
   ifeq ($(INTTYPES_H),"inttypes_netpbm.h")
-	cat inttypes_netpbm.h >>$@ || $(DELETEIT)
+	cat inttypes_netpbm.h >>$@
   else
-	echo '#include $(INTTYPES_H)' >>$@ || $(DELETEIT)
+	echo '#include $(INTTYPES_H)' >>$@
   endif
 endif
 ifeq ($(HAVE_INT64),Y)
-	echo "#define HAVE_INT64 1" >>$@ || $(DELETEIT)
+	echo "#define HAVE_INT64 1" >>$@
 else
-	echo "#define HAVE_INT64 0" >>$@ || $(DELETEIT)
+	echo "#define HAVE_INT64 0" >>$@
 endif	
-	echo '/* pm_config.h.in FOLLOWS ... */' >>$@ || $(DELETEIT)
-	cat $(SRCDIR)/pm_config.in.h >>$@ || $(DELETEIT)
-	$(ENDIANGEN) >>$@ || $(DELETEIT)
-	echo '#endif' >>$@ || $(DELETEIT)
+	echo '/* pm_config.h.in FOLLOWS ... */' >>$@
+	cat $(SRCDIR)/pm_config.in.h >>$@
+	$(ENDIANGEN) >>$@
+	echo '#endif' >>$@
 
 
 MAJOR := $(NETPBM_MAJOR_RELEASE)