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