/[bison]/bison/Makefile.maint
ViewVC logotype

Diff of /bison/Makefile.maint

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by eggert, Thu Oct 17 00:14:32 2002 UTC revision 1.10 by akim, Mon Nov 4 08:45:16 2002 UTC
# Line 1  Line 1 
1  # -*-Makefile-*-  # -*-Makefile-*-
2  # This Makefile fragment is shared between Autoconf and Bison.  # This Makefile fragment is shared between fileutils, sh-utils, textutils,
3    # CPPI, Bison, and Autoconf.
4    
5  ## Copyright (C) 2001, 2002 Free Software Foundation, Inc.  ## Copyright (C) 2001, 2002 Free Software Foundation, Inc.
6  ##  ##
# Line 42  release_archive_dir ?= ../release Line 43  release_archive_dir ?= ../release
43    
44    
45    
 ## ---------------- ##  
 ## Updating files.  ##  
 ## ---------------- ##  
   
 WGET = wget  
 ftp-gnu = ftp://ftp.gnu.org/gnu  
   
 # Use mv, if you don't have/want move-if-change.  
 move_if_change ?= move-if-change  
   
 # ------------------- #  
 # 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.  
 wget_files ?= $(srcdir)/config.guess $(srcdir)/config.sub \  
               $(srcdir)/doc/texinfo.tex  
 wget-targets = $(patsubst %, get-%, $(wget_files))  
   
 config.guess-url_prefix = $(ftp-gnu)/config/  
 config.sub-url_prefix = $(ftp-gnu)/config/  
   
 texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/  
   
 standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/  
 make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/  
   
 target = $(patsubst get-%, %, $@)  
 url = $($(notdir $(target))-url_prefix)$(notdir $(target))  
   
 .PHONY: $(wget-targets)  
 $(wget-targets):  
         $(WGET) $(url) -O $(target).t \  
           && $(move_if_change) $(target).t $(target)  
   
 .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) $(target).t $(target);  
   
 .PHONY: cvs-update  
 cvs-update: $(cvs-targets)  
   
   
 # --------------------- #  
 # Updating everything.  #  
 # --------------------- #  
   
 .PHONY: update  
 update: wget-update cvs-update po-update  
   
   
   
46  ## --------------- ##  ## --------------- ##
47  ## Sanity checks.  ##  ## Sanity checks.  ##
48  ## --------------- ##  ## --------------- ##
49    
50  # Checks that don't require cvs.  Run `changelog-check' last as  # Checks that don't require cvs.
51  # previous test may reveal problems requiring new ChangeLog entries.  # Run `changelog-check' last, as previous test may reveal problems requiring
52  local-check: po-check copyright-check writable-files changelog-check  # new ChangeLog entries.
53    local-check = \
54      po-check copyright-check writable-files m4-check author_mark_check \
55      changelog-check strftime-check header-check
56    .PHONY: $(local-check)
57    
58    # Make sure C source files in src/ don't include xalloc.h directly,
59    # since they all already include it via sys2.h.
60    # It's not a big deal -- just aesthetics.
61    header-check:
62            if test -f $(srcdir)/src/sys2.h; then                           \
63              if grep 'xalloc\.h' $(srcdir)/src/*.c; then                   \
64                exit 1;                                                     \
65              fi;                                                           \
66            fi
67    
68    # Ensure that date's --help output stays in sync with the info
69    # documentation for GNU strftime.  The only exception is %N,
70    # which date accepts but GNU strftime does not.
71    extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
72    strftime-check:
73            if test -f $(srcdir)/src/date.c; then                           \
74              grep '^  %.  ' $(srcdir)/src/date.c | sort                    \
75                | $(extract_char) > $@-src;                                 \
76              { echo N;                                                     \
77                info libc date calendar format | grep '^    `%.'\'          \
78                  | $(extract_char); } | sort > $@-info;                    \
79              diff -u $@-src $@-info || exit 1;                             \
80              rm -f $@-src $@-info;                                         \
81            fi
82    
83  changelog-check:  changelog-check:
84          if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \          if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
# Line 143  changelog-check: Line 88  changelog-check:
88            exit 1; \            exit 1; \
89          fi          fi
90    
91    m4-check:
92            @grep 'AC_DEFUN([^[]' m4/*.m4 \
93              && { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
94                   exit 1; } || :
95    
96  # Verify that all source files using _() are listed in po/POTFILES.in.  # Verify that all source files using _() are listed in po/POTFILES.in.
97  po-check:  po-check:
98          if test -f po/POTFILES.in; then \          if test -f po/POTFILES.in; then \
99            grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \            grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
100            grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2; \            grep -E -l '\b_\(' lib/*.[ch] src/*.[ch] | sort > $@-2; \
101            diff -u $@-1 $@-2 || exit 1; \            diff -u $@-1 $@-2 || exit 1; \
102            rm -f $@-1 $@-2; \            rm -f $@-1 $@-2; \
103          fi          fi
104    
105    # In a definition of #define AUTHORS "... and ..." where the RHS contains
106    # the English word `and', the string must be marked with `N_ (...)' so that
107    # gettext recognizes it as a string requiring translation.
108    author_mark_check:
109            @grep '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
110              { echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
111                exit 1; } || :
112    
113  # Check that `make alpha' will not fail at the end of the process.  # Check that `make alpha' will not fail at the end of the process.
114  writable-files:  writable-files:
115          if test -d $(release_archive_dir); then :; else                 \          if test -d $(release_archive_dir); then :; else                 \
# Line 166  writable-files: Line 124  writable-files:
124          done;                                                           \          done;                                                           \
125          test "$$fail" && exit 1 || :          test "$$fail" && exit 1 || :
126    
127  # Make sure that the copyright date in lib/version-etc.c is up to date.  v_etc_file = lib/version-etc.c
128    # Make sure that the copyright date in $(v_etc_file) is up to date.
129  copyright-check:  copyright-check:
130          @if test -f lib/version-etc.c; then \          @if test -f $(v_etc_file); then \
131            grep 'N_("Copyright (C) $(shell date +%Y) Free' lib/version-etc.c \            grep '"Copyright (C) $(shell date +%Y) Free' $(v_etc_file) \
132              >/dev/null \              >/dev/null \
133            || { echo 'out of date copyright in $<; update it' 1>&2; exit 1; }; \            || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
134                   exit 1; }; \
135          fi          fi
136    
137    
# Line 199  maintainer-distcheck: changelog-check Line 159  maintainer-distcheck: changelog-check
159          $(MAKE) my-distcheck          $(MAKE) my-distcheck
160    
161    
   
 ## -------------- ##  
 ## Making dists.  ##  
 ## -------------- ##  
   
   
162  # Tag before making distribution.  Also, don't make a distribution if  # Tag before making distribution.  Also, don't make a distribution if
163  # checks fail.  Also, make sure the NEWS file is up-to-date.  # checks fail.  Also, make sure the NEWS file is up-to-date.
164  # FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.  # FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
165  cvs-dist: local-check cvs-check maintainer-distcheck  cvs-dist: $(local-check) cvs-check maintainer-distcheck
166          $(CVS) update po          $(CVS) update po
167          $(CVS) tag -c $(this-cvs-tag)          $(CVS) tag -c $(this-cvs-tag)
168          $(MAKE) dist          $(MAKE) dist
# Line 218  cvs-dist: local-check cvs-check maintain Line 172  cvs-dist: local-check cvs-check maintain
172  null_AM_MAKEFLAGS = \  null_AM_MAKEFLAGS = \
173    ACLOCAL=false \    ACLOCAL=false \
174    AUTOCONF=false \    AUTOCONF=false \
   AUTOM4TE=false \  
175    AUTOMAKE=false \    AUTOMAKE=false \
176    AUTOHEADER=false \    AUTOHEADER=false \
177    MAKEINFO=false    MAKEINFO=false
# Line 228  null_AM_MAKEFLAGS = \ Line 181  null_AM_MAKEFLAGS = \
181  # and building with CFLAGS='-Wformat -Werror' causes any format warning to be  # and building with CFLAGS='-Wformat -Werror' causes any format warning to be
182  # treated as a failure.  # treated as a failure.
183  t=./=test  t=./=test
184  my-distcheck: writable-files po-check  my-distcheck: $(local-check)
185          -rm -rf $(t)          -rm -rf $(t)
186          mkdir $(t)          mkdir $(t)
187          GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz          GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
# Line 262  rel-check: Line 215  rel-check:
215          md5_tmp=/tmp/rel-check-md5-$$$$; \          md5_tmp=/tmp/rel-check-md5-$$$$; \
216          set -e; \          set -e; \
217          trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \          trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
218          $(WGET) -q --output-document=$$tarz $(url); \          wget -q --output-document=$$tarz $(url); \
219          echo "$(md5)  -" > $$md5_tmp; \          echo "$(md5)  -" > $$md5_tmp; \
220          md5sum -c $$md5_tmp < $$tarz          md5sum -c $$md5_tmp < $$tarz
221    
# Line 311  announcement: NEWS ChangeLog $(rel-files Line 264  announcement: NEWS ChangeLog $(rel-files
264                -e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \                -e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
265          )          )
266    
267    
268    ## ---------------- ##
269    ## Updating files.  ##
270    ## ---------------- ##
271    
272    WGET = wget
273    ftp-gnu = ftp://ftp.gnu.org/gnu
274    
275    # Use mv, if you don't have/want move-if-change.
276    move_if_change ?= move-if-change
277    
278    
279    # --------------------- #
280    # Updating everything.  #
281    # --------------------- #
282    
283    .PHONY: update
284    update: wget-update cvs-update po-update
285    
286    
287    # ------------------- #
288    # Updating PO files.  #
289    # ------------------- #
290    
291    po_repo = http://www.iro.umontreal.ca/contrib/po/maint/$(PACKAGE)
292    .PHONY: do-po-update po-update
293    do-po-update:
294            tmppo=/tmp/$(PACKAGE)-$(VERSION)-po &&\
295            rm -rf $$tmppo && \
296            mkdir $$tmppo && \
297            (cd $$tmppo && $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) &&\
298            cp $$tmppo/*.po po
299            cd po && $(MAKE) update-po
300            $(MAKE) po-check
301    
302    po-update:
303            if test -d "po"; then \
304              $(MAKE) do-po-update; \
305            fi
306    
307    # -------------------------- #
308    # Updating GNU build tools.  #
309    # -------------------------- #
310    
311    # The following pseudo table associates a local directory and a URL
312    # with each of the files that belongs to some other package and is
313    # regularly updated from the specified URL.
314    wget_files ?= $(srcdir)/config/config.guess \
315                  $(srcdir)/config/config.sub \
316                  $(srcdir)/src/ansi2knr.c \
317                  $(srcdir)/config/texinfo.tex
318    get-targets = $(patsubst %, get-%, $(wget_files))
319    
320    config.guess-url_prefix = $(ftp-gnu)/config/
321    config.sub-url_prefix = $(ftp-gnu)/config/
322    
323    ansi2knr.c-url_prefix = ftp://ftp.cs.wisc.edu/ghost/
324    
325    texinfo.tex-url_prefix = $(ftp-gnu)/texinfo/
326    
327    standards.texi-url_prefix = $(ftp-gnu)/GNUinfo/
328    make-stds.texi-url_prefix = $(ftp-gnu)/GNUinfo/
329    
330    target = $(patsubst get-%, %, $@)
331    url = $($(notdir $(target))-url_prefix)$(notdir $(target))
332    
333    .PHONY: $(get-targets)
334    $(get-targets):
335            $(WGET) $(url) -O $(target).t \
336              && $(move_if_change) $(target).t $(target)
337    
338    cvs_files ?= $(srcdir)/config/depcomp $(srcdir)/config/missing $(srcdir)/config/mkinstalldirs \
339                 $(srcdir)/config/install-sh $(srcdir)/src/ansi2knr.c
340    automake_repo=:pserver:anoncvs:anoncvs@sources.redhat.com:/cvs/automake
341    .PHONY: wget-update
342    wget-update: $(get-targets)
343    
344    .PHONY: cvs-update
345    cvs-update:
346            for f in $(cvs_files); do                                     \
347              test -f $$f || { echo "*** skipping $$f" 1>&2; continue; }; \
348              file=$$(basename $$f);                                      \
349              echo checking out $$file...;                                \
350              $(CVS) -d $(automake_repo) co -p automake/lib/$$file> $$f.t \
351                && $(move_if_change) $$f.t $$f;                           \
352            done
353    
354  define emit-upload-commands  define emit-upload-commands
355          echo =====================================          echo =====================================
356          echo =====================================          echo =====================================
# Line 323  endef Line 363  endef
363  $(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz  $(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
364          xdelta delta -9 $^ $@ || :          xdelta delta -9 $^ $@ || :
365    
366  alpha:  alpha: $(local-check)
367          $(MAKE) cvs-dist          $(MAKE) cvs-dist
368          $(MAKE) $(xd-delta)          $(MAKE) $(xd-delta)
369          $(MAKE) -s announcement > /tmp/announce-$(my_distdir)          $(MAKE) -s announcement > /tmp/announce-$(my_distdir)

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26