1997-08-19 02:11:04 +08:00
|
|
|
# Maintainer-only makefile segment. This contains things that are relevant
|
1999-03-30 14:19:17 +08:00
|
|
|
# only if you have the full copy of the GNU make sources from the CVS
|
|
|
|
# tree, not a dist copy.
|
2004-01-21 14:32:59 +08:00
|
|
|
|
|
|
|
# We like mondo-warnings!
|
|
|
|
AM_CFLAGS += -Wall -W
|
1997-08-19 02:11:04 +08:00
|
|
|
|
|
|
|
# Find the glob source files... this might be dangerous, but we're maintainers!
|
|
|
|
globsrc := $(wildcard glob/*.c)
|
1997-08-28 04:30:54 +08:00
|
|
|
globhdr := $(wildcard glob/*.h)
|
|
|
|
|
2003-05-02 09:44:59 +08:00
|
|
|
TEMPLATES = README README.DOS README.W32 README.OS2 \
|
1999-09-01 01:02:31 +08:00
|
|
|
config.ami configh.dos config.h.W32 config.h-vms
|
1998-07-31 04:54:47 +08:00
|
|
|
MTEMPLATES = Makefile.DOS SMakefile
|
1997-08-19 02:11:04 +08:00
|
|
|
|
2002-07-14 10:57:04 +08:00
|
|
|
all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
|
|
|
|
|
1997-08-19 02:11:04 +08:00
|
|
|
# General rule for turning a .template into a regular file.
|
|
|
|
#
|
1999-08-23 01:50:57 +08:00
|
|
|
$(TEMPLATES) : % : %.template Makefile
|
1997-08-28 04:30:54 +08:00
|
|
|
rm -f $@
|
1999-08-13 07:16:42 +08:00
|
|
|
sed -e 's@%VERSION%@$(VERSION)@g' \
|
|
|
|
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
1997-08-28 04:30:54 +08:00
|
|
|
$< > $@
|
|
|
|
chmod a-w $@
|
|
|
|
|
1998-07-31 04:54:47 +08:00
|
|
|
# Construct Makefiles by adding on dependencies, etc.
|
1997-08-28 04:30:54 +08:00
|
|
|
#
|
1999-08-23 01:50:57 +08:00
|
|
|
$(MTEMPLATES) : % : %.template .dep_segment Makefile
|
1997-08-19 02:11:04 +08:00
|
|
|
rm -f $@
|
1999-08-13 07:16:42 +08: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-28 04:30:54 +08:00
|
|
|
$< > $@
|
1998-07-31 04:54:47 +08:00
|
|
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
|
|
|
cat $(word 2,$^) >>$@
|
|
|
|
chmod a-w $@
|
|
|
|
|
1999-08-23 01:50:57 +08:00
|
|
|
NMakefile: NMakefile.template .dep_segment Makefile
|
1998-07-31 04:54:47 +08:00
|
|
|
rm -f $@
|
|
|
|
cp $< $@
|
|
|
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
|
|
|
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
|
1997-08-19 02:11:04 +08:00
|
|
|
chmod a-w $@
|
|
|
|
|
|
|
|
# Construct build.sh.in
|
|
|
|
#
|
1999-08-23 01:50:57 +08:00
|
|
|
build.sh.in: build.template Makefile
|
1997-08-19 02:11:04 +08:00
|
|
|
rm -f $@
|
2003-05-02 09:44:59 +08:00
|
|
|
sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
|
2004-03-22 23:11:48 +08:00
|
|
|
-e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
|
1999-03-26 15:08:57 +08:00
|
|
|
$< > $@
|
1997-08-19 02:11:04 +08:00
|
|
|
chmod a-w+x $@
|
|
|
|
|
2002-04-22 12:35:19 +08:00
|
|
|
|
1998-07-31 04:54:47 +08:00
|
|
|
# Use automake to build a dependency list file, for "foreign" makefiles like
|
|
|
|
# Makefile.DOS.
|
|
|
|
#
|
2002-04-22 12:35:19 +08:00
|
|
|
# Automake used to have a --generate-deps flag, but it's gone now, so we have
|
|
|
|
# to do it ourselves.
|
|
|
|
#
|
2004-12-01 04:58:52 +08:00
|
|
|
DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
|
1998-07-31 04:54:47 +08:00
|
|
|
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
|
2004-12-01 04:58:52 +08:00
|
|
|
(for f in $(DEPDIR)/*.Po; do \
|
|
|
|
echo ""; \
|
|
|
|
echo "# $$f"; \
|
|
|
|
cat $$f \
|
|
|
|
| sed -e '/^[^:]*\.[ch] *:/d' \
|
|
|
|
-e 's, /usr/[^ ]*,,g' \
|
|
|
|
-e 's, $(srcdir)/, ,g' \
|
|
|
|
-e '/^ *\\$$/d' \
|
|
|
|
-e '/^ *$$/d'; \
|
|
|
|
done) > $@
|
1998-07-31 04:54:47 +08:00
|
|
|
|
2002-04-22 07:57:24 +08:00
|
|
|
# Get rid of everything "else".
|
1997-09-20 03:47:55 +08:00
|
|
|
#
|
1999-03-30 14:19:17 +08:00
|
|
|
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
|
1997-09-20 03:47:55 +08:00
|
|
|
|
2002-08-10 09:27:16 +08:00
|
|
|
CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
|
2004-02-24 21:50:19 +08:00
|
|
|
build.sh.in .deps .dep_segment ABOUT-NLS \
|
|
|
|
ansi2knr.*
|
1997-09-16 22:17:23 +08:00
|
|
|
|
2002-08-10 09:27:16 +08:00
|
|
|
# This rule tries to clean the tree right down to how it looks when you do a
|
|
|
|
# virgin CVS checkout.
|
|
|
|
|
2004-02-23 14:25:54 +08:00
|
|
|
# This is potentially dangerous since it removes _ANY FILE_ that is not in
|
|
|
|
# CVS. Including files you might mean to add to CVS but haven't yet...
|
|
|
|
# I only use this in subdirectories where it's unlikely we have any new
|
|
|
|
# files. Stil...
|
|
|
|
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";'
|
|
|
|
|
2002-08-10 09:27:16 +08:00
|
|
|
.PHONY: cvs-clean
|
|
|
|
cvs-clean: maintainer-clean
|
2004-02-23 14:25:54 +08:00
|
|
|
-rm -rf *~ $(CVS-CLEAN-FILES)
|
|
|
|
-cd config && $(cvsclean)
|
|
|
|
-cd po && $(cvsclean)
|
|
|
|
-cd doc && $(cvsclean)
|
|
|
|
-cd glob && $(cvsclean)
|
2002-07-08 10:26:47 +08: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. #
|
|
|
|
# ------------------- #
|
|
|
|
|
2005-02-02 07:02:17 +08:00
|
|
|
po_repo = http://www.iro.umontreal.ca/translation/maint/$(PACKAGE)
|
2002-07-08 10:26:47 +08:00
|
|
|
.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
|
|
|
|
|
|
|
|
# -------------------------- #
|
2005-02-10 05:28:00 +08:00
|
|
|
# Updating GNU build files. #
|
2002-07-08 10:26:47 +08:00
|
|
|
# -------------------------- #
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2005-02-10 05:28:00 +08:00
|
|
|
savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
|
2002-07-08 10:26:47 +08:00
|
|
|
target = $(patsubst get-%,%,$@)
|
2004-02-23 14:25:54 +08:00
|
|
|
|
2005-02-10 05:28:00 +08:00
|
|
|
config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
|
2003-10-22 12:35:27 +08:00
|
|
|
get-config/config.guess get-config/config.sub:
|
|
|
|
@echo $(WGET) $(config-url) -O $(target) \
|
|
|
|
&& $(WGET) $(config-url) -O $(target).t \
|
|
|
|
&& $(move_if_change)
|
|
|
|
|
2005-05-10 09:38:18 +08:00
|
|
|
gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
|
2004-02-23 14:25:54 +08:00
|
|
|
get-config/texinfo.tex:
|
|
|
|
@echo $(WGET) $(gnulib-url) -O $(target) \
|
|
|
|
&& $(WGET) $(gnulib-url) -O $(target).t \
|
|
|
|
&& $(move_if_change)
|
|
|
|
|
2005-02-10 05:28:00 +08:00
|
|
|
gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
|
|
|
|
get-doc/make-stds.texi get-doc/fdl.texi:
|
|
|
|
@echo $(WGET) $(gnustandards-url) -O $(target) \
|
|
|
|
&& $(WGET) $(gnustandards-url) -O $(target).t \
|
|
|
|
&& $(move_if_change)
|
2002-07-08 10:26:47 +08:00
|
|
|
|
|
|
|
.PHONY: cvs-update
|
2005-02-10 05:28:00 +08:00
|
|
|
cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
|
2002-07-08 10:26:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
# --------------------- #
|
|
|
|
# Updating everything. #
|
|
|
|
# --------------------- #
|
|
|
|
|
|
|
|
.PHONY: update
|
2005-02-10 05:28:00 +08:00
|
|
|
update: po-update cvs-update
|
2002-07-08 21:05:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
## --------------- ##
|
|
|
|
## 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.
|
2002-10-15 05:54:04 +08:00
|
|
|
# Ignore make.h; it defines _().
|
2002-07-08 21:05:02 +08:00
|
|
|
po-check:
|
|
|
|
if test -f po/POTFILES.in; then \
|
|
|
|
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
|
2002-10-15 05:54:04 +08:00
|
|
|
grep -E -l '\b_\(' *.c *.h | grep -v make.h | sort > $@-2; \
|
2002-07-08 21:05:02 +08:00
|
|
|
diff -u $@-1 $@-2 || exit 1; \
|
|
|
|
rm -f $@-1 $@-2; \
|
|
|
|
fi
|
2004-03-04 21:42:51 +08:00
|
|
|
|
|
|
|
## ------------------------- ##
|
|
|
|
## GNU FTP upload artifacts. ##
|
|
|
|
## ------------------------- ##
|
|
|
|
|
|
|
|
# This target creates the upload artifacts.
|
2004-03-22 23:11:48 +08:00
|
|
|
# Sign it with my key.
|
2004-03-04 21:42:51 +08:00
|
|
|
|
|
|
|
GPG = gpg
|
2004-03-22 23:11:48 +08:00
|
|
|
GPGFLAGS = -u 6338B6D4
|
2004-03-04 21:42:51 +08:00
|
|
|
|
|
|
|
DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
|
|
|
|
DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
|
|
|
|
|
2004-03-06 16:00:17 +08:00
|
|
|
.PHONY: distsign
|
|
|
|
distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
2004-03-04 21:42:51 +08:00
|
|
|
|
2004-03-06 16:00:17 +08:00
|
|
|
$(DIST_ARCHIVES_DIRECTIVE): .directive.asc
|
2004-03-04 21:42:51 +08:00
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
%.sig : %
|
|
|
|
@echo "Signing file '$<':"
|
2004-03-22 23:11:48 +08:00
|
|
|
$(GPG) $(GPGFLAGS) -o $@ -b $<
|
2004-03-04 21:42:51 +08:00
|
|
|
|
2004-03-06 16:00:17 +08:00
|
|
|
.directive.asc:
|
2004-03-04 21:42:51 +08:00
|
|
|
@echo "Creating directive file '$@':"
|
|
|
|
@echo 'directory: make' > .directive
|
2004-03-22 23:11:48 +08:00
|
|
|
$(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
|
2004-03-04 21:42:51 +08:00
|
|
|
@rm -f .directive
|
2004-03-06 16:00:17 +08:00
|
|
|
|
|
|
|
# Upload the artifacts
|
|
|
|
|
|
|
|
FTPPUT = ncftpput
|
|
|
|
gnu-url = ftp-upload.gnu.org /incoming
|
|
|
|
|
|
|
|
UPLOADS = upload-alpha upload-ftp
|
|
|
|
.PHONY: $(UPLOADS)
|
|
|
|
$(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
|
|
|
$(FTPPUT) $(gnu-url)/$(@:upload-%=%) $^
|