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 # We need this to ensure that README and build.sh.in are created on time to
19 # avoid errors by automake.
21 #Makefile.in: README build.sh.in
23 # General rule for turning a .template into a regular file.
25 $(TEMPLATES) : % : %.template Makefile
27 sed -e 's@%VERSION%@$(VERSION)@g' \
28 -e 's@%PACKAGE%@$(PACKAGE)@g' \
32 # Construct Makefiles by adding on dependencies, etc.
34 $(MTEMPLATES) : % : %.template .dep_segment Makefile
36 sed -e 's@%VERSION%@$(VERSION)@g' \
37 -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
38 -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
39 -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
40 -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
41 -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
43 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
47 NMakefile: NMakefile.template .dep_segment Makefile
50 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
51 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
54 # Construct build.sh.in
56 build.sh.in: build.template Makefile
58 sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
59 -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc)))@g' \
64 # Use automake to build a dependency list file, for "foreign" makefiles like
67 # Automake used to have a --generate-deps flag, but it's gone now, so we have
70 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
72 | sed -e '/^[^:]*\.[ch] *:/d' \
73 -e 's, /usr/[^ ]*,,g' \
74 -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 missing build.sh.in .dep_segment po-check-?
85 # This rule tries to clean the tree right down to how it looks when you do a
86 # virgin CVS checkout.
89 cvs-clean: maintainer-clean
91 -rm -f config/*~ config/Makefile.in config/[a-z]*
92 -rm -f po/*~ po/Makefile.in.in po/Rules-quot po/[a-z]*
93 -rm -f doc/*~ doc/Makefile.in doc/fdl.texi doc/make-stds.texi \
95 -rm -f glob/*~ glob/Makefile.in
96 -rm -f ABOUT-NLS $(CVS-CLEAN-FILES)
99 # ----------------------------------------------------------------------
101 # The sections below were stolen from the Makefile.maint used by fileutils,
102 # sh-utils, textutils, CPPI, Bison, and Autoconf.
105 ## ---------------- ##
106 ## Updating files. ##
107 ## ---------------- ##
109 WGET = wget --passive-ftp --non-verbose
110 ftp-gnu = ftp://ftp.gnu.org/gnu
112 move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
113 echo $(target) is unchanged; rm -f $(target).t; \
115 mv $(target).t $(target); \
118 # ------------------- #
119 # Updating PO files. #
120 # ------------------- #
122 po_repo = http://www2.iro.umontreal.ca/%7Egnutra/po/maint/$(PACKAGE)
123 .PHONY: do-po-update po-update
125 tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
128 (cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
130 cd po && $(MAKE) update-po
134 if test -d "po"; then \
135 $(MAKE) do-po-update; \
138 # -------------------------- #
139 # Updating GNU build tools. #
140 # -------------------------- #
142 # The following pseudo table associates a local directory and a URL
143 # with each of the files that belongs to some other package and is
144 # regularly updated from the specified URL.
145 # $(srcdir)/src/ansi2knr.c
148 wget_files ?= $(srcdir)/doc/texinfo.tex $(srcdir)/doc/make-stds.texi \
149 $(srcdir)/doc/fdl.texi
151 wget-targets = $(patsubst %, get-%, $(wget_files))
153 ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
155 texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
157 standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/
158 make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/
159 fdl.texi-url_prefix = $(ftp-gnu)/GNUinfo/
161 target = $(patsubst get-%,%,$@)
162 url = $($(notdir $(target))-url_prefix)$(notdir $(target))
164 .PHONY: $(wget-targets)
166 @echo $(WGET) $(url) -O $(target) \
167 && $(WGET) $(url) -O $(target).t \
170 config-prefix = http://savannah.gnu.org/cgi-bin/viewcvs/config
171 config-url = $(config-prefix)/$(patsubst get-%,%,$@)?rev=HEAD
172 get-config/config.guess get-config/config.sub:
173 @echo $(WGET) $(config-url) -O $(target) \
174 && $(WGET) $(config-url) -O $(target).t \
179 wget-update: $(wget-targets)
182 # Updating tools via CVS.
183 cvs_files ?= depcomp missing
184 # config/config.guess config/config.sub
185 cvs-targets = $(patsubst %, get-%, $(cvs_files))
187 automake_repo = :pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
188 .PHONY: $(cvs-targets)
190 $(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
195 cvs-update: $(cvs-targets) get-config/config.guess get-config/config.sub
198 # --------------------- #
199 # Updating everything. #
200 # --------------------- #
203 update: wget-update po-update
208 ## --------------- ##
210 ## --------------- ##
212 # Checks that don't require cvs. Run `changelog-check' last as
213 # previous test may reveal problems requiring new ChangeLog entries.
214 local-check: po-check changelog-check
216 # copyright-check writable-files
219 if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
222 echo "$(VERSION) not in ChangeLog" 1>&2; \
226 # Verify that all source files using _() are listed in po/POTFILES.in.
227 # Ignore make.h; it defines _().
229 if test -f po/POTFILES.in; then \
230 grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
231 grep -E -l '\b_\(' *.c *.h | grep -v make.h | sort > $@-2; \
232 diff -u $@-1 $@-2 || exit 1; \