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 all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
18 # General rule for turning a .template into a regular file.
20 $(TEMPLATES) : % : %.template Makefile
22 sed -e 's@%VERSION%@$(VERSION)@g' \
23 -e 's@%PACKAGE%@$(PACKAGE)@g' \
27 # Construct Makefiles by adding on dependencies, etc.
29 $(MTEMPLATES) : % : %.template .dep_segment Makefile
31 sed -e 's@%VERSION%@$(VERSION)@g' \
32 -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
33 -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
34 -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
35 -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
36 -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
38 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
42 NMakefile: NMakefile.template .dep_segment Makefile
45 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
46 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
49 # Construct build.sh.in
51 build.sh.in: build.template Makefile
53 sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
54 -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
59 # Use automake to build a dependency list file, for "foreign" makefiles like
62 # Automake used to have a --generate-deps flag, but it's gone now, so we have
65 DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
66 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
67 (for f in $(DEPDIR)/*.Po; do \
71 | sed -e '/^[^:]*\.[ch] *:/d' \
72 -e 's, /usr/[^ ]*,,g' \
73 -e 's, $(srcdir)/, ,g' \
78 # Get rid of everything "else".
80 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
82 CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
83 build.sh.in .deps .dep_segment ABOUT-NLS \
86 # This rule tries to clean the tree right down to how it looks when you do a
87 # virgin CVS checkout.
89 # This is potentially dangerous since it removes _ANY FILE_ that is not in
90 # CVS. Including files you might mean to add to CVS but haven't yet...
91 # I only use this in subdirectories where it's unlikely we have any new
93 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";'
96 cvs-clean: maintainer-clean
97 -rm -rf *~ $(CVS-CLEAN-FILES)
98 -cd config && $(cvsclean)
100 -cd doc && $(cvsclean)
101 -cd glob && $(cvsclean)
104 # ----------------------------------------------------------------------
106 # The sections below were stolen from the Makefile.maint used by fileutils,
107 # sh-utils, textutils, CPPI, Bison, and Autoconf.
110 ## ---------------- ##
111 ## Updating files. ##
112 ## ---------------- ##
114 WGET = wget --passive-ftp -nv
115 ftp-gnu = ftp://ftp.gnu.org/gnu
117 move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
118 echo $(target) is unchanged; rm -f $(target).t; \
120 mv $(target).t $(target); \
123 # ------------------- #
124 # Updating PO files. #
125 # ------------------- #
127 # PO archive mirrors --- Be careful; some might not be fully populated!
128 # ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
129 # http://translation.sf.net/maint/
130 # ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
132 po_repo = http://www.iro.umontreal.ca/translation/maint/$(PACKAGE)
133 .PHONY: do-po-update po-update
135 tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
138 (cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
140 cd po && $(MAKE) update-po
144 if test -d "po"; then \
145 $(MAKE) do-po-update; \
148 # -------------------------- #
149 # Updating GNU build files. #
150 # -------------------------- #
152 # The following pseudo table associates a local directory and a URL
153 # with each of the files that belongs to some other package and is
154 # regularly updated from the specified URL.
156 savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
157 target = $(patsubst get-%,%,$@)
159 config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
160 get-config/config.guess get-config/config.sub:
161 @echo $(WGET) $(config-url) -O $(target) \
162 && $(WGET) $(config-url) -O $(target).t \
165 gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
166 get-config/texinfo.tex:
167 @echo $(WGET) $(gnulib-url) -O $(target) \
168 && $(WGET) $(gnulib-url) -O $(target).t \
171 gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
172 get-doc/make-stds.texi get-doc/fdl.texi:
173 @echo $(WGET) $(gnustandards-url) -O $(target) \
174 && $(WGET) $(gnustandards-url) -O $(target).t \
178 cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
181 # --------------------- #
182 # Updating everything. #
183 # --------------------- #
186 update: po-update cvs-update
189 ## --------------- ##
191 ## --------------- ##
193 # Checks that don't require cvs. Run `changelog-check' last as
194 # previous test may reveal problems requiring new ChangeLog entries.
195 local-check: po-check changelog-check
197 # copyright-check writable-files
200 if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
203 echo "$(VERSION) not in ChangeLog" 1>&2; \
207 # Verify that all source files using _() are listed in po/POTFILES.in.
208 # Ignore make.h; it defines _().
210 if test -f po/POTFILES.in; then \
211 grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
212 grep -E -l '\b_\(' *.c *.h | grep -v make.h | sort > $@-2; \
213 diff -u $@-1 $@-2 || exit 1; \
217 ## ------------------------- ##
218 ## GNU FTP upload artifacts. ##
219 ## ------------------------- ##
221 # This target creates the upload artifacts.
222 # Sign it with my key.
225 GPGFLAGS = -u 6338B6D4
227 DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
228 DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
231 distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
233 $(DIST_ARCHIVES_DIRECTIVE): .directive.asc
237 @echo "Signing file '$<':"
238 $(GPG) $(GPGFLAGS) -o $@ -b $<
241 @echo "Creating directive file '$@':"
242 @echo 'directory: make' > .directive
243 $(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
246 # Upload the artifacts
249 gnu-url = ftp-upload.gnu.org /incoming
251 UPLOADS = upload-alpha upload-ftp
253 $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
254 $(FTPPUT) $(gnu-url)/$(@:upload-%=%) $^