Don't make generated files read-only. That would bother too many
[gnulib.git] / modules / configmake
1 Description:
2 Variables set by "configure" or "make".
3
4 Files:
5
6 Depends-on:
7
8 configure.ac:
9
10 Makefile.am:
11 # Retrieve values of the variables through 'configure' followed by
12 # 'make', not directly through 'configure', so that a user who
13 # sets some of these variables consistently on the 'make' command
14 # line gets correct results.
15 #
16 # One advantage of this approach, compared to the classical
17 # approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS,
18 # is that it protects against the use of undefined variables.
19 # If, say, $(libdir) is not set in the Makefile, LIBDIR is not
20 # defined by this module, and code using LIBDIR gives a
21 # compilation error.
22 #
23 # Another advantage is that 'make' output is shorter.
24 #
25 # Listed in the same order as the GNU makefile conventions.
26 configmake.h: Makefile
27         rm -f $@-t $@
28         ( \
29           echo '#define PREFIX "$(prefix)"'; \
30           echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
31           echo '#define BINDIR "$(bindir)"'; \
32           echo '#define SBINDIR "$(sbindir)"'; \
33           echo '#define LIBEXECDIR "$(libexecdir)"'; \
34           echo '#define DATAROOTDIR "$(datarootdir)"'; \
35           echo '#define DATADIR "$(datadir)"'; \
36           echo '#define SYSCONFDIR "$(sysconfdir)"'; \
37           echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
38           echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
39           echo '#define INCLUDEDIR "$(includedir)"'; \
40           echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
41           echo '#define DOCDIR "$(docdir)"'; \
42           echo '#define INFODIR "$(infodir)"'; \
43           echo '#define HTMLDIR "$(htmldir)"'; \
44           echo '#define DVIDIR "$(dvidir)"'; \
45           echo '#define PDFDIR "$(pdfdir)"'; \
46           echo '#define PSDIR "$(psdir)"'; \
47           echo '#define LIBDIR "$(libdir)"'; \
48           echo '#define LISPDIR "$(lispdir)"'; \
49           echo '#define LOCALEDIR "$(localedir)"'; \
50           echo '#define MANDIR "$(mandir)"'; \
51           echo '#define MANEXT "$(manext)"'; \
52         :) | sed '/""/d' >$@-t
53         mv $@-t $@
54 BUILT_SOURCES += configmake.h
55 CLEANFILES += configmake.h configmake.h-t
56
57 Include:
58 "configmake.h"
59
60 License:
61 LGPL
62
63 Maintainer:
64 all