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!
8 # Find the glob source files... this might be dangerous, but we're maintainers!
9 globsrc := $(wildcard glob/*.c)
10 globhdr := $(wildcard glob/*.h)
12 TEMPLATES = README README.DOS README.W32 README.OS2 \
13 config.ami configh.dos config.h.W32 config.h-vms
14 MTEMPLATES = Makefile.DOS SMakefile
16 # These are built as a side-effect of the dist rule
17 #all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
19 # General rule for turning a .template into a regular file.
21 $(TEMPLATES) : % : %.template Makefile
23 sed -e 's@%VERSION%@$(VERSION)@g' \
24 -e 's@%PACKAGE%@$(PACKAGE)@g' \
28 # Construct Makefiles by adding on dependencies, etc.
30 $(MTEMPLATES) : % : %.template .dep_segment Makefile
32 sed -e 's@%VERSION%@$(VERSION)@g' \
33 -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
34 -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
35 -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
36 -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
37 -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
39 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
43 NMakefile: NMakefile.template .dep_segment Makefile
46 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
47 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
50 # Construct build.sh.in
52 build.sh.in: build.template Makefile
54 sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
55 -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
60 # Use automake to build a dependency list file, for "foreign" makefiles like
63 # Automake used to have a --generate-deps flag, but it's gone now, so we have
66 DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
67 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
69 (for f in $(DEPDIR)/*.Po; do \
72 sed -e '/^[^:]*\.[ch] *:/d' \
73 -e 's, /usr/[^ ]*,,g' \
74 -e 's, $(srcdir)/, ,g' \
80 # Get rid of everything "else".
82 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
84 CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
85 build.sh.in .deps .dep_segment ABOUT-NLS \
88 # This rule tries to clean the tree right down to how it looks when you do a
89 # virgin CVS checkout.
91 # This is potentially dangerous since it removes _ANY FILE_ that is not in
92 # CVS. Including files you might mean to add to CVS but haven't yet...
93 # I only use this in subdirectories where it's unlikely we have any new
95 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";'
98 cvs-clean: maintainer-clean
99 -rm -rf *~ $(CVS-CLEAN-FILES)
100 -cd config && $(cvsclean)
101 -cd po && $(cvsclean)
102 -cd doc && $(cvsclean)
103 -cd glob && $(cvsclean)
106 # ----------------------------------------------------------------------
108 # The sections below were stolen from the Makefile.maint used by fileutils,
109 # sh-utils, textutils, CPPI, Bison, and Autoconf.
112 ## ---------------- ##
113 ## Updating files. ##
114 ## ---------------- ##
116 WGET = wget --passive-ftp -nv
117 ftp-gnu = ftp://ftp.gnu.org/gnu
119 move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
120 echo $(target) is unchanged; rm -f $(target).t; \
122 mv $(target).t $(target); \
125 # ------------------- #
126 # Updating PO files. #
127 # ------------------- #
129 # PO archive mirrors --- Be careful; some might not be fully populated!
130 # ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
131 # http://translation.sf.net/maint/
132 # ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
134 po_repo = http://www.iro.umontreal.ca/translation/maint/$(PACKAGE)
135 .PHONY: do-po-update po-update
137 tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
138 && rm -rf "$$tmppo" \
141 && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) \
142 && cp "$$tmppo"/*.po po && rm -rf "$$tmppo"
143 cd po && $(MAKE) update-po
147 if test -d "po"; then \
148 $(MAKE) do-po-update; \
151 # -------------------------- #
152 # Updating GNU build files. #
153 # -------------------------- #
155 # The following pseudo table associates a local directory and a URL
156 # with each of the files that belongs to some other package and is
157 # regularly updated from the specified URL.
159 savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
160 target = $(patsubst get-%,%,$@)
162 config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
163 get-config/config.guess get-config/config.sub:
164 @echo $(WGET) $(config-url) -O $(target) \
165 && $(WGET) $(config-url) -O $(target).t \
168 gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
169 get-config/texinfo.tex:
170 @echo $(WGET) $(gnulib-url) -O $(target) \
171 && $(WGET) $(gnulib-url) -O $(target).t \
174 gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
175 get-doc/make-stds.texi get-doc/fdl.texi:
176 @echo $(WGET) $(gnustandards-url) -O $(target) \
177 && $(WGET) $(gnustandards-url) -O $(target).t \
181 cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
184 # --------------------- #
185 # Updating everything. #
186 # --------------------- #
189 update: po-update cvs-update
192 ## --------------- ##
194 ## --------------- ##
196 # Checks that don't require cvs. Run `changelog-check' last as
197 # previous test may reveal problems requiring new ChangeLog entries.
198 local-check: po-check changelog-check
200 # copyright-check writable-files
203 if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
206 echo "$(VERSION) not in ChangeLog" 1>&2; \
210 # Verify that all source files using _() are listed in po/POTFILES.in.
211 # Ignore make.h; it defines _().
213 if test -f po/POTFILES.in; then \
214 grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
215 grep -E -l '\b_\(' *.c *.h | grep -v make.h | sort > $@-2; \
216 diff -u $@-1 $@-2 || exit 1; \
220 ## ------------------------- ##
221 ## GNU FTP upload artifacts. ##
222 ## ------------------------- ##
224 # This target creates the upload artifacts.
225 # Sign it with my key.
228 GPGFLAGS = -u 6338B6D4
230 DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
231 DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
234 distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
236 $(DIST_ARCHIVES_DIRECTIVE): .directive.asc
240 @echo "Signing file '$<':"
241 $(GPG) $(GPGFLAGS) -o $@ -b $<
244 @echo "Creating directive file '$@':"
245 @echo 'directory: make' > .directive
246 $(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
249 # Upload the artifacts
252 gnu-url = ftp-upload.gnu.org /incoming
254 UPLOADS = upload-alpha upload-ftp
256 $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
257 $(FTPPUT) $(gnu-url)/$(@:upload-%=%) $^
260 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
261 # Free Software Foundation, Inc.
262 # This file is part of GNU Make.
264 # GNU Make is free software; you can redistribute it and/or modify it under the
265 # terms of the GNU General Public License as published by the Free Software
266 # Foundation; either version 2, or (at your option) any later version.
268 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
269 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
270 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
272 # You should have received a copy of the GNU General Public License along with
273 # GNU Make; see the file COPYING. If not, write to the Free Software
274 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.