Make sure to assign a boolean value to a 1-bit bitfield. Reported on
[make.git] / maintMakefile
blobb679eb4665a9ce6aebad01f511824531a99bc181
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.
5 # We like mondo-warnings!
6 AM_CFLAGS += -Wall -W
8 # Find the glob source files... this might be dangerous, but we're maintainers!
9 globsrc := $(wildcard glob/*.c)
10 globhdr := $(wildcard glob/*.h)
12 TEMPLATES = README README.DOS README.W32 README.OS2 \
13             config.ami configh.dos config.h.W32 config.h-vms
14 MTEMPLATES = Makefile.DOS SMakefile
16 all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
18 # General rule for turning a .template into a regular file.
20 $(TEMPLATES) : % : %.template Makefile
21         rm -f $@
22         sed -e 's@%VERSION%@$(VERSION)@g' \
23             -e 's@%PACKAGE%@$(PACKAGE)@g' \
24           $< > $@
25         chmod a-w $@
27 # Construct Makefiles by adding on dependencies, etc.
29 $(MTEMPLATES) : % : %.template .dep_segment Makefile
30         rm -f $@
31         sed -e 's@%VERSION%@$(VERSION)@g' \
32             -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
33             -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
34             -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
35             -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
36             -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
37           $< > $@
38         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
39           cat $(word 2,$^) >>$@
40         chmod a-w $@
42 NMakefile: NMakefile.template .dep_segment Makefile
43         rm -f $@
44         cp $< $@
45         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
46           sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
47         chmod a-w $@
49 # Construct build.sh.in
51 build.sh.in: build.template Makefile
52         rm -f $@
53         sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
54             -e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
55           $< > $@
56         chmod a-w+x $@
59 # Use automake to build a dependency list file, for "foreign" makefiles like
60 # Makefile.DOS.
62 # Automake used to have a --generate-deps flag, but it's gone now, so we have
63 # to do it ourselves.
65 DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
66 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
67         rm -f $@
68         (for f in $(DEPDIR)/*.Po; do \
69            echo ""; \
70            echo "# $$f"; \
71            sed  -e '/^[^:]*\.[ch] *:/d' \
72                 -e 's, /usr/[^ ]*,,g' \
73                 -e 's, $(srcdir)/, ,g' \
74                 -e '/^ *\\$$/d' \
75                 -e '/^ *$$/d' \
76                 < $$f; \
77          done) > $@
79 # Get rid of everything "else".
81 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
83 CVS-CLEAN-FILES +=      $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
84                         build.sh.in .deps .dep_segment ABOUT-NLS \
85                         ansi2knr.*
87 # This rule tries to clean the tree right down to how it looks when you do a
88 # virgin CVS checkout.
90 # This is potentially dangerous since it removes _ANY FILE_ that is not in
91 # CVS.  Including files you might mean to add to CVS but haven't yet...
92 # I only use this in subdirectories where it's unlikely we have any new
93 # files.  Stil...
94 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";'
96 .PHONY: cvs-clean
97 cvs-clean: maintainer-clean
98         -rm -rf *~ $(CVS-CLEAN-FILES)
99         -cd config && $(cvsclean)
100         -cd po     && $(cvsclean)
101         -cd doc    && $(cvsclean)
102         -cd glob   && $(cvsclean)
105 # ----------------------------------------------------------------------
107 # The sections below were stolen from the Makefile.maint used by fileutils,
108 # sh-utils, textutils, CPPI, Bison, and Autoconf.
111 ## ---------------- ##
112 ## Updating files.  ##
113 ## ---------------- ##
115 WGET = wget --passive-ftp -nv
116 ftp-gnu = ftp://ftp.gnu.org/gnu
118 move_if_change =  if test -r $(target) && cmp -s $(target).t $(target); then \
119                     echo $(target) is unchanged; rm -f $(target).t; \
120                   else \
121                     mv $(target).t $(target); \
122                   fi
124 # ------------------- #
125 # Updating PO files.  #
126 # ------------------- #
128 # PO archive mirrors --- Be careful; some might not be fully populated!
129 #   ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
130 #   http://translation.sf.net/maint/
131 #   ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
133 po_repo = http://www.iro.umontreal.ca/translation/maint/$(PACKAGE)
134 .PHONY: do-po-update po-update
135 do-po-update:
136         tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
137         rm -rf $$tmppo && \
138         mkdir $$tmppo && \
139         (cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
140         cp $$tmppo/*.po po
141         cd po && $(MAKE) update-po
142         $(MAKE) po-check
144 po-update:
145         if test -d "po"; then \
146           $(MAKE) do-po-update; \
147         fi
149 # -------------------------- #
150 # Updating GNU build files.  #
151 # -------------------------- #
153 # The following pseudo table associates a local directory and a URL
154 # with each of the files that belongs to some other package and is
155 # regularly updated from the specified URL.
157 savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
158 target = $(patsubst get-%,%,$@)
160 config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
161 get-config/config.guess get-config/config.sub:
162         @echo $(WGET) $(config-url) -O $(target) \
163           && $(WGET) $(config-url) -O $(target).t \
164           && $(move_if_change)
166 gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
167 get-config/texinfo.tex:
168         @echo $(WGET) $(gnulib-url) -O $(target) \
169           && $(WGET) $(gnulib-url) -O $(target).t \
170           && $(move_if_change)
172 gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
173 get-doc/make-stds.texi get-doc/fdl.texi:
174         @echo $(WGET) $(gnustandards-url) -O $(target) \
175           && $(WGET) $(gnustandards-url) -O $(target).t \
176           && $(move_if_change)
178 .PHONY: cvs-update
179 cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
182 # --------------------- #
183 # Updating everything.  #
184 # --------------------- #
186 .PHONY: update
187 update: po-update cvs-update
190 ## --------------- ##
191 ## Sanity checks.  ##
192 ## --------------- ##
194 # Checks that don't require cvs.  Run `changelog-check' last as
195 # previous test may reveal problems requiring new ChangeLog entries.
196 local-check: po-check changelog-check
198 # copyright-check writable-files
200 changelog-check:
201         if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
202           :; \
203         else \
204           echo "$(VERSION) not in ChangeLog" 1>&2; \
205           exit 1; \
206         fi
208 # Verify that all source files using _() are listed in po/POTFILES.in.
209 # Ignore make.h; it defines _().
210 po-check:
211         if test -f po/POTFILES.in; then \
212           grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
213           grep -E -l '\b_\(' *.c *.h | grep -v make.h | sort > $@-2; \
214           diff -u $@-1 $@-2 || exit 1; \
215           rm -f $@-1 $@-2; \
216         fi
218 ## ------------------------- ##
219 ## GNU FTP upload artifacts. ##
220 ## ------------------------- ##
222 # This target creates the upload artifacts.
223 # Sign it with my key.
225 GPG = gpg
226 GPGFLAGS = -u 6338B6D4
228 DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
229 DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
231 .PHONY: distsign
232 distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
234 $(DIST_ARCHIVES_DIRECTIVE): .directive.asc
235         cp $< $@
237 %.sig : %
238         @echo "Signing file '$<':"
239         $(GPG) $(GPGFLAGS) -o $@ -b $<
241 .directive.asc:
242         @echo "Creating directive file '$@':"
243         @echo 'directory: make' > .directive
244         $(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
245         @rm -f .directive
247 # Upload the artifacts
249 FTPPUT = ncftpput
250 gnu-url = ftp-upload.gnu.org /incoming
252 UPLOADS = upload-alpha upload-ftp
253 .PHONY: $(UPLOADS)
254 $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
255         $(FTPPUT) $(gnu-url)/$(@:upload-%=%) $^