Make-in 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. # Makefile for program source directory in GNU NLS utilities package.
  2. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
  3. # Copyright (C) 2003-2015 Free Software Foundation, Inc.
  4. #
  5. # This file may be copied and used freely without restrictions. It can
  6. # be used in projects which are not available under the GNU Public License
  7. # but which still want to provide support for the GNU gettext functionality.
  8. # Please note that the actual code is *not* freely available.
  9. PACKAGE = @PACKAGE@
  10. VERSION = @VERSION@
  11. SHELL = /bin/sh
  12. @SET_MAKE@
  13. srcdir = @srcdir@
  14. top_srcdir = @top_srcdir@
  15. VPATH = @srcdir@
  16. top_builddir = @top_builddir@
  17. prefix = @prefix@
  18. exec_prefix = @exec_prefix@
  19. datadir = $(prefix)/@DATADIRNAME@
  20. localedir = $(datadir)/locale
  21. gnulocaledir = $(prefix)/share/locale
  22. gettextsrcdir = $(prefix)/share/gettext/po
  23. subdir = po
  24. DESTDIR =
  25. INSTALL = @INSTALL@
  26. INSTALL_DATA = @INSTALL_DATA@
  27. MKINSTALLDIRS = @MKINSTALLDIRS@
  28. CC = @CC@
  29. GENCAT = @GENCAT@
  30. GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
  31. MSGFMT = @MSGFMT@
  32. XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
  33. MSGMERGE = PATH=../src:$$PATH msgmerge
  34. DEFS = @DEFS@
  35. CFLAGS = @CFLAGS@
  36. CPPFLAGS = @CPPFLAGS@
  37. INCLUDES = -I.. -I$(top_srcdir)/intl
  38. COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
  39. SOURCES = cat-id-tbl.c
  40. POFILES = @POFILES@
  41. GMOFILES = @GMOFILES@
  42. DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
  43. stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
  44. POTFILES = \
  45. CATALOGS = @CATALOGS@
  46. CATOBJEXT = @CATOBJEXT@
  47. INSTOBJEXT = @INSTOBJEXT@
  48. .SUFFIXES:
  49. .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
  50. .c.o:
  51. $(COMPILE) $<
  52. .po.pox:
  53. $(MAKE) $(PACKAGE).pot
  54. $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
  55. .po.mo:
  56. $(MSGFMT) -o $@ $<
  57. .po.gmo:
  58. file=`echo $* | sed 's,.*/,,'`.gmo \
  59. && rm -f $$file && $(GMSGFMT) -o $$file $<
  60. .po.cat:
  61. sed -f ../intl/po2msg.sed < $< > $*.msg \
  62. && rm -f $@ && $(GENCAT) $@ $*.msg
  63. all: all-@USE_NLS@
  64. all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
  65. all-no:
  66. $(srcdir)/$(PACKAGE).pot: $(POTFILES)
  67. $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
  68. --add-comments -C --keyword=_ --keyword=N_ \
  69. --msgid-bugs-address=bug-binutils@gnu.org \
  70. --files-from=$(srcdir)/POTFILES.in
  71. rm -f $(srcdir)/$(PACKAGE).pot
  72. mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
  73. $(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
  74. $(srcdir)/stamp-cat-id: $(PACKAGE).pot
  75. rm -f cat-id-tbl.tmp
  76. sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
  77. | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
  78. if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
  79. rm cat-id-tbl.tmp; \
  80. else \
  81. echo cat-id-tbl.c changed; \
  82. rm -f $(srcdir)/cat-id-tbl.c; \
  83. mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
  84. fi
  85. cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
  86. install: install-exec install-data
  87. install-exec:
  88. install-info:
  89. install-html:
  90. install-pdf:
  91. install-data: install-data-@USE_NLS@
  92. install-data-no: all
  93. install-data-yes: all
  94. if test -r $(MKINSTALLDIRS); then \
  95. $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
  96. else \
  97. $(top_srcdir)/../mkinstalldirs $(DESTDIR)$(datadir); \
  98. fi
  99. @catalogs='$(CATALOGS)'; \
  100. for cat in $$catalogs; do \
  101. cat=`basename $$cat`; \
  102. case "$$cat" in \
  103. *.gmo) destdir=$(gnulocaledir);; \
  104. *) destdir=$(localedir);; \
  105. esac; \
  106. lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
  107. dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
  108. if test -r $(MKINSTALLDIRS); then \
  109. $(MKINSTALLDIRS) $$dir; \
  110. else \
  111. $(top_srcdir)/mkinstalldirs $$dir; \
  112. fi; \
  113. if test -r $$cat; then \
  114. $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
  115. echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
  116. else \
  117. $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
  118. echo "installing $(srcdir)/$$cat as" \
  119. "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
  120. fi; \
  121. if test -r $$cat.m; then \
  122. $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
  123. echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
  124. else \
  125. if test -r $(srcdir)/$$cat.m ; then \
  126. $(INSTALL_DATA) $(srcdir)/$$cat.m \
  127. $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
  128. echo "installing $(srcdir)/$$cat as" \
  129. "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
  130. else \
  131. true; \
  132. fi; \
  133. fi; \
  134. done
  135. if test "$(PACKAGE)" = "gettext"; then \
  136. if test -r $(MKINSTALLDIRS); then \
  137. $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
  138. else \
  139. $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
  140. fi; \
  141. $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
  142. $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
  143. else \
  144. : ; \
  145. fi
  146. # Define this as empty until I found a useful application.
  147. installcheck:
  148. uninstall:
  149. catalogs='$(CATALOGS)'; \
  150. for cat in $$catalogs; do \
  151. cat=`basename $$cat`; \
  152. lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
  153. rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
  154. rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
  155. rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
  156. rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
  157. done
  158. rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
  159. check: all
  160. cat-id-tbl.o: ../intl/libgettext.h
  161. html dvi pdf ps info tags TAGS ID:
  162. mostlyclean:
  163. rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
  164. rm -fr *.o
  165. clean: mostlyclean
  166. distclean: clean
  167. rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
  168. maintainer-clean: distclean
  169. @echo "This command is intended for maintainers to use;"
  170. @echo "it deletes files that may require special tools to rebuild."
  171. rm -f $(GMOFILES)
  172. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
  173. dist distdir: update-po $(DISTFILES)
  174. dists="$(DISTFILES)"; \
  175. for file in $$dists; do \
  176. ln $(srcdir)/$$file $(distdir) 2> /dev/null \
  177. || cp -p $(srcdir)/$$file $(distdir); \
  178. done
  179. update-po: Makefile
  180. $(MAKE) $(PACKAGE).pot
  181. PATH=`pwd`/../src:$$PATH; \
  182. cd $(srcdir); \
  183. catalogs='$(CATALOGS)'; \
  184. for cat in $$catalogs; do \
  185. cat=`basename $$cat`; \
  186. lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
  187. mv $$lang.po $$lang.old.po; \
  188. echo "$$lang:"; \
  189. if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
  190. rm -f $$lang.old.po; \
  191. else \
  192. echo "msgmerge for $$cat failed!"; \
  193. rm -f $$lang.po; \
  194. mv $$lang.old.po $$lang.po; \
  195. fi; \
  196. done
  197. POTFILES: POTFILES.in
  198. ( if test 'x$(srcdir)' != 'x.'; then \
  199. posrcprefix='$(top_srcdir)/'; \
  200. else \
  201. posrcprefix="../"; \
  202. fi; \
  203. rm -f $@-t $@ \
  204. && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
  205. -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
  206. | sed -e '$$s/\\$$//') > $@-t \
  207. && chmod a-w $@-t \
  208. && mv $@-t $@ )
  209. POTFILES.in: @MAINT@ ../Makefile
  210. cd .. && $(MAKE) po/POTFILES.in
  211. Makefile: Make-in ../config.status POTFILES
  212. cd .. \
  213. && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
  214. CONFIG_HEADERS= $(SHELL) ./config.status
  215. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  216. # Otherwise a system limit (for SysV at least) may be exceeded.
  217. .NOEXPORT: