# This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. srcdir= . prefix= exec_prefix= ${prefix} datarootdir= ${prefix}/share localedir= ${datarootdir}/locale CC= cc CFLAGS= -fno-common CPPFLAGS= -I. -DSHAREDIR=\"${prefix}/share\" -DLOCALEDIR=\"$(localedir)\" LDFLAGS= LIBM= -lm LIBS= -lintl CATALOGS= de.mo en_GB.mo nl.mo all: diction style all-po-yes all-po-no: all-po-yes: $(CATALOGS) diction: diction.o sentence.o misc.o getopt.o getopt1.o $(CC) -o $@ $(LDFLAGS) diction.o sentence.o misc.o \ getopt.o getopt1.o $(LIBS) style: style.o sentence.o misc.o getopt.o getopt1.o $(CC) -o $@ $(LDFLAGS) style.o sentence.o misc.o \ getopt.o getopt1.o $(LIBM) $(LIBS) check: diction for i in $(srcdir)/test/test*; do $$i || break; done install: all [ -d $(DESTDIR)${exec_prefix}/bin ] || /usr/bin/install -c -o root -g wheel -m 755 -d $(DESTDIR)${exec_prefix}/bin /usr/bin/install -c -o root -g wheel diction $(DESTDIR)${exec_prefix}/bin/diction /usr/bin/install -c -o root -g wheel style $(DESTDIR)${exec_prefix}/bin/style /usr/bin/install -c -o root -g wheel -m 755 -d $(DESTDIR)${prefix}/share/diction /usr/bin/install -c -o root -g wheel -m 644 $(srcdir)/de $(DESTDIR)${prefix}/share/diction/de /usr/bin/install -c -o root -g wheel -m 644 $(srcdir)/en $(DESTDIR)${prefix}/share/diction/en (cd $(DESTDIR)${prefix}/share/diction; rm -f C; ln en C) /usr/bin/install -c -o root -g wheel -m 644 $(srcdir)/en_GB $(DESTDIR)${prefix}/share/diction/en_GB /usr/bin/install -c -o root -g wheel -m 644 $(srcdir)/nl $(DESTDIR)${prefix}/share/diction/nl [ -d $(DESTDIR)${datarootdir}/man/man1 ] || /usr/bin/install -c -o root -g wheel -m 755 -d $(DESTDIR)${datarootdir}/man/man1 /usr/bin/install -c -o root -g wheel -m 644 diction.1 $(DESTDIR)${datarootdir}/man/man1/diction.1 /usr/bin/install -c -o root -g wheel -m 644 style.1 $(DESTDIR)${datarootdir}/man/man1/style.1 make install-po-yes install-po-no: install-po-yes: $(CATALOGS) for cat in $(CATALOGS); do \ dir=$(localedir)/`basename $$cat .mo`/LC_MESSAGES; \ [ -d $(DESTDIR)$$dir ] || /usr/bin/install -c -o root -g wheel -m 755 -d $(DESTDIR)$$dir; \ /usr/bin/install -c -o root -g wheel -m 644 $$cat $(DESTDIR)$$dir/diction.mo; \ done .c.o: $(CC) -c $(CPPFLAGS) $(CFLAGS) $< .SUFFIXES: .po .mo .po.mo: msgfmt -o $@ $< $(CATALOGS:.mo=.po): diction.pot for cat in $@; do \ [ -f $$cat ] || cp $(srcdir)/$$cat .; \ if msgmerge $$cat diction.pot -o $$cat.tmp; then \ mv -f $$cat.tmp $$cat; \ cmp -s $$cat $(srcdir)/$$cat || \ cp $$cat $(srcdir)/$$cat; \ else \ echo "msgmerge for $$cat failed!"; \ rm -f $$cat.tmp; \ exit 1; \ fi; \ done diction.pot: $(srcdir)/*.c (objdir=`pwd`; cd $(srcdir); \ xgettext --add-comments --keyword=_ \ --output=$$objdir/messages.po *.c ) test -f messages.po && mv messages.po $@ # The sources have changed -- update diction.pot in srcdir as well. cmp $@ $(srcdir)/$@ || cp $@ $(srcdir)/$@ diction.html: diction.texi makeinfo --html diction.texi diction.info: diction.texi makeinfo diction.texi #{{{script}}}#{{{ clean clean: rm -f *.out core *.o *.mo diction.html diction.info #}}} #{{{ distclean distclean: clean rm -f diction style config.cache config.h config.log config.status configure.lineno Makefile diction.1 diction.texi style.1 test/rundiction rm -rf autom4te.cache #}}} #{{{ tar tar: distclean (b=`pwd`; b=`basename $$b`; cd ..; tar zcvf $$b.tar.gz $$b/COPYING $$b/INSTALL $$b/Makefile.in $$b/README $$b/NEWS $$b/configure $$b/install-sh $$b/de $$b/en $$b/en_GB $$b/nl $$b/test $$b/[a-z]*.*) #}}} #{{{ dependencies diction.o: diction.c config.h getopt.h misc.h sentence.h getopt.o: getopt.c getopt.h getopt_int.h getopt1.o: getopt1.c getopt.h getopt_int.h misc.o: misc.c config.h misc.h sentence.o: sentence.c config.h misc.h sentence.h style.o: style.c config.h getopt.h misc.h sentence.h #}}}