VirtualBox

source: kBuild/trunk/src/kmk/maintMakefile@ 2554

Last change on this file since 2554 was 2421, checked in by bird, 14 years ago

OpenBSD hacks.

File size: 9.0 KB
Line 
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.
4
5# We like mondo-warnings!
6ifeq ($(KBUILD_TARGET),openbsd) # bird
7AM_CFLAGS += -Wall -Wshadow -Wpointer-arith -Wbad-function-cast
8else
9AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
10endif
11
12# I want this one but I have to wait for the const cleanup!
13# -Wwrite-strings
14
15# Find the glob source files... this might be dangerous, but we're maintainers!
16globsrc := $(wildcard glob/*.c)
17globhdr := $(wildcard glob/*.h)
18
19TEMPLATES = README README.DOS README.W32 README.OS2 \
20 config.ami configh.dos config.h.W32 config.h-vms
21MTEMPLATES = Makefile.DOS SMakefile
22
23# These are built as a side-effect of the dist rule
24#all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
25
26# General rule for turning a .template into a regular file.
27#
28$(TEMPLATES) : % : %.template Makefile
29 rm -f $@
30 sed -e 's@%VERSION%@$(VERSION)@g' \
31 -e 's@%PACKAGE%@$(PACKAGE)@g' \
32 $< > $@
33 chmod a-w $@
34
35# Construct Makefiles by adding on dependencies, etc.
36#
37$(MTEMPLATES) : % : %.template .dep_segment Makefile
38 rm -f $@
39 sed -e 's@%VERSION%@$(VERSION)@g' \
40 -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
41 -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
42 -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
43 -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
44 -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
45 $< > $@
46 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
47 cat $(word 2,$^) >>$@
48 chmod a-w $@
49
50NMakefile: NMakefile.template .dep_segment Makefile
51 rm -f $@
52 cp $< $@
53 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
54 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
55 chmod a-w $@
56
57# Construct build.sh.in
58#
59build.sh.in: build.template Makefile
60 rm -f $@
61 sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
62 -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
63 $< > $@
64 chmod a-w+x $@
65
66
67# Use automake to build a dependency list file, for "foreign" makefiles like
68# Makefile.DOS.
69#
70# Automake used to have a --generate-deps flag, but it's gone now, so we have
71# to do it ourselves.
72#
73DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
74.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
75 rm -f $@
76 (for f in $(DEPDIR)/*.Po; do \
77 echo ""; \
78 echo "# $$f"; \
79 sed -e '/^[^:]*\.[ch] *:/d' \
80 -e 's, /usr/[^ ]*,,g' \
81 -e 's, $(srcdir)/, ,g' \
82 -e '/^ *\\$$/d' \
83 -e '/^ *$$/d' \
84 < $$f; \
85 done) > $@
86
87# Get rid of everything "else".
88#
89maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
90
91CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
92 build.sh.in .deps .dep_segment ABOUT-NLS \
93 ansi2knr.*
94
95# This rule tries to clean the tree right down to how it looks when you do a
96# virgin CVS checkout.
97
98# This target is potentially dangerous since it removes _ANY FILE_ that
99# is not in CVS. Including files you might mean to add to CVS but
100# haven't yet... I only use this in subdirectories where it's unlikely
101# we have any new files. Still... be careful!!
102
103cvsclean = $(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";'
104
105.PHONY: cvs-clean
106cvs-clean: maintainer-clean
107 -rm -rf *~ $(CVS-CLEAN-FILES)
108 -cd config && $(cvsclean)
109 -cd po && $(cvsclean)
110 -cd doc && $(cvsclean)
111 -cd glob && $(cvsclean)
112
113
114# ----------------------------------------------------------------------
115#
116# The sections below were stolen from the Makefile.maint used by fileutils,
117# sh-utils, textutils, CPPI, Bison, and Autoconf.
118
119
120## ---------------- ##
121## Updating files. ##
122## ---------------- ##
123
124WGET = wget --passive-ftp -nv
125ftp-gnu = ftp://ftp.gnu.org/gnu
126
127move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
128 echo $(target) is unchanged; rm -f $(target).t; \
129 else \
130 mv $(target).t $(target); \
131 fi
132
133# ------------------- #
134# Updating PO files. #
135# ------------------- #
136
137# PO archive mirrors --- Be careful; some might not be fully populated!
138# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
139# http://translation.sf.net/maint/
140# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
141
142po_repo = http://translationproject.org/latest/$(PACKAGE)
143.PHONY: do-po-update po-update
144do-po-update:
145 tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
146 && rm -rf "$$tmppo" \
147 && mkdir "$$tmppo" \
148 && (cd "$$tmppo" \
149 && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) \
150 && cp "$$tmppo"/*.po po && rm -rf "$$tmppo"
151 cd po && $(MAKE) update-po
152 $(MAKE) po-check
153
154po-update:
155 if test -d "po"; then \
156 $(MAKE) do-po-update; \
157 fi
158
159# -------------------------- #
160# Updating GNU build files. #
161# -------------------------- #
162
163# The following pseudo table associates a local directory and a URL
164# with each of the files that belongs to some other package and is
165# regularly updated from the specified URL.
166
167savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
168target = $(patsubst get-%,%,$@)
169
170config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
171get-config/config.guess get-config/config.sub:
172 @echo $(WGET) $(config-url) -O $(target) \
173 && $(WGET) $(config-url) -O $(target).t \
174 && $(move_if_change)
175
176gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
177get-config/texinfo.tex:
178 @echo $(WGET) $(gnulib-url) -O $(target) \
179 && $(WGET) $(gnulib-url) -O $(target).t \
180 && $(move_if_change)
181
182gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
183get-doc/make-stds.texi get-doc/fdl.texi:
184 @echo $(WGET) $(gnustandards-url) -O $(target) \
185 && $(WGET) $(gnustandards-url) -O $(target).t \
186 && $(move_if_change)
187
188.PHONY: cvs-update
189cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
190
191
192# --------------------- #
193# Updating everything. #
194# --------------------- #
195
196.PHONY: update
197update: po-update cvs-update
198
199
200## --------------- ##
201## Sanity checks. ##
202## --------------- ##
203
204# Checks that don't require cvs. Run `changelog-check' last as
205# previous test may reveal problems requiring new ChangeLog entries.
206local-check: po-check changelog-check
207
208# copyright-check writable-files
209
210changelog-check:
211 if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
212 :; \
213 else \
214 echo "$(VERSION) not in ChangeLog" 1>&2; \
215 exit 1; \
216 fi
217
218# Verify that all source files using _() are listed in po/POTFILES.in.
219# Ignore make.h; it defines _().
220po-check:
221 if test -f po/POTFILES.in; then \
222 grep '^[^#]' po/POTFILES.in | sort > $@-1; \
223 $(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "make.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \
224 diff -u $@-1 $@-2 || exit 1; \
225 rm -f $@-1 $@-2; \
226 fi
227
228## ------------------------- ##
229## GNU FTP upload artifacts. ##
230## ------------------------- ##
231
232# This target creates the upload artifacts.
233# Sign it with my key. If you don't have my key/passphrase then sorry,
234# you're SOL! :)
235
236GPG = gpg
237GPGFLAGS = -u 6338B6D4
238
239DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
240DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
241
242# A simple rule to test signing, etc.
243.PHONY: distsign
244distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
245
246%.sig : %
247 @echo "Signing file '$<':"
248 $(GPG) $(GPGFLAGS) -o "$@" -b "$<"
249
250%.directive.asc: %
251 @echo "Creating directive file '$@':"
252 @( \
253 echo 'verstion: 1.1'; \
254 echo 'directory: make'; \
255 echo 'filename: $*'; \
256 echo 'comment: Official upload of GNU make version $(VERSION)'; \
257 ) > "$*.directive"
258 $(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
259 @rm -f "$*.directive"
260
261# Upload the artifacts
262
263FTPPUT = ncftpput
264gnu-url = ftp-upload.gnu.org /incoming
265
266UPLOADS = upload-alpha upload-ftp
267.PHONY: $(UPLOADS)
268$(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
269 $(FTPPUT) "$(gnu-url)/$(@:upload-%=%)" $^
270
271
272# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
273# 2007 Free Software Foundation, Inc.
274# This file is part of GNU Make.
275#
276# GNU Make is free software; you can redistribute it and/or modify it under
277# the terms of the GNU General Public License as published by the Free Software
278# Foundation; either version 3 of the License, or (at your option) any later
279# version.
280#
281# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
282# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
283# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
284# details.
285#
286# You should have received a copy of the GNU General Public License along with
287# this program. If not, see <http://www.gnu.org/licenses/>.
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette