Smake: Add `check' target for convenience. Add --tests-base=tests to
[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 --tests-base=tests \
17                 --import $(GNULIB_MODULES)
18         autoreconf --install
19
20 gettextize:
21         test -d m4 || mkdir m4
22         touch m4/Makefile.am
23         gettextize -f -c --intl --no-changelog
24
25 po/POTFILES.in:
26         for f in `find src -name \*.[qc] -print | sed 's/\.[qc]$$//'`; do \
27                 if test $$f = src/version.c; then break; fi;              \
28                 if test -e $$f.q; then echo $$f.q; else echo $$f.c; fi    \
29         done | sort | uniq > $@.tmp
30         if test ! -e $@ || ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi
31         rm -f $@.tmp
32
33 check: all
34         rm -rf _check
35         mkdir _check
36         cd _check && ../configure $(CONFIGUREFLAGS)
37         cd _check && make distcheck
38         rm -rf _check
39
40 PO_FILES = po/ChangeLog po/Makefile po/Makefile.in po/Makefile.in.in    \
41 po/POTFILES po/POTFILES.in po/Rules-quot po/boldquot.sed                \
42 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
43 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
44 po/Makevars.template
45
46 clean:
47         rm -f config.sub config.guess config.rpath
48         rm -f ABOUT-NLS
49         rm -fr autom4te.cache
50         rm -f aclocal.m4
51         rm -f missing mkinstalldirs
52         rm -f install-sh
53         rm -f configure Makefile Makefile.in
54         rm -f depcomp
55         rm -fr intl gl
56         rm -f m4/*.m4
57         rm -f $(PO_FILES)
58
59 .PHONY: all gettextize potfiles clean