Fixed a number of documentation bugs, plus some build/install issues:
[make.git] / maintMakefile
blob4599e156ae7deb9b448ff7c115e7e0669e953408
1 # Maintainer-only makefile segment.  This contains things that are relevant
2 # only if you have the full copy of the GNU make sources from the CVS
3 # tree, not a dist copy.
5 # We like mondo-warnings!
6 AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
8 # I want this one but I have to wait for the const cleanup!
9 # -Wwrite-strings
11 # Find the glob source files... this might be dangerous, but we're maintainers!
12 globsrc := $(wildcard glob/*.c)
13 globhdr := $(wildcard glob/*.h)
15 TEMPLATES = README README.DOS README.W32 README.OS2 \
16             config.ami configh.dos config.h.W32 config.h-vms
17 MTEMPLATES = Makefile.DOS SMakefile
19 # These are built as a side-effect of the dist rule
20 #all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
22 # General rule for turning a .template into a regular file.
24 $(TEMPLATES) : % : %.template Makefile
25         rm -f $@
26         sed -e 's@%VERSION%@$(VERSION)@g' \
27             -e 's@%PACKAGE%@$(PACKAGE)@g' \
28           $< > $@
29         chmod a-w $@
31 # Construct Makefiles by adding on dependencies, etc.
33 $(MTEMPLATES) : % : %.template .dep_segment Makefile
34         rm -f $@
35         sed -e 's@%VERSION%@$(VERSION)@g' \
36             -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
37             -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
38             -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
39             -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
40             -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
41           $< > $@
42         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
43           cat $(word 2,$^) >>$@
44         chmod a-w $@
46 NMakefile: NMakefile.template .dep_segment Makefile
47         rm -f $@
48         cp $< $@
49         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
50           sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
51         chmod a-w $@
53 # Construct build.sh.in
55 build.sh.in: build.template Makefile
56         rm -f $@
57         sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
58             -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
59           $< > $@
60         chmod a-w+x $@
63 # Use automake to build a dependency list file, for "foreign" makefiles like
64 # Makefile.DOS.
66 # Automake used to have a --generate-deps flag, but it's gone now, so we have
67 # to do it ourselves.
69 DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
70 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
71         rm -f $@
72         (for f in $(DEPDIR)/*.Po; do \
73            echo ""; \
74            echo "# $$f"; \
75            sed  -e '/^[^:]*\.[ch] *:/d' \
76                 -e 's, /usr/[^ ]*,,g' \
77                 -e 's, $(srcdir)/, ,g' \
78                 -e '/^ *\\$$/d' \
79                 -e '/^ *$$/d' \
80                 < $$f; \
81          done) > $@
83 # Get rid of everything "else".
85 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
87 CVS-CLEAN-FILES +=      $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
88                         build.sh.in .deps .dep_segment ABOUT-NLS \
89                         ansi2knr.*
91 # This rule tries to clean the tree right down to how it looks when you do a
92 # virgin CVS checkout.
94 # This target is potentially dangerous since it removes _ANY FILE_ that
95 # is not in CVS.  Including files you might mean to add to CVS but
96 # haven't yet...  I only use this in subdirectories where it's unlikely
97 # we have any new files.  Still... be careful!!
99 cvsclean = $(PERL) -e '$$k{CVS} = 1; open(E,"< CVS/Entries") || die "CVS/Entries: $$!\n"; while (defined ($$_ = <E>)) { m%^/([^/]*)% or next; $$k{$$1} = 1; } close(E) || die "CVS/Entries: $$!\n"; opendir(D, ".") || die ".: $$!\n"; while (defined ($$_ = readdir(D))) { -f $$_ && ! exists $$k{$$_} && unlink($$_); } closedir(D) || die ".: $$!\n";'
101 .PHONY: cvs-clean
102 cvs-clean: maintainer-clean
103         -rm -rf *~ $(CVS-CLEAN-FILES)
104         -cd config && $(cvsclean)
105         -cd po     && $(cvsclean)
106         -cd doc    && $(cvsclean)
107         -cd glob   && $(cvsclean)
110 # ----------------------------------------------------------------------
112 # The sections below were stolen from the Makefile.maint used by fileutils,
113 # sh-utils, textutils, CPPI, Bison, and Autoconf.
116 ## ---------------- ##
117 ## Updating files.  ##
118 ## ---------------- ##
120 WGET = wget --passive-ftp -nv
121 ftp-gnu = ftp://ftp.gnu.org/gnu
123 move_if_change =  if test -r $(target) && cmp -s $(target).t $(target); then \
124                     echo $(target) is unchanged; rm -f $(target).t; \
125                   else \
126                     mv $(target).t $(target); \
127                   fi
129 # ------------------- #
130 # Updating PO files.  #
131 # ------------------- #
133 # PO archive mirrors --- Be careful; some might not be fully populated!
134 #   ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
135 #   http://translation.sf.net/maint/
136 #   ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
138 po_repo = http://www.iro.umontreal.ca/translation/maint/$(PACKAGE)
139 .PHONY: do-po-update po-update
140 do-po-update:
141         tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
142           && rm -rf "$$tmppo" \
143           && mkdir "$$tmppo" \
144           && (cd "$$tmppo" \
145                 && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) \
146           && cp "$$tmppo"/*.po po && rm -rf "$$tmppo"
147         cd po && $(MAKE) update-po
148         $(MAKE) po-check
150 po-update:
151         if test -d "po"; then \
152           $(MAKE) do-po-update; \
153         fi
155 # -------------------------- #
156 # Updating GNU build files.  #
157 # -------------------------- #
159 # The following pseudo table associates a local directory and a URL
160 # with each of the files that belongs to some other package and is
161 # regularly updated from the specified URL.
163 savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
164 target = $(patsubst get-%,%,$@)
166 config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
167 get-config/config.guess get-config/config.sub:
168         @echo $(WGET) $(config-url) -O $(target) \
169           && $(WGET) $(config-url) -O $(target).t \
170           && $(move_if_change)
172 gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
173 get-config/texinfo.tex:
174         @echo $(WGET) $(gnulib-url) -O $(target) \
175           && $(WGET) $(gnulib-url) -O $(target).t \
176           && $(move_if_change)
178 gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
179 get-doc/make-stds.texi get-doc/fdl.texi:
180         @echo $(WGET) $(gnustandards-url) -O $(target) \
181           && $(WGET) $(gnustandards-url) -O $(target).t \
182           && $(move_if_change)
184 .PHONY: cvs-update
185 cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
188 # --------------------- #
189 # Updating everything.  #
190 # --------------------- #
192 .PHONY: update
193 update: po-update cvs-update
196 ## --------------- ##
197 ## Sanity checks.  ##
198 ## --------------- ##
200 # Checks that don't require cvs.  Run `changelog-check' last as
201 # previous test may reveal problems requiring new ChangeLog entries.
202 local-check: po-check changelog-check
204 # copyright-check writable-files
206 changelog-check:
207         if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
208           :; \
209         else \
210           echo "$(VERSION) not in ChangeLog" 1>&2; \
211           exit 1; \
212         fi
214 # Verify that all source files using _() are listed in po/POTFILES.in.
215 # Ignore make.h; it defines _().
216 po-check:
217         if test -f po/POTFILES.in; then \
218           grep '^[^#]' po/POTFILES.in | sort > $@-1; \
219           $(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "make.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \
220           diff -u $@-1 $@-2 || exit 1; \
221           rm -f $@-1 $@-2; \
222         fi
224 ## ------------------------- ##
225 ## GNU FTP upload artifacts. ##
226 ## ------------------------- ##
228 # This target creates the upload artifacts.
229 # Sign it with my key.
231 GPG = gpg
232 GPGFLAGS = -u 6338B6D4
234 DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
235 DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
237 .PHONY: distsign
238 distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
240 $(DIST_ARCHIVES_DIRECTIVE): .directive.asc
241         cp $< $@
243 %.sig : %
244         @echo "Signing file '$<':"
245         $(GPG) $(GPGFLAGS) -o $@ -b $<
247 .directive.asc:
248         @echo "Creating directive file '$@':"
249         @echo 'directory: make' > .directive
250         $(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
251         @rm -f .directive
253 # Upload the artifacts
255 FTPPUT = ncftpput
256 gnu-url = ftp-upload.gnu.org /incoming
258 UPLOADS = upload-alpha upload-ftp
259 .PHONY: $(UPLOADS)
260 $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
261         $(FTPPUT) $(gnu-url)/$(@:upload-%=%) $^
264 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
265 # Free Software Foundation, Inc.
266 # This file is part of GNU Make.
268 # GNU Make is free software; you can redistribute it and/or modify it under the
269 # terms of the GNU General Public License as published by the Free Software
270 # Foundation; either version 2, or (at your option) any later version.
272 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
273 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
274 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
276 # You should have received a copy of the GNU General Public License along with
277 # GNU Make; see the file COPYING.  If not, write to the Free Software
278 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.