Fix gnulib problems.
[pspp-builds.git] / Smake
1 # -*- makefile -*-
2
3 GNULIB = ../gnulib
4 GNULIB_TOOL = $(GNULIB)/gnulib-tool
5
6 GNULIB_MODULES = alloca alloca-opt assert full-read full-write          \
7 gethostname getline getlogin_r getopt gettext memchr memcmp memmem      \
8 memmove memset progname readlink restrict snprintf stat-macros stdbool  \
9 stpcpy strcase strcspn strerror strftime strstr strtod strtok_r strtol  \
10 strtoul vsnprintf xalloc xalloc-die xreadlink
11
12 all: po/POTFILES.in
13         test -d m4 || mkdir m4
14         touch m4/Makefile.am
15         $(GNULIB_TOOL) --import --no-changelog --m4-base=gl/m4 \
16                 --source-base=gl --lib=libgl --import $(GNULIB_MODULES)
17         autoreconf --install
18
19 gettextize:
20         test -d m4 || mkdir m4
21         touch m4/Makefile.am
22         gettextize -f -c --intl --no-changelog
23
24 po/POTFILES.in:
25         for f in `find src -name \*.[qc] -print | sed 's/\.[qc]$$//'`; do \
26                 if test $$f = src/version.c; then break; fi;              \
27                 if test -e $$f.q; then echo $$f.q; else echo $$f.c; fi    \
28         done | sort | uniq > $@.tmp
29         if test ! -e $@ || ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi
30         rm -f $@.tmp
31
32 PO_FILES = po/ChangeLog po/Makefile po/Makefile.in po/Makefile.in.in    \
33 po/POTFILES po/POTFILES.in po/Rules-quot po/boldquot.sed                \
34 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
35 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
36 po/Makevars.template
37
38 clean:
39         rm -f config.sub config.guess config.rpath
40         rm -f ABOUT-NLS
41         rm -fr autom4te.cache
42         rm -f aclocal.m4
43         rm -f missing mkinstalldirs
44         rm -f install-sh
45         rm -f configure Makefile Makefile.in
46         rm -f depcomp
47         rm -fr intl gl
48         rm -f m4/*.m4
49         rm -f $(PO_FILES)
50
51 .PHONY: all gettextize potfiles clean