make/maintMakefile

320 lines
9.4 KiB
Plaintext
Raw Normal View History

1997-08-19 02:11:04 +08:00
# Maintainer-only makefile segment. This contains things that are relevant
# only if you have the full copy of the GNU make sources from the Git
# tree, not a dist copy.
2013-10-09 13:54:24 +08:00
GPG_FINGERPRINT := 6338B6D4
# We like mondo-warnings!
AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
# I want this one but I have to wait for the const cleanup!
# -Wwrite-strings
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)
TEMPLATES = README README.DOS README.W32 README.OS2 \
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
# These are built as a side-effect of the dist rule
#all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
2002-07-14 10:57:04 +08:00
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 $@
sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
-e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
$< > $@
1997-08-19 02:11:04 +08:00
chmod a-w+x $@
1998-07-31 04:54:47 +08:00
# Use automake to build a dependency list file, for "foreign" makefiles like
# Makefile.DOS.
#
# Automake used to have a --generate-deps flag, but it's gone now, so we have
# to do it ourselves.
#
DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
1998-07-31 04:54:47 +08:00
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
rm -f $@
(for f in $(DEPDIR)/*.Po; do \
echo ""; \
echo "# $$f"; \
sed -e '/^[^:]*\.[ch] *:/d' \
-e 's, /usr/[^ ]*,,g' \
-e 's, $(srcdir)/, ,g' \
-e '/^ *\\$$/d' \
-e '/^ *$$/d' \
< $$f; \
done) > $@
1998-07-31 04:54:47 +08:00
# Cleaning
GIT := git
2013-01-13 10:53:15 +08:00
# git-clean: Clean all "ignored" files. Leave untracked files.
# git-very-clean: Clean all files that aren't stored in source control.
2013-01-13 10:53:15 +08:00
.PHONY: git-clean git-very-clean
git-clean:
-$(GIT) clean -fdX
2013-01-13 10:53:15 +08:00
git-very-clean: git-clean
-$(GIT) clean -fd
# ----------------------------------------------------------------------
#
# 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 -nv
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 archive mirrors --- Be careful; some might not be fully populated!
# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
# http://translation.sf.net/maint/
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
po_wget_flags = --recursive --level=1 --no-directories --no-parent \
--no-check-certificate
po_repo = http://translationproject.org/latest/$(PACKAGE)
.PHONY: do-po-update po-update
do-po-update:
2006-03-18 02:55:26 +08:00
tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
&& rm -rf "$$tmppo" \
&& mkdir "$$tmppo" \
&& (cd "$$tmppo" \
&& $(WGET) $(po_wget_flags) -A '*.po' $(po_repo)) \
&& cp "$$tmppo"/*.po $(top_srcdir)/po && rm -rf "$$tmppo"
cd po && $(MAKE) update-po
$(MAKE) po-check
po-update:
[ -d "po" ] && $(MAKE) do-po-update
# -------------------------- #
# Updating GNU build files. #
# -------------------------- #
# 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.
cvs-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
git-url = http://git.savannah.gnu.org/cgit
target = $(patsubst get-%,%,$@)
config-url = $(git-url)/config.git/plain/$(patsubst get-config/%,%,$@)
get-config/config.guess get-config/config.sub:
@echo $(WGET) $(config-url) -O $(target) \
&& $(WGET) $(config-url) -O $(target).t \
&& $(move_if_change)
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-config/%,%,$@)
get-config/texinfo.tex:
@echo $(WGET) $(gnulib-url) -O $(target) \
&& $(WGET) $(gnulib-url) -O $(target).t \
&& $(move_if_change)
gnustandards-url = $(cvs-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)
.PHONY: scm-update
scm-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
# --------------------- #
# Updating everything. #
# --------------------- #
.PHONY: update
update: po-update scm-update
# ---------------------------------- #
# Alternative configuration checks. #
# ---------------------------------- #
.PHONY: check-alt-config
check-alt-config: \
checkcfg.--disable-job-server \
checkcfg.--disable-load \
checkcfg.--without-guile \
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
checkcfg.CPPFLAGS^-DNO_ARCHIVES
checkcfg.%: distdir
@ rm -rf $(distdir)/_build \
&& mkdir $(distdir)/_build \
&& cd $(distdir)/_build \
&& echo "Testing configure with $(subst ^,=,$*)" \
&& ../configure --srcdir=.. $(subst ^,=,$*) \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
CFLAGS='$(AM_CFLAGS)' \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) check
.PHONY: update
update: po-update scm-update
## --------------- ##
## Sanity checks. ##
## --------------- ##
# Before we build a distribution be sure we run our local checks
#distdir: local-check
# Checks that don't require Git. 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 $(top_srcdir)/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.
# Ignore makeint.h; it defines _().
po-check:
if test -f po/POTFILES.in; then \
grep '^[^#]' po/POTFILES.in | sort > $@-1; \
$(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "makeint.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
fi
2013-10-09 13:54:24 +08:00
## ------------------------- ##
## Make release targets. ##
## ------------------------- ##
tag-release:
case '$(VERSION)' in \
(*.*.9*) message=" candidate" ;; \
(*) message= ;; \
esac; \
$(GIT) tag -m "GNU Make release$$message $(VERSION)" -u '$(GPG_FINGERPRINT)' '$(VERSION)'
## ------------------------- ##
## GNU FTP upload artifacts. ##
## ------------------------- ##
# This target creates the upload artifacts.
# Sign it with my key. If you don't have my key/passphrase then sorry,
# you're SOL! :)
GPG = gpg
2013-10-09 13:54:24 +08:00
GPGFLAGS = -u $(GPG_FINGERPRINT)
DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
# A simple rule to test signing, etc.
2004-03-06 16:00:17 +08:00
.PHONY: distsign
distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
%.sig : %
@echo "Signing file '$<':"
$(GPG) $(GPGFLAGS) -o "$@" -b "$<"
%.directive.asc: %
@echo "Creating directive file '$@':"
@( \
2010-07-07 10:06:48 +08:00
echo 'version: 1.1'; \
echo 'directory: make'; \
echo 'filename: $*'; \
echo 'comment: Official upload of GNU make version $(VERSION)'; \
) > "$*.directive"
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
@rm -f "$*.directive"
2004-03-06 16:00:17 +08:00
# Upload the artifacts
FTPPUT = ncftpput
2010-07-07 10:06:48 +08:00
gnu-upload-host = ftp-upload.gnu.org
gnu-upload-dir = /incoming
2004-03-06 16:00:17 +08:00
UPLOADS = upload-alpha upload-ftp
.PHONY: $(UPLOADS)
$(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
2010-07-07 10:06:48 +08:00
$(FTPPUT) "$(gnu-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
2013-05-17 13:46:11 +08:00
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.