More copyright/license updates.
[make.git] / maintMakefile
blob26a6f4db4aefee6fc87b587e23b4601088164896
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/$(PACKAGE)-$(VERSION)-po &&\
138         rm -rf $$tmppo && \
139         mkdir $$tmppo && \
140         (cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
141         cp $$tmppo/*.po po
142         cd po && $(MAKE) update-po
143         $(MAKE) po-check
145 po-update:
146         if test -d "po"; then \
147           $(MAKE) do-po-update; \
148         fi
150 # -------------------------- #
151 # Updating GNU build files.  #
152 # -------------------------- #
154 # The following pseudo table associates a local directory and a URL
155 # with each of the files that belongs to some other package and is
156 # regularly updated from the specified URL.
158 savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
159 target = $(patsubst get-%,%,$@)
161 config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
162 get-config/config.guess get-config/config.sub:
163         @echo $(WGET) $(config-url) -O $(target) \
164           && $(WGET) $(config-url) -O $(target).t \
165           && $(move_if_change)
167 gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
168 get-config/texinfo.tex:
169         @echo $(WGET) $(gnulib-url) -O $(target) \
170           && $(WGET) $(gnulib-url) -O $(target).t \
171           && $(move_if_change)
173 gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
174 get-doc/make-stds.texi get-doc/fdl.texi:
175         @echo $(WGET) $(gnustandards-url) -O $(target) \
176           && $(WGET) $(gnustandards-url) -O $(target).t \
177           && $(move_if_change)
179 .PHONY: cvs-update
180 cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
183 # --------------------- #
184 # Updating everything.  #
185 # --------------------- #
187 .PHONY: update
188 update: po-update cvs-update
191 ## --------------- ##
192 ## Sanity checks.  ##
193 ## --------------- ##
195 # Checks that don't require cvs.  Run `changelog-check' last as
196 # previous test may reveal problems requiring new ChangeLog entries.
197 local-check: po-check changelog-check
199 # copyright-check writable-files
201 changelog-check:
202         if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
203           :; \
204         else \
205           echo "$(VERSION) not in ChangeLog" 1>&2; \
206           exit 1; \
207         fi
209 # Verify that all source files using _() are listed in po/POTFILES.in.
210 # Ignore make.h; it defines _().
211 po-check:
212         if test -f po/POTFILES.in; then \
213           grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
214           grep -E -l '\b_\(' *.c *.h | grep -v make.h | sort > $@-2; \
215           diff -u $@-1 $@-2 || exit 1; \
216           rm -f $@-1 $@-2; \
217         fi
219 ## ------------------------- ##
220 ## GNU FTP upload artifacts. ##
221 ## ------------------------- ##
223 # This target creates the upload artifacts.
224 # Sign it with my key.
226 GPG = gpg
227 GPGFLAGS = -u 6338B6D4
229 DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
230 DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
232 .PHONY: distsign
233 distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
235 $(DIST_ARCHIVES_DIRECTIVE): .directive.asc
236         cp $< $@
238 %.sig : %
239         @echo "Signing file '$<':"
240         $(GPG) $(GPGFLAGS) -o $@ -b $<
242 .directive.asc:
243         @echo "Creating directive file '$@':"
244         @echo 'directory: make' > .directive
245         $(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
246         @rm -f .directive
248 # Upload the artifacts
250 FTPPUT = ncftpput
251 gnu-url = ftp-upload.gnu.org /incoming
253 UPLOADS = upload-alpha upload-ftp
254 .PHONY: $(UPLOADS)
255 $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
256         $(FTPPUT) $(gnu-url)/$(@:upload-%=%) $^
259 # Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
260 # 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
261 # This file is part of GNU Make.
263 # GNU Make is free software; you can redistribute it and/or modify it under the
264 # terms of the GNU General Public License as published by the Free Software
265 # Foundation; either version 2, or (at your option) any later version.
267 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
268 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
269 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
271 # You should have received a copy of the GNU General Public License along with
272 # GNU Make; see the file COPYING.  If not, write to the Free Software
273 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.