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.
|
---|
4 |
|
---|
5 | # We like mondo-warnings!
|
---|
6 | AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
|
---|
7 |
|
---|
8 | # I want this one but I have to wait for the const cleanup!
|
---|
9 | # -Wwrite-strings
|
---|
10 |
|
---|
11 | # Find the glob source files... this might be dangerous, but we're maintainers!
|
---|
12 | globsrc := $(wildcard glob/*.c)
|
---|
13 | globhdr := $(wildcard glob/*.h)
|
---|
14 |
|
---|
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
|
---|
18 |
|
---|
19 | # These are built as a side-effect of the dist rule
|
---|
20 | #all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
|
---|
21 |
|
---|
22 | # General rule for turning a .template into a regular file.
|
---|
23 | #
|
---|
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 $@
|
---|
30 |
|
---|
31 | # Construct Makefiles by adding on dependencies, etc.
|
---|
32 | #
|
---|
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 $@
|
---|
45 |
|
---|
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 $@
|
---|
52 |
|
---|
53 | # Construct build.sh.in
|
---|
54 | #
|
---|
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 $@
|
---|
61 |
|
---|
62 |
|
---|
63 | # Use automake to build a dependency list file, for "foreign" makefiles like
|
---|
64 | # Makefile.DOS.
|
---|
65 | #
|
---|
66 | # Automake used to have a --generate-deps flag, but it's gone now, so we have
|
---|
67 | # to do it ourselves.
|
---|
68 | #
|
---|
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) > $@
|
---|
82 |
|
---|
83 | # Get rid of everything "else".
|
---|
84 | #
|
---|
85 | maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
|
---|
86 |
|
---|
87 | CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
|
---|
88 | build.sh.in .deps .dep_segment ABOUT-NLS \
|
---|
89 | ansi2knr.*
|
---|
90 |
|
---|
91 | # This rule tries to clean the tree right down to how it looks when you do a
|
---|
92 | # virgin CVS checkout.
|
---|
93 |
|
---|
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!!
|
---|
98 |
|
---|
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";'
|
---|
100 |
|
---|
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)
|
---|
108 |
|
---|
109 |
|
---|
110 | # ----------------------------------------------------------------------
|
---|
111 | #
|
---|
112 | # The sections below were stolen from the Makefile.maint used by fileutils,
|
---|
113 | # sh-utils, textutils, CPPI, Bison, and Autoconf.
|
---|
114 |
|
---|
115 |
|
---|
116 | ## ---------------- ##
|
---|
117 | ## Updating files. ##
|
---|
118 | ## ---------------- ##
|
---|
119 |
|
---|
120 | WGET = wget --passive-ftp -nv
|
---|
121 | ftp-gnu = ftp://ftp.gnu.org/gnu
|
---|
122 |
|
---|
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
|
---|
128 |
|
---|
129 | # ------------------- #
|
---|
130 | # Updating PO files. #
|
---|
131 | # ------------------- #
|
---|
132 |
|
---|
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/
|
---|
137 |
|
---|
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
|
---|
149 |
|
---|
150 | po-update:
|
---|
151 | if test -d "po"; then \
|
---|
152 | $(MAKE) do-po-update; \
|
---|
153 | fi
|
---|
154 |
|
---|
155 | # -------------------------- #
|
---|
156 | # Updating GNU build files. #
|
---|
157 | # -------------------------- #
|
---|
158 |
|
---|
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.
|
---|
162 |
|
---|
163 | savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
|
---|
164 | target = $(patsubst get-%,%,$@)
|
---|
165 |
|
---|
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)
|
---|
171 |
|
---|
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)
|
---|
177 |
|
---|
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)
|
---|
183 |
|
---|
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
|
---|
186 |
|
---|
187 |
|
---|
188 | # --------------------- #
|
---|
189 | # Updating everything. #
|
---|
190 | # --------------------- #
|
---|
191 |
|
---|
192 | .PHONY: update
|
---|
193 | update: po-update cvs-update
|
---|
194 |
|
---|
195 |
|
---|
196 | ## --------------- ##
|
---|
197 | ## Sanity checks. ##
|
---|
198 | ## --------------- ##
|
---|
199 |
|
---|
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
|
---|
203 |
|
---|
204 | # copyright-check writable-files
|
---|
205 |
|
---|
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
|
---|
213 |
|
---|
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
|
---|
223 |
|
---|
224 | ## ------------------------- ##
|
---|
225 | ## GNU FTP upload artifacts. ##
|
---|
226 | ## ------------------------- ##
|
---|
227 |
|
---|
228 | # This target creates the upload artifacts.
|
---|
229 | # Sign it with my key. If you don't have my key/passphrase then sorry,
|
---|
230 | # you're SOL! :)
|
---|
231 |
|
---|
232 | GPG = gpg
|
---|
233 | GPGFLAGS = -u 6338B6D4
|
---|
234 |
|
---|
235 | DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
|
---|
236 | DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
|
---|
237 |
|
---|
238 | # A simple rule to test signing, etc.
|
---|
239 | .PHONY: distsign
|
---|
240 | distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
---|
241 |
|
---|
242 | %.sig : %
|
---|
243 | @echo "Signing file '$<':"
|
---|
244 | $(GPG) $(GPGFLAGS) -o "$@" -b "$<"
|
---|
245 |
|
---|
246 | %.directive.asc: %
|
---|
247 | @echo "Creating directive file '$@':"
|
---|
248 | @( \
|
---|
249 | echo 'verstion: 1.1'; \
|
---|
250 | echo 'directory: make'; \
|
---|
251 | echo 'filename: $*'; \
|
---|
252 | echo 'comment: Official upload of GNU make version $(VERSION)'; \
|
---|
253 | ) > "$*.directive"
|
---|
254 | $(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
|
---|
255 | @rm -f "$*.directive"
|
---|
256 |
|
---|
257 | # Upload the artifacts
|
---|
258 |
|
---|
259 | FTPPUT = ncftpput
|
---|
260 | gnu-url = ftp-upload.gnu.org /incoming
|
---|
261 |
|
---|
262 | UPLOADS = upload-alpha upload-ftp
|
---|
263 | .PHONY: $(UPLOADS)
|
---|
264 | $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
---|
265 | $(FTPPUT) "$(gnu-url)/$(@:upload-%=%)" $^
|
---|
266 |
|
---|
267 |
|
---|
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.
|
---|
271 | #
|
---|
272 | # GNU Make is free software; you can redistribute it and/or modify it under the
|
---|
273 | # terms of the GNU General Public License as published by the Free Software
|
---|
274 | # Foundation; either version 2, or (at your option) any later version.
|
---|
275 | #
|
---|
276 | # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
277 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
---|
278 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
---|
279 | #
|
---|
280 | # You should have received a copy of the GNU General Public License along with
|
---|
281 | # GNU Make; see the file COPYING. If not, write to the Free Software
|
---|
282 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|