1997-08-18 18:11:04 +00:00
|
|
|
# Maintainer-only makefile segment. This contains things that are relevant
|
1999-03-30 06:19:17 +00:00
|
|
|
# only if you have the full copy of the GNU make sources from the CVS
|
|
|
|
# tree, not a dist copy.
|
1997-08-18 18:11:04 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Find the glob source files... this might be dangerous, but we're maintainers!
|
|
|
|
#
|
|
|
|
globsrc := $(wildcard glob/*.c)
|
1997-08-27 20:30:54 +00:00
|
|
|
globhdr := $(wildcard glob/*.h)
|
|
|
|
|
1999-08-31 17:02:31 +00:00
|
|
|
TEMPLATES = README README.DOS README.W32 \
|
|
|
|
config.ami configh.dos config.h.W32 config.h-vms
|
1998-07-30 20:54:47 +00:00
|
|
|
MTEMPLATES = Makefile.DOS SMakefile
|
1997-08-18 18:11:04 +00:00
|
|
|
|
1999-07-24 04:55:08 +00:00
|
|
|
# We need this to ensure that README and build.sh.in are created on time to
|
|
|
|
# avoid errors by automake.
|
1999-03-30 06:19:17 +00:00
|
|
|
#
|
1999-07-24 04:55:08 +00:00
|
|
|
#Makefile.in: README build.sh.in
|
1999-03-30 06:19:17 +00:00
|
|
|
|
1997-08-18 18:11:04 +00:00
|
|
|
# General rule for turning a .template into a regular file.
|
|
|
|
#
|
1999-08-22 17:50:57 +00:00
|
|
|
$(TEMPLATES) : % : %.template Makefile
|
1997-08-27 20:30:54 +00:00
|
|
|
rm -f $@
|
1999-08-12 23:16:42 +00:00
|
|
|
sed -e 's@%VERSION%@$(VERSION)@g' \
|
|
|
|
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
1997-08-27 20:30:54 +00:00
|
|
|
$< > $@
|
|
|
|
chmod a-w $@
|
|
|
|
|
1998-07-30 20:54:47 +00:00
|
|
|
# Construct Makefiles by adding on dependencies, etc.
|
1997-08-27 20:30:54 +00:00
|
|
|
#
|
1999-08-22 17:50:57 +00:00
|
|
|
$(MTEMPLATES) : % : %.template .dep_segment Makefile
|
1997-08-18 18:11:04 +00:00
|
|
|
rm -f $@
|
1999-08-12 23:16:42 +00:00
|
|
|
sed -e 's@%VERSION%@$(VERSION)@g' \
|
|
|
|
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
|
|
|
|
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
|
|
|
|
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
|
|
|
|
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
|
|
|
|
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
|
1997-08-27 20:30:54 +00:00
|
|
|
$< > $@
|
1998-07-30 20:54:47 +00:00
|
|
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
|
|
|
cat $(word 2,$^) >>$@
|
|
|
|
chmod a-w $@
|
|
|
|
|
1999-08-22 17:50:57 +00:00
|
|
|
NMakefile: NMakefile.template .dep_segment Makefile
|
1998-07-30 20:54:47 +00:00
|
|
|
rm -f $@
|
|
|
|
cp $< $@
|
|
|
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
|
|
|
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
|
1997-08-18 18:11:04 +00:00
|
|
|
chmod a-w $@
|
|
|
|
|
|
|
|
# Construct build.sh.in
|
|
|
|
#
|
1999-08-22 17:50:57 +00:00
|
|
|
build.sh.in: build.template Makefile
|
1997-08-18 18:11:04 +00:00
|
|
|
rm -f $@
|
1999-09-16 05:58:44 +00:00
|
|
|
sed -e 's@%objs%@$(filter-out remote-%,$(make_OBJECTS)@g' \
|
1999-08-12 23:16:42 +00:00
|
|
|
-e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
|
1999-03-26 07:08:57 +00:00
|
|
|
$< > $@
|
1997-08-18 18:11:04 +00:00
|
|
|
chmod a-w+x $@
|
|
|
|
|
2002-04-22 04:35:19 +00:00
|
|
|
|
1998-07-30 20:54:47 +00:00
|
|
|
# Use automake to build a dependency list file, for "foreign" makefiles like
|
|
|
|
# Makefile.DOS.
|
|
|
|
#
|
2002-04-22 04:35:19 +00:00
|
|
|
# Automake used to have a --generate-deps flag, but it's gone now, so we have
|
|
|
|
# to do it ourselves.
|
|
|
|
#
|
1998-07-30 20:54:47 +00:00
|
|
|
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
|
2002-04-22 04:35:19 +00:00
|
|
|
cat $(DEP_FILES) \
|
|
|
|
| sed -e '/^[^:]*\.[ch] *:/d' \
|
|
|
|
-e 's, /usr/[^ ]*,,g' \
|
|
|
|
-e 's, $(srcdir)/, ,g' \
|
|
|
|
-e '/^ \\$$/d' \
|
|
|
|
> $@
|
1998-07-30 20:54:47 +00:00
|
|
|
|
2002-04-21 23:57:24 +00:00
|
|
|
# Get rid of everything "else".
|
1997-09-19 19:47:55 +00:00
|
|
|
#
|
1999-03-30 06:19:17 +00:00
|
|
|
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
|
1997-09-19 19:47:55 +00:00
|
|
|
|
2002-04-21 23:57:24 +00:00
|
|
|
MAINTAINERCLEANFILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
|
1998-07-30 20:54:47 +00:00
|
|
|
missing build.sh.in .dep_segment
|
1997-09-16 14:17:23 +00:00
|
|
|
|
1997-08-18 18:11:04 +00:00
|
|
|
# Put the alpha distribution files up for anonymous FTP.
|
|
|
|
#
|
|
|
|
ALPHA := ~ftp/gnu
|
|
|
|
TARFILE := $(distdir).tar.gz
|
|
|
|
|
|
|
|
.PHONY: alpha
|
|
|
|
alpha: $(ALPHA) $(TARFILE)
|
|
|
|
@rm -f $(ALPHA)/$(TARFILE)
|
|
|
|
cp -p $(TARFILE) $(ALPHA)
|
2002-07-08 02:26:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# The sections below were stolen from the Makefile.maint used by fileutils,
|
|
|
|
# sh-utils, textutils, CPPI, Bison, and Autoconf.
|
|
|
|
|
|
|
|
|
|
|
|
## ---------------- ##
|
|
|
|
## Updating files. ##
|
|
|
|
## ---------------- ##
|
|
|
|
|
|
|
|
WGET = wget --passive-ftp --non-verbose
|
|
|
|
ftp-gnu = ftp://ftp.gnu.org/gnu
|
|
|
|
|
|
|
|
move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
|
|
|
|
echo $(target) is unchanged; rm -f $(target).t; \
|
|
|
|
else \
|
|
|
|
mv $(target).t $(target); \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ------------------- #
|
|
|
|
# Updating PO files. #
|
|
|
|
# ------------------- #
|
|
|
|
|
|
|
|
po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
|
|
|
|
.PHONY: do-po-update po-update
|
|
|
|
do-po-update:
|
|
|
|
tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
|
|
|
|
rm -rf $$tmppo && \
|
|
|
|
mkdir $$tmppo && \
|
|
|
|
(cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
|
|
|
|
cp $$tmppo/*.po po
|
|
|
|
cd po && $(MAKE) update-po
|
|
|
|
$(MAKE) po-check
|
|
|
|
|
|
|
|
po-update:
|
|
|
|
if test -d "po"; then \
|
|
|
|
$(MAKE) do-po-update; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# -------------------------- #
|
|
|
|
# Updating GNU build tools. #
|
|
|
|
# -------------------------- #
|
|
|
|
|
|
|
|
# The following pseudo table associates a local directory and a URL
|
|
|
|
# with each of the files that belongs to some other package and is
|
|
|
|
# regularly updated from the specified URL.
|
|
|
|
# $(srcdir)/src/ansi2knr.c
|
|
|
|
|
|
|
|
|
|
|
|
wget_files ?= $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
|
|
|
|
$(srcdir)/doc/texinfo.tex $(srcdir)/doc/make-stds.texi \
|
|
|
|
$(srcdir)/doc/fdl.texi
|
|
|
|
|
|
|
|
wget-targets = $(patsubst %, get-%, $(wget_files))
|
|
|
|
|
|
|
|
config.guess-url_prefix = $(ftp-gnu)/config/
|
|
|
|
config.sub-url_prefix = $(ftp-gnu)/config/
|
|
|
|
|
|
|
|
ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
|
|
|
|
|
|
|
|
texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
|
|
|
|
|
|
|
|
standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/
|
|
|
|
make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/
|
|
|
|
fdl.texi-url_prefix = $(ftp-gnu)/GNUinfo/
|
|
|
|
|
|
|
|
target = $(patsubst get-%,%,$@)
|
|
|
|
url = $($(notdir $(target))-url_prefix)$(notdir $(target))
|
|
|
|
|
|
|
|
.PHONY: $(wget-targets)
|
|
|
|
$(wget-targets):
|
|
|
|
@echo $(WGET) $(url) -O $(target) \
|
|
|
|
&& $(WGET) $(url) -O $(target).t \
|
|
|
|
&& $(move_if_change)
|
|
|
|
|
|
|
|
.PHONY: wget-update
|
|
|
|
wget-update: $(wget-targets)
|
|
|
|
|
|
|
|
|
|
|
|
# Updating tools via CVS.
|
|
|
|
cvs_files ?= depcomp missing
|
|
|
|
cvs-targets = $(patsubst %, get-%, $(cvs_files))
|
|
|
|
|
|
|
|
automake_repo = :pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
|
|
|
|
.PHONY: $(cvs-targets)
|
|
|
|
$(cvs-targets):
|
|
|
|
$(CVS) -d $(automake_repo) co -p automake/lib/$(notdir $(target)) \
|
|
|
|
>$(target).t \
|
|
|
|
&& $(move_if_change)
|
|
|
|
|
|
|
|
.PHONY: cvs-update
|
|
|
|
cvs-update: $(cvs-targets)
|
|
|
|
|
|
|
|
|
|
|
|
# --------------------- #
|
|
|
|
# Updating everything. #
|
|
|
|
# --------------------- #
|
|
|
|
|
|
|
|
.PHONY: update
|
2002-07-08 13:05:02 +00:00
|
|
|
update: wget-update po-update
|
|
|
|
|
|
|
|
# cvs-update
|
|
|
|
|
|
|
|
|
|
|
|
## --------------- ##
|
|
|
|
## Sanity checks. ##
|
|
|
|
## --------------- ##
|
|
|
|
|
|
|
|
# Checks that don't require cvs. Run `changelog-check' last as
|
|
|
|
# previous test may reveal problems requiring new ChangeLog entries.
|
|
|
|
local-check: po-check changelog-check
|
|
|
|
|
|
|
|
# copyright-check writable-files
|
|
|
|
|
|
|
|
changelog-check:
|
|
|
|
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
|
|
|
:; \
|
|
|
|
else \
|
|
|
|
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Verify that all source files using _() are listed in po/POTFILES.in.
|
|
|
|
po-check:
|
|
|
|
if test -f po/POTFILES.in; then \
|
|
|
|
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
|
|
|
|
grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2; \
|
|
|
|
diff -u $@-1 $@-2 || exit 1; \
|
|
|
|
rm -f $@-1 $@-2; \
|
|
|
|
fi
|