Major updates in preparation for 3.80.
[make.git] / maintMakefile
bloba499972b8d93ec0ebfeff82b086751e0824ac86a
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
23         rm -f $@
24         sed -e 's@%VERSION%@$(VERSION)@g' \
25             -e 's@%PACKAGE%@$(PACKAGE)@g' \
26           $< > $@
27         chmod a-w $@
29 # Construct Makefiles by adding on dependencies, etc.
31 $(MTEMPLATES) : % : %.template .dep_segment Makefile
32         rm -f $@
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' \
39           $< > $@
40         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
41           cat $(word 2,$^) >>$@
42         chmod a-w $@
44 NMakefile: NMakefile.template .dep_segment Makefile
45         rm -f $@
46         cp $< $@
47         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
48           sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
49         chmod a-w $@
51 # Construct build.sh.in
53 build.sh.in: build.template Makefile
54         rm -f $@
55         sed -e 's@%objs%@$(filter-out remote-%,$(make_OBJECTS)@g' \
56             -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
57           $< > $@
58         chmod a-w+x $@
61 # Use automake to build a dependency list file, for "foreign" makefiles like
62 # Makefile.DOS.
64 # Automake used to have a --generate-deps flag, but it's gone now, so we have
65 # to do it ourselves.
67 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
68         cat $(DEP_FILES) \
69           | sed -e '/^[^:]*\.[ch] *:/d' \
70                 -e 's, /usr/[^ ]*,,g' \
71                 -e 's, $(srcdir)/, ,g' \
72                 -e '/^ \\$$/d' \
73           > $@
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.
84 ALPHA   := ~ftp/gnu
85 TARFILE := $(distdir).tar.gz
87 .PHONY: alpha
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; \
108                   else \
109                     mv $(target).t $(target); \
110                   fi
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
118 do-po-update:
119         tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
120         rm -rf $$tmppo && \
121         mkdir $$tmppo && \
122         (cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
123         cp $$tmppo/*.po po
124         cd po && $(MAKE) update-po
125         $(MAKE) po-check
127 po-update:
128         if test -d "po"; then \
129           $(MAKE) do-po-update; \
130         fi
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)
163 $(wget-targets):
164         @echo $(WGET) $(url) -O $(target) \
165           && $(WGET) $(url) -O $(target).t \
166           && $(move_if_change)
168 .PHONY: wget-update
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)
178 $(cvs-targets):
179         $(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
180           >$(target).t \
181             && $(move_if_change)
183 .PHONY: cvs-update
184 cvs-update: $(cvs-targets)
187 # --------------------- #
188 # Updating everything.  #
189 # --------------------- #
191 .PHONY: update
192 update: wget-update cvs-update po-update