Release GNU make 3.81.
[make.git] / maintMakefile
blob2bafbc21ac9a80211df6e83d2895a2dd8637b006
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 -W
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
22         rm -f $@
23         sed -e 's@%VERSION%@$(VERSION)@g' \
24             -e 's@%PACKAGE%@$(PACKAGE)@g' \
25           $< > $@
26         chmod a-w $@
28 # Construct Makefiles by adding on dependencies, etc.
30 $(MTEMPLATES) : % : %.template .dep_segment Makefile
31         rm -f $@
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' \
38           $< > $@
39         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
40           cat $(word 2,$^) >>$@
41         chmod a-w $@
43 NMakefile: NMakefile.template .dep_segment Makefile
44         rm -f $@
45         cp $< $@
46         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
47           sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
48         chmod a-w $@
50 # Construct build.sh.in
52 build.sh.in: build.template Makefile
53         rm -f $@
54         sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
55             -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
56           $< > $@
57         chmod a-w+x $@
60 # Use automake to build a dependency list file, for "foreign" makefiles like
61 # Makefile.DOS.
63 # Automake used to have a --generate-deps flag, but it's gone now, so we have
64 # to do it ourselves.
66 DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
67 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
68         rm -f $@
69         (for f in $(DEPDIR)/*.Po; do \
70            echo ""; \
71            echo "# $$f"; \
72            sed  -e '/^[^:]*\.[ch] *:/d' \
73                 -e 's, /usr/[^ ]*,,g' \
74                 -e 's, $(srcdir)/, ,g' \
75                 -e '/^ *\\$$/d' \
76                 -e '/^ *$$/d' \
77                 < $$f; \
78          done) > $@
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 \
86                         ansi2knr.*
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
94 # files.  Stil...
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";'
97 .PHONY: cvs-clean
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; \
121                   else \
122                     mv $(target).t $(target); \
123                   fi
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
136 do-po-update:
137         tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
138           && rm -rf "$$tmppo" \
139           && mkdir "$$tmppo" \
140           && (cd "$$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
144         $(MAKE) po-check
146 po-update:
147         if test -d "po"; then \
148           $(MAKE) do-po-update; \
149         fi
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 \
166           && $(move_if_change)
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 \
172           && $(move_if_change)
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 \
178           && $(move_if_change)
180 .PHONY: cvs-update
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 # --------------------- #
188 .PHONY: update
189 update: po-update cvs-update
192 ## --------------- ##
193 ## Sanity checks.  ##
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
202 changelog-check:
203         if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
204           :; \
205         else \
206           echo "$(VERSION) not in ChangeLog" 1>&2; \
207           exit 1; \
208         fi
210 # Verify that all source files using _() are listed in po/POTFILES.in.
211 # Ignore make.h; it defines _().
212 po-check:
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; \
217           rm -f $@-1 $@-2; \
218         fi
220 ## ------------------------- ##
221 ## GNU FTP upload artifacts. ##
222 ## ------------------------- ##
224 # This target creates the upload artifacts.
225 # Sign it with my key.
227 GPG = gpg
228 GPGFLAGS = -u 6338B6D4
230 DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
231 DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
233 .PHONY: distsign
234 distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
236 $(DIST_ARCHIVES_DIRECTIVE): .directive.asc
237         cp $< $@
239 %.sig : %
240         @echo "Signing file '$<':"
241         $(GPG) $(GPGFLAGS) -o $@ -b $<
243 .directive.asc:
244         @echo "Creating directive file '$@':"
245         @echo 'directory: make' > .directive
246         $(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
247         @rm -f .directive
249 # Upload the artifacts
251 FTPPUT = ncftpput
252 gnu-url = ftp-upload.gnu.org /incoming
254 UPLOADS = upload-alpha upload-ftp
255 .PHONY: $(UPLOADS)
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.