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!
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
26 sed -e 's@%VERSION%@$(VERSION)@g' \
27 -e 's@%PACKAGE%@$(PACKAGE)@g' \
31 # Construct Makefiles by adding on dependencies, etc.
33 $(MTEMPLATES) : % : %.template .dep_segment Makefile
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' \
42 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
46 NMakefile: NMakefile.template .dep_segment Makefile
49 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
50 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
53 # Construct build.sh.in
55 build.sh.in: build.template Makefile
57 sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
58 -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
63 # Use automake to build a dependency list file, for "foreign" makefiles like
66 # Automake used to have a --generate-deps flag, but it's gone now, so we have
69 DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
70 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
72 (for f in $(DEPDIR)/*.Po; do \
75 sed -e '/^[^:]*\.[ch] *:/d' \
76 -e 's, /usr/[^ ]*,,g' \
77 -e 's, $(srcdir)/, ,g' \
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 \
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";'
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; \
126 mv $(target).t $(target); \
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://translationproject.org/latest/$(PACKAGE)
139 .PHONY: do-po-update po-update
141 tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
142 && rm -rf "$$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
151 if test -d "po"; then \
152 $(MAKE) do-po-update; \
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 \
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 \
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 \
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 # --------------------- #
193 update: po-update cvs-update
196 ## --------------- ##
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
207 if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
210 echo "$(VERSION) not in ChangeLog" 1>&2; \
214 # Verify that all source files using _() are listed in po/POTFILES.in.
215 # Ignore make.h; it defines _().
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; \
224 ## ------------------------- ##
225 ## GNU FTP upload artifacts. ##
226 ## ------------------------- ##
228 # This target creates the upload artifacts.
229 # Sign it with my key. If you don't have my key/passphrase then sorry,
233 GPGFLAGS = -u 6338B6D4
235 DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
236 DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
238 # A simple rule to test signing, etc.
240 distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
243 @echo "Signing file '$<':"
244 $(GPG) $(GPGFLAGS) -o "$@" -b "$<"
247 @echo "Creating directive file '$@':"
249 echo 'verstion: 1.1'; \
250 echo 'directory: make'; \
251 echo 'filename: $*'; \
252 echo 'comment: Official upload of GNU make version $(VERSION)'; \
254 $(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
255 @rm -f "$*.directive"
257 # Upload the artifacts
260 gnu-url = ftp-upload.gnu.org /incoming
262 UPLOADS = upload-alpha upload-ftp
264 $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
265 $(FTPPUT) "$(gnu-url)/$(@:upload-%=%)" $^
268 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
269 # 2007 Free Software Foundation, Inc.
270 # This file is part of GNU Make.
272 # GNU Make is free software; you can redistribute it and/or modify it under
273 # the terms of the GNU General Public License as published by the Free Software
274 # Foundation; either version 3 of the License, or (at your option) any later
277 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
278 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
279 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
282 # You should have received a copy of the GNU General Public License along with
283 # this program. If not, see <http://www.gnu.org/licenses/>.