Home | History | Annotate | Line # | Download | only in po
Make-in revision 1.8
      1  1.1  christos # Makefile for program source directory in GNU NLS utilities package.
      2  1.1  christos # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper (a] gnu.ai.mit.edu>
      3  1.8  christos # Copyright (C) 2001-2019 Free Software Foundation, Inc.
      4  1.1  christos #
      5  1.1  christos # This file may be copied and used freely without restrictions.  It can
      6  1.1  christos # be used in projects which are not available under the GNU Public License
      7  1.1  christos # but which still want to provide support for the GNU gettext functionality.
      8  1.1  christos # Please note that the actual code is *not* freely available.
      9  1.1  christos 
     10  1.1  christos PACKAGE = @PACKAGE@
     11  1.1  christos VERSION = @VERSION@
     12  1.1  christos 
     13  1.1  christos SHELL = /bin/sh
     14  1.1  christos @SET_MAKE@
     15  1.1  christos 
     16  1.1  christos srcdir = @srcdir@
     17  1.1  christos top_srcdir = @top_srcdir@
     18  1.1  christos VPATH = @srcdir@
     19  1.1  christos top_builddir = @top_builddir@
     20  1.1  christos 
     21  1.1  christos prefix = @prefix@
     22  1.1  christos exec_prefix = @exec_prefix@
     23  1.8  christos datadir = @datadir@
     24  1.8  christos localedir = @localedir@
     25  1.8  christos gnulocaledir = @datarootdir@/locale
     26  1.8  christos gettextsrcdir = @datarootdir@/gettext/po
     27  1.1  christos subdir = po
     28  1.1  christos 
     29  1.1  christos DESTDIR =
     30  1.1  christos 
     31  1.1  christos INSTALL = @INSTALL@
     32  1.1  christos INSTALL_DATA = @INSTALL_DATA@
     33  1.1  christos MKINSTALLDIRS = @MKINSTALLDIRS@
     34  1.1  christos 
     35  1.1  christos CC = @CC@
     36  1.1  christos GENCAT = @GENCAT@
     37  1.1  christos GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
     38  1.1  christos MSGFMT = @MSGFMT@
     39  1.1  christos XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
     40  1.1  christos MSGMERGE = PATH=../src:$$PATH msgmerge
     41  1.1  christos 
     42  1.1  christos DEFS = @DEFS@
     43  1.1  christos CFLAGS = @CFLAGS@
     44  1.1  christos CPPFLAGS = @CPPFLAGS@
     45  1.1  christos 
     46  1.1  christos INCLUDES = -I.. -I$(top_srcdir)/intl
     47  1.1  christos 
     48  1.1  christos COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
     49  1.1  christos 
     50  1.1  christos SOURCES = cat-id-tbl.c
     51  1.1  christos POFILES = @POFILES@
     52  1.1  christos GMOFILES = @GMOFILES@
     53  1.1  christos DISTFILES = ChangeLog Makefile.in.in SRC-POTFILES.in BLD-POTFILES.in $(PACKAGE).pot \
     54  1.1  christos stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
     55  1.1  christos 
     56  1.1  christos # Note - the following line gets processed by bfd/configure and amended
     57  1.1  christos # to contain the full list of source dir POTFILES.
     58  1.1  christos SRC-POTFILES = \
     59  1.1  christos 
     60  1.1  christos # Note - the following line gets processed by bfd/configure and amended
     61  1.1  christos # to contain the full list of build dir POTFILES.
     62  1.1  christos BLD-POTFILES = \
     63  1.1  christos 
     64  1.1  christos CATALOGS = @CATALOGS@
     65  1.1  christos CATOBJEXT = @CATOBJEXT@
     66  1.1  christos INSTOBJEXT = @INSTOBJEXT@
     67  1.1  christos 
     68  1.1  christos .SUFFIXES:
     69  1.1  christos .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
     70  1.1  christos 
     71  1.1  christos .c.o:
     72  1.1  christos 	$(COMPILE) $<
     73  1.1  christos 
     74  1.1  christos .po.pox:
     75  1.1  christos 	$(MAKE) $(PACKAGE).pot
     76  1.1  christos 	$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
     77  1.1  christos 
     78  1.1  christos .po.mo:
     79  1.1  christos 	$(MSGFMT) -o $@ $<
     80  1.1  christos 
     81  1.1  christos .po.gmo:
     82  1.1  christos 	file=`echo $* | sed 's,.*/,,'`.gmo \
     83  1.1  christos 	  && rm -f $$file && $(GMSGFMT) -o $$file $<
     84  1.1  christos 
     85  1.1  christos .po.cat:
     86  1.1  christos 	sed -f ../intl/po2msg.sed < $< > $*.msg \
     87  1.1  christos 	  && rm -f $@ && $(GENCAT) $@ $*.msg
     88  1.1  christos 
     89  1.1  christos 
     90  1.1  christos all: all-@USE_NLS@
     91  1.1  christos 
     92  1.1  christos all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
     93  1.1  christos all-no:
     94  1.1  christos 
     95  1.1  christos $(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES)
     96  1.1  christos 	$(XGETTEXT) --default-domain=$(PACKAGE) \
     97  1.1  christos 	  --directory=$(top_srcdir) \
     98  1.1  christos 	  --add-comments --keyword=_ --keyword=N_ \
     99  1.1  christos 	  --msgid-bugs-address=bug-binutils (a] gnu.org \
    100  1.1  christos 	  --files-from=$(srcdir)/SRC-POTFILES.in 
    101  1.1  christos 	$(XGETTEXT) --default-domain=$(PACKAGE) \
    102  1.1  christos 	  --directory=.. \
    103  1.1  christos 	  --directory=. \
    104  1.1  christos 	  --add-comments --keyword=_ --keyword=N_ \
    105  1.1  christos 	  --join-existing \
    106  1.1  christos 	  --msgid-bugs-address=bug-binutils (a] gnu.org \
    107  1.1  christos 	  --files-from=$(srcdir)/BLD-POTFILES.in
    108  1.1  christos 	rm -f $(srcdir)/$(PACKAGE).pot
    109  1.1  christos 	mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
    110  1.1  christos 
    111  1.1  christos $(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
    112  1.1  christos $(srcdir)/stamp-cat-id: $(PACKAGE).pot
    113  1.1  christos 	rm -f cat-id-tbl.tmp
    114  1.1  christos 	sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
    115  1.1  christos 		| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
    116  1.1  christos 	if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
    117  1.1  christos 	  rm cat-id-tbl.tmp; \
    118  1.1  christos 	else \
    119  1.1  christos 	  echo cat-id-tbl.c changed; \
    120  1.1  christos 	  rm -f $(srcdir)/cat-id-tbl.c; \
    121  1.1  christos 	  mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
    122  1.1  christos 	fi
    123  1.1  christos 	cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
    124  1.1  christos 
    125  1.1  christos 
    126  1.1  christos install: install-exec install-data
    127  1.1  christos install-exec:
    128  1.1  christos install-info:
    129  1.1  christos install-html:
    130  1.1  christos install-pdf:
    131  1.1  christos install-data: install-data-@USE_NLS@
    132  1.1  christos install-data-no: all
    133  1.1  christos install-data-yes: all
    134  1.1  christos 	if test -r $(MKINSTALLDIRS); then \
    135  1.1  christos 	  $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
    136  1.1  christos 	else \
    137  1.1  christos 	  $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
    138  1.1  christos 	fi
    139  1.1  christos 	@catalogs='$(CATALOGS)'; \
    140  1.1  christos 	for cat in $$catalogs; do \
    141  1.1  christos 	  cat=`basename $$cat`; \
    142  1.1  christos 	  case "$$cat" in \
    143  1.1  christos 	    *.gmo) destdir=$(gnulocaledir);; \
    144  1.1  christos 	    *)     destdir=$(localedir);; \
    145  1.1  christos 	  esac; \
    146  1.1  christos 	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
    147  1.1  christos 	  dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
    148  1.1  christos 	  if test -r $(MKINSTALLDIRS); then \
    149  1.1  christos 	    $(MKINSTALLDIRS) $$dir; \
    150  1.1  christos 	  else \
    151  1.1  christos 	    $(top_srcdir)/mkinstalldirs $$dir; \
    152  1.1  christos 	  fi; \
    153  1.1  christos 	  if test -r $$cat; then \
    154  1.1  christos 	    $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
    155  1.1  christos 	    echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
    156  1.1  christos 	  else \
    157  1.1  christos 	    $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
    158  1.1  christos 	    echo "installing $(srcdir)/$$cat as" \
    159  1.1  christos 		 "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
    160  1.1  christos 	  fi; \
    161  1.1  christos 	  if test -r $$cat.m; then \
    162  1.1  christos 	    $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
    163  1.1  christos 	    echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
    164  1.1  christos 	  else \
    165  1.1  christos 	    if test -r $(srcdir)/$$cat.m ; then \
    166  1.1  christos 	      $(INSTALL_DATA) $(srcdir)/$$cat.m \
    167  1.1  christos 		$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
    168  1.1  christos 	      echo "installing $(srcdir)/$$cat as" \
    169  1.1  christos 		   "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
    170  1.1  christos 	    else \
    171  1.1  christos 	      true; \
    172  1.1  christos 	    fi; \
    173  1.1  christos 	  fi; \
    174  1.1  christos 	done
    175  1.1  christos 	if test "$(PACKAGE)" = "gettext"; then \
    176  1.1  christos 	  if test -r $(MKINSTALLDIRS); then \
    177  1.1  christos 	    $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
    178  1.1  christos 	  else \
    179  1.1  christos 	    $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
    180  1.1  christos 	  fi; \
    181  1.1  christos 	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
    182  1.1  christos 			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
    183  1.1  christos 	else \
    184  1.1  christos 	  : ; \
    185  1.1  christos 	fi
    186  1.1  christos 
    187  1.1  christos # Define this as empty until I found a useful application.
    188  1.1  christos installcheck:
    189  1.1  christos 
    190  1.1  christos uninstall:
    191  1.1  christos 	catalogs='$(CATALOGS)'; \
    192  1.1  christos 	for cat in $$catalogs; do \
    193  1.1  christos 	  cat=`basename $$cat`; \
    194  1.1  christos 	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
    195  1.1  christos 	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
    196  1.1  christos 	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
    197  1.1  christos 	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
    198  1.1  christos 	  rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
    199  1.1  christos 	done
    200  1.1  christos 	rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
    201  1.1  christos 
    202  1.1  christos check: all
    203  1.1  christos 
    204  1.1  christos cat-id-tbl.o: ../intl/libgettext.h
    205  1.1  christos 
    206  1.1  christos html dvi pdf ps info tags TAGS ID:
    207  1.1  christos 
    208  1.1  christos mostlyclean:
    209  1.1  christos 	rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
    210  1.1  christos 	rm -fr *.o
    211  1.1  christos 
    212  1.1  christos clean: mostlyclean
    213  1.1  christos 
    214  1.1  christos distclean: clean
    215  1.1  christos 	rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m
    216  1.1  christos 	rm -f SRC-POTFILES BLD-POTFILES 
    217  1.1  christos 
    218  1.1  christos maintainer-clean: distclean
    219  1.1  christos 	@echo "This command is intended for maintainers to use;"
    220  1.1  christos 	@echo "it deletes files that may require special tools to rebuild."
    221  1.1  christos 	rm -f $(GMOFILES) SRC-POTFILES.in BLD-POTFILES.in
    222  1.1  christos 
    223  1.1  christos distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
    224  1.1  christos dist distdir: update-po $(DISTFILES)
    225  1.1  christos 	dists="$(DISTFILES)"; \
    226  1.1  christos 	for file in $$dists; do \
    227  1.1  christos 	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
    228  1.1  christos 	    || cp -p $(srcdir)/$$file $(distdir); \
    229  1.1  christos 	done
    230  1.1  christos 
    231  1.1  christos update-po: Makefile
    232  1.1  christos 	$(MAKE) $(PACKAGE).pot
    233  1.1  christos 	PATH=`pwd`/../src:$$PATH; \
    234  1.1  christos 	cd $(srcdir); \
    235  1.1  christos 	catalogs='$(CATALOGS)'; \
    236  1.1  christos 	for cat in $$catalogs; do \
    237  1.1  christos 	  cat=`basename $$cat`; \
    238  1.1  christos 	  lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
    239  1.1  christos 	  mv $$lang.po $$lang.old.po; \
    240  1.1  christos 	  echo "$$lang:"; \
    241  1.1  christos 	  if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
    242  1.1  christos 	    rm -f $$lang.old.po; \
    243  1.1  christos 	  else \
    244  1.1  christos 	    echo "msgmerge for $$cat failed!"; \
    245  1.1  christos 	    rm -f $$lang.po; \
    246  1.1  christos 	    mv $$lang.old.po $$lang.po; \
    247  1.1  christos 	  fi; \
    248  1.1  christos 	done
    249  1.1  christos 
    250  1.1  christos SRC-POTFILES: SRC-POTFILES.in
    251  1.1  christos 	( if test 'x$(srcdir)' != 'x.'; then \
    252  1.1  christos 	    posrcprefix='$(top_srcdir)/'; \
    253  1.1  christos 	  else \
    254  1.1  christos 	    posrcprefix="../"; \
    255  1.1  christos 	  fi; \
    256  1.1  christos 	  rm -f $@-t $@ \
    257  1.1  christos 	    && (sed -e '/^#/d' \
    258  1.1  christos 	            -e '/^[ 	]*$$/d' \
    259  1.1  christos 		    -e "s@.*@	$$posrcprefix& \\\\@" < $(srcdir)/$@.in \
    260  1.1  christos 		| sed -e '$$s/\\$$//') > $@-t \
    261  1.1  christos 	    && chmod a-w $@-t \
    262  1.1  christos 	    && mv $@-t $@ )
    263  1.1  christos 
    264  1.1  christos BLD-POTFILES: BLD-POTFILES.in
    265  1.1  christos 	  ( rm -f $@-t $@ \
    266  1.1  christos 	    && (sed -e '/^#/d' \
    267  1.1  christos 	            -e '/^[ 	]*$$/d' \
    268  1.1  christos 		    -e "s@.*@	../& \\\\@" < $(srcdir)/$@.in \
    269  1.1  christos 		| sed -e '$$s/\\$$//') > $@-t \
    270  1.1  christos 	    && chmod a-w $@-t \
    271  1.1  christos 	    && mv $@-t $@ )
    272  1.1  christos 
    273  1.1  christos SRC-POTFILES.in: @MAINT@ ../Makefile
    274  1.1  christos 	cd .. && $(MAKE) po/SRC-POTFILES.in
    275  1.1  christos 
    276  1.1  christos BLD-POTFILES.in: @MAINT@ ../Makefile
    277  1.1  christos 	cd .. && $(MAKE) po/BLD-POTFILES.in
    278  1.1  christos 
    279  1.1  christos # Note - The presence of SRC-POTFILES and BLD-POTFILES as dependencies
    280  1.1  christos # here breaks the implementation of the 'distclean' rule for maintainers.
    281  1.1  christos # This is because if 'make distclean' is run in the BFD directory, the
    282  1.1  christos # Makefile there will be deleted before 'distclean' is made here, and so
    283  1.1  christos # the dependency SRC-POTFILES -> SRC-POTFILES.in -> ../Makefile cannot
    284  1.1  christos # be satisfied.
    285  1.1  christos #
    286  1.1  christos # The SRC-POTFILES and BLD-POTFILES dependencies cannot be removed,
    287  1.1  christos # however since it is necessary that these files be built during
    288  1.1  christos # *configure* time, so that configure can insert them into the
    289  1.1  christos # po/Makefile that it is creating, so that the Makefile will have
    290  1.1  christos # the correct dependencies.
    291  1.1  christos Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES
    292  1.1  christos 	cd .. \
    293  1.1  christos 	  && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
    294  1.1  christos 	     CONFIG_HEADERS= $(SHELL) ./config.status
    295  1.1  christos 
    296  1.1  christos # Tell versions [3.59,3.63) of GNU make not to export all variables.
    297  1.1  christos # Otherwise a system limit (for SysV at least) may be exceeded.
    298  1.1  christos .NOEXPORT:
    299