Make generated files be read-only.
authorJim Meyering <jim@meyering.net>
Wed, 6 Sep 2006 21:58:00 +0000 (21:58 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 6 Sep 2006 21:58:00 +0000 (21:58 +0000)
* modules/alloca-opt (Makefile.am): Work also when $@ is read-only.
Ensure that each generated file is now read-only.
* modules/argz: Likewise.
* modules/arpa_inet: Likewise.
* modules/byteswap: Likewise.
* modules/configmake: Likewise.
* modules/fcntl: Likewise.
* modules/fnmatch: Likewise.
* modules/getopt: Likewise.
* modules/glob: Likewise.
* modules/inttypes: Likewise.
* modules/netinet_in: Likewise.
* modules/poll: Likewise.
* modules/stdbool: Likewise.
* modules/stdint: Likewise.
* modules/sys_select: Likewise.
* modules/sys_socket: Likewise.
* modules/sys_stat: Likewise.
* modules/sysexits: Likewise.
* modules/localcharset: Same as above, but continue using temporary
file named "t-$@" (why different?) rather than the "$@-t" used
everywhere else.

* modules/sysexits (Makefile.am): Replace literal occurrences
of "sysexit.h" more readable, and more consistent, "$@".

20 files changed:
ChangeLog
modules/alloca-opt
modules/argz
modules/arpa_inet
modules/byteswap
modules/configmake
modules/fcntl
modules/fnmatch
modules/getopt
modules/glob
modules/inttypes
modules/localcharset
modules/netinet_in
modules/poll
modules/stdbool
modules/stdint
modules/sys_select
modules/sys_socket
modules/sys_stat
modules/sysexits

index 129879048dd84096b6adc14e740b834514c1c579..8a416af2bd1159a572910eada7a1328624908c7f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2006-09-06  Jim Meyering  <jim@meyering.net>
+
+       Make generated files be read-only.
+       * modules/alloca-opt (Makefile.am): Work also when $@ is read-only.
+       Ensure that each generated file is now read-only.
+       * modules/argz: Likewise.
+       * modules/arpa_inet: Likewise.
+       * modules/byteswap: Likewise.
+       * modules/configmake: Likewise.
+       * modules/fcntl: Likewise.
+       * modules/fnmatch: Likewise.
+       * modules/getopt: Likewise.
+       * modules/glob: Likewise.
+       * modules/inttypes: Likewise.
+       * modules/netinet_in: Likewise.
+       * modules/poll: Likewise.
+       * modules/stdbool: Likewise.
+       * modules/stdint: Likewise.
+       * modules/sys_select: Likewise.
+       * modules/sys_socket: Likewise.
+       * modules/sys_stat: Likewise.
+       * modules/sysexits: Likewise.
+       * modules/localcharset: Same as above, but continue using temporary
+       file named "t-$@" (why different?) rather than the "$@-t" used
+       everywhere else.
+
+       * modules/sysexits (Makefile.am): Replace literal occurrences
+       of "sysexit.h" more readable, and more consistent, "$@".
+
 2006-09-05  Bruno Haible  <bruno@clisp.org>
 
        * modules/gc (Makefile.am): Augment lib_LDFLAGS, not lib_LIBADD.
index 2e051d3deb11070e59a31c5c4b1aba6477cf28ad..dd2959df5f131ce7b3fcd446143479c16d1a003d 100644 (file)
@@ -19,7 +19,9 @@ EXTRA_DIST += alloca_.h
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
 alloca.h: alloca_.h
+       rm -f $@-t $@
        cp $(srcdir)/alloca_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += alloca.h alloca.h-t
 
index bf587c4928e118d0b8c45bc6fa47416212351b86..fe1e40d5123014fce176753a1b45ad7e9fb2320a 100644 (file)
@@ -18,7 +18,9 @@ EXTRA_DIST += argz_.h
 # We need the following in order to create <argz.h> when the system
 # doesn't have one that works with the given compiler.
 argz.h: argz_.h
+       rm -f $@-t $@
        cp $(srcdir)/argz_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += argz.h argz.h-t
 
index 3ff0340a0f57c72ff035c66d62bd59e72d08c0c2..17a14c0dfa8f8cd773e30924bd8ebb6d58ac25c4 100644 (file)
@@ -17,7 +17,9 @@ BUILT_SOURCES += $(ARPA_INET_H)
 # doesn't have one.
 arpa/inet.h:
        test -d arpa || mkdir arpa
+       rm -f $@-t $@
        echo '#include <sys/socket.h>' >$@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
 MOSTLYCLEANDIRS += arpa
index 5ff0618b1635236342ed7ef73a2bb4a77052ab7d..b667b9437c21ae0bfa8e03c85be31fcdcc7ca6ba 100644 (file)
@@ -17,7 +17,9 @@ EXTRA_DIST += byteswap_.h
 # We need the following in order to create <byteswap.h> when the system
 # doesn't have one.
 byteswap.h: byteswap_.h
+       rm -f $@-t $@
        cp $(srcdir)/byteswap_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += byteswap.h byteswap.h-t
 
index 8090a33c4fc3afe4ab0eab8d2e1344349fb844ca..c3e9b37d63aa9a6738d3786fdc95355b23b7122b 100644 (file)
@@ -24,6 +24,7 @@ Makefile.am:
 #
 # Listed in the same order as the GNU makefile conventions.
 configmake.h: Makefile
+       rm -f $@-t $@
        ( \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@@ -49,6 +50,7 @@ configmake.h: Makefile
          echo '#define MANDIR "$(mandir)"'; \
          echo '#define MANEXT "$(manext)"'; \
        :) | sed '/""/d' >$@-t
+       chmod a-x $@-t
        mv $@-t $@
 BUILT_SOURCES += configmake.h
 CLEANFILES += configmake.h configmake.h-t
index 4d0c83ddc4a551c47a435e8f4442218ebfda4edb..ca1637b74dde91bdd5f22ab6713ff31fc46e8618 100644 (file)
@@ -19,8 +19,10 @@ EXTRA_DIST += fcntl_.h
 # We need the following in order to create <fcntl.h> when the system
 # doesn't have one that works with the given compiler.
 fcntl.h: fcntl_.h
+       rm -f $@-t $@
        sed -e 's|@''ABSOLUTE_FCNTL_H''@|$(ABSOLUTE_FCNTL_H)|g' \
            < $(srcdir)/fcntl_.h > $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += fcntl.h fcntl.h-t
 
index 18f278c7d0bc30aa1b6bb0adafaa7ecc11f30e50..bd13b8557f1318b66a1e01d589ea64c9200bde97 100644 (file)
@@ -22,7 +22,9 @@ EXTRA_DIST += fnmatch_.h fnmatch_loop.c
 # We need the following in order to create <fnmatch.h> when the system
 # doesn't have one that supports the required API.
 fnmatch.h: fnmatch_.h
+       rm -f $@-t $@
        cp $(srcdir)/fnmatch_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
 
index 55fc61a603a6e52223f2fd56d640e48abf9b5d53..26e506ca57a845a8ed7d950282e1fc429294ed42 100644 (file)
@@ -22,7 +22,9 @@ EXTRA_DIST += getopt_.h getopt_int.h
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
 getopt.h: getopt_.h
+       rm -f $@-t $@
        cp $(srcdir)/getopt_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += getopt.h getopt.h-t
 
index 3dcfc6587c64c6878446483baeac55dbca4f0e6a..6d6f71cabd73b9fc14f7d1482990cc5862c39502 100644 (file)
@@ -30,7 +30,9 @@ EXTRA_DIST += glob_.h glob-libc.h
 # We need the following in order to create <glob.h> when the system
 # doesn't have one that works with the given compiler.
 glob.h: glob_.h
+       rm -f $@-t $@
        cp $(srcdir)/glob_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += glob.h glob.h-t
 
index c397a4a197c050538d3959dda7b57d0818164758..5cb1e6d90b38c719245dc8d19f0a6b89ca45b0bf 100644 (file)
@@ -21,6 +21,7 @@ EXTRA_DIST += inttypes_.h
 # We need the following in order to create <inttypes.h> when the system
 # doesn't have one that works with the given compiler.
 inttypes.h: inttypes_.h
+       rm -f $@-t $@
        sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
            -e 's|@''ABSOLUTE_INTTYPES_H''@|$(ABSOLUTE_INTTYPES_H)|g' \
            -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
@@ -31,6 +32,7 @@ inttypes.h: inttypes_.h
            -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
            -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
            < $(srcdir)/inttypes_.h > $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += inttypes.h inttypes.h-t
 
index d45adb7622980ffab54e202f1f9d8875dcc44272..0fccf8f884f9480d2d495ae1ab99df170c309793 100644 (file)
@@ -59,12 +59,16 @@ uninstall-local: all-local
        fi
 
 charset.alias: config.charset
+       rm -f t-$@ $@
        $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
+       chmod a-x t-$@
        mv t-$@ $@
 
 SUFFIXES += .sed .sin
 .sin.sed:
+       rm -f t-$@ $@
        sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
+       chmod a-x t-$@
        mv t-$@ $@
 
 CLEANFILES += charset.alias ref-add.sed ref-del.sed
index 47c00d0cb8fa49cb9da5a573fdd7f2619f1c469b..9ab4a2764e175a23ad706d3c42b41dae64aa3f71 100644 (file)
@@ -17,7 +17,9 @@ BUILT_SOURCES += $(NETINET_IN_H)
 # doesn't have one.
 netinet/in.h:
        test -d netinet || mkdir netinet
+       rm -f $@-t $@
        echo '#include <sys/socket.h>' >$@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
 MOSTLYCLEANDIRS += netinet
index 18a01dd6f0d1b38c8869db32a2567130f5d017f6..f4de479d977719ba90568c4fea54b158ebfe0216 100644 (file)
@@ -18,7 +18,9 @@ EXTRA_DIST += poll_.h
 # We need the following in order to create <poll.h> when the system
 # doesn't have one.
 poll.h: poll_.h
+       rm -f $@-t $@
        cp $(srcdir)/poll_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += poll.h poll.h-t
 
index e3e06ab63b36a4b74ae012e8452980c9b20e8190..d5247fa46b1f8a93f81a70cb3a9ad6061b1611f3 100644 (file)
@@ -18,7 +18,9 @@ EXTRA_DIST += stdbool_.h
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
 stdbool.h: stdbool_.h
+       rm -f $@-t $@
        sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += stdbool.h stdbool.h-t
 
index 73921cb8d4ef258d938b410263656cfc6f4248f0..7ace1c069a033ea1be0882429e5dd3837938d0c6 100644 (file)
@@ -24,6 +24,7 @@ EXTRA_DIST += stdint_.h
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
 stdint.h: stdint_.h
+       rm -f $@-t $@
        sed -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
            -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
            -e 's|@''ABSOLUTE_STDINT_H''@|$(ABSOLUTE_STDINT_H)|g' \
@@ -46,6 +47,7 @@ stdint.h: stdint_.h
            -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
            -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
            < $(srcdir)/stdint_.h > $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += stdint.h stdint.h-t
 
index efe3f889971fadada09298bc8902517f57d8a227..5a34721340946d6808228a830cd2d35863c479d2 100644 (file)
@@ -17,7 +17,9 @@ BUILT_SOURCES += $(SYS_SELECT_H)
 # doesn't have one that works with the given compiler.
 sys/select.h:
        test -d sys || mkdir sys
+       rm -f $@-t $@
        echo '#include <sys/socket.h>' >$@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += sys/select.h sys/select.h-t
 MOSTLYCLEANDIRS += sys
index cf9b86e58960ed43871671349738ccdae2dcc5dd..aa869548d5c7d0ac414f302c95de8c1e17b5c1fb 100644 (file)
@@ -19,7 +19,9 @@ EXTRA_DIST += socket_.h
 # doesn't have one that works with the given compiler.
 sys/socket.h: socket_.h
        test -d sys || mkdir sys
+       rm -f $@-t $@
        cp $(srcdir)/socket_.h $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
 MOSTLYCLEANDIRS += sys
index f3564e7e233b748582bd87ed5898822f80d1099c..3ee74565052a337a8dd9ae73dc22659179529633 100644 (file)
@@ -19,8 +19,10 @@ EXTRA_DIST += stat_.h
 # has one that is incomplete.
 sys/stat.h: stat_.h
        test -d sys || mkdir sys
+       rm -f $@-t $@
        sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \
            < $(srcdir)/stat_.h > $@-t
+       chmod a-x $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
 MOSTLYCLEANDIRS += sys
index fe59632b76e20223fab29d12708e492e12bede14..20d46bd86a826e26dabbe6d18afa18b524f824ee 100644 (file)
@@ -17,8 +17,10 @@ EXTRA_DIST += sysexit_.h
 # We need the following in order to create <sysexits.h> when the system
 # doesn't have one that works with the given compiler.
 sysexits.h: sysexit_.h
-       cp $(srcdir)/sysexit_.h sysexits.h-t
-       mv sysexits.h-t sysexits.h
+       rm -f $@-t $@
+       cp $(srcdir)/sysexit_.h $@-t
+       chmod a-x $@-t
+       mv $@-t $@
 MOSTLYCLEANFILES += sysexits.h sysexits.h-t
 
 Include: