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.
6 # Find the glob source files... this might be dangerous, but we're maintainers!
8 globsrc := $(wildcard glob/*.c)
9 globhdr := $(wildcard glob/*.h)
11 TEMPLATES = README README.DOS README.W32 \
12 config.ami configh.dos config.h.W32 config.h-vms
13 MTEMPLATES = Makefile.DOS SMakefile
15 # We need this to ensure that README and build.sh.in are created on time to
16 # avoid errors by automake.
18 #Makefile.in: README build.sh.in
20 # General rule for turning a .template into a regular file.
22 $(TEMPLATES) : % : %.template Makefile
24 sed -e 's@%VERSION%@$(VERSION)@g' \
25 -e 's@%PACKAGE%@$(PACKAGE)@g' \
29 # Construct Makefiles by adding on dependencies, etc.
31 $(MTEMPLATES) : % : %.template .dep_segment Makefile
33 sed -e 's@%VERSION%@$(VERSION)@g' \
34 -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
35 -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
36 -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
37 -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
38 -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
40 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
44 NMakefile: NMakefile.template .dep_segment Makefile
47 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
48 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
51 # Construct build.sh.in
53 build.sh.in: build.template Makefile
55 sed -e 's@%objs%@$(filter-out remote-%,$(make_OBJECTS)@g' \
56 -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
61 # Use automake to build a dependency list file, for "foreign" makefiles like
64 # Automake used to have a --generate-deps flag, but it's gone now, so we have
67 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
69 | sed -e '/^[^:]*\.[ch] *:/d' \
70 -e 's, /usr/[^ ]*,,g' \
71 -e 's, $(srcdir)/, ,g' \
75 # Get rid of everything "else".
77 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
79 MAINTAINERCLEANFILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
80 missing build.sh.in .dep_segment
82 # Put the alpha distribution files up for anonymous FTP.
85 TARFILE := $(distdir).tar.gz
88 alpha: $(ALPHA) $(TARFILE)
89 @rm -f $(ALPHA)/$(TARFILE)
90 cp -p $(TARFILE) $(ALPHA)
93 # ----------------------------------------------------------------------
95 # The sections below were stolen from the Makefile.maint used by fileutils,
96 # sh-utils, textutils, CPPI, Bison, and Autoconf.
99 ## ---------------- ##
100 ## Updating files. ##
101 ## ---------------- ##
103 WGET = wget --passive-ftp --non-verbose
104 ftp-gnu = ftp://ftp.gnu.org/gnu
106 move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
107 echo $(target) is unchanged; rm -f $(target).t; \
109 mv $(target).t $(target); \
112 # ------------------- #
113 # Updating PO files. #
114 # ------------------- #
116 po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
117 .PHONY: do-po-update po-update
119 tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
122 (cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
124 cd po && $(MAKE) update-po
128 if test -d "po"; then \
129 $(MAKE) do-po-update; \
132 # -------------------------- #
133 # Updating GNU build tools. #
134 # -------------------------- #
136 # The following pseudo table associates a local directory and a URL
137 # with each of the files that belongs to some other package and is
138 # regularly updated from the specified URL.
139 # $(srcdir)/src/ansi2knr.c
142 wget_files ?= $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
143 $(srcdir)/doc/texinfo.tex $(srcdir)/doc/make-stds.texi \
144 $(srcdir)/doc/fdl.texi
146 wget-targets = $(patsubst %, get-%, $(wget_files))
148 config.guess-url_prefix = $(ftp-gnu)/config/
149 config.sub-url_prefix = $(ftp-gnu)/config/
151 ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
153 texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
155 standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/
156 make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/
157 fdl.texi-url_prefix = $(ftp-gnu)/GNUinfo/
159 target = $(patsubst get-%,%,$@)
160 url = $($(notdir $(target))-url_prefix)$(notdir $(target))
162 .PHONY: $(wget-targets)
164 @echo $(WGET) $(url) -O $(target) \
165 && $(WGET) $(url) -O $(target).t \
169 wget-update: $(wget-targets)
172 # Updating tools via CVS.
173 cvs_files ?= depcomp missing
174 cvs-targets = $(patsubst %, get-%, $(cvs_files))
176 automake_repo = :pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
177 .PHONY: $(cvs-targets)
179 $(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
184 cvs-update: $(cvs-targets)
187 # --------------------- #
188 # Updating everything. #
189 # --------------------- #
192 update: wget-update cvs-update po-update