Use gnulib exit module.
[pspp-builds.git] / Smake
1 # -*- makefile -*-
2
3 # Adjust these to reflect where you've installed gnulib.
4 GNULIB = ../gnulib
5 GNULIB_TOOL = $(GNULIB)/gnulib-tool
6
7 GNULIB_MODULES = \
8         alloca \
9         alloca-opt \
10         assert \
11         c-ctype \
12         c-strtod \
13         exit \
14         full-read \
15         full-write \
16         gethostname \
17         getline \
18         getlogin_r \
19         getopt \
20         gettext \
21         intprops \
22         linebreak \
23         memcasecmp \
24         memchr \
25         memcmp \
26         memmem \
27         memmove \
28         memset \
29         progname \
30         readlink \
31         restrict \
32         snprintf \
33         stat-macros \
34         stdbool \
35         stdint \
36         stpcpy \
37         strcase \
38         strcspn \
39         strerror \
40         strftime \
41         strsep \
42         strstr \
43         strtod \
44         strtok_r \
45         strtol \
46         strtoul \
47         unistd \
48         vsnprintf \
49         xalloc \
50         xalloc-die \
51         xreadlink \
52         xvasprintf
53
54 all: po/POTFILES.in
55         test -d m4 || mkdir m4
56         touch m4/Makefile.am
57         $(GNULIB_TOOL) --import --no-changelog --m4-base=gl/m4 \
58                 --source-base=gl --lib=libgl --tests-base=tests \
59                 --import $(GNULIB_MODULES)
60         autoreconf --install
61
62 gettextize:
63         test -d m4 || mkdir m4
64         touch m4/Makefile.am
65         gettextize -f -c --intl --no-changelog
66
67 po/POTFILES.in:
68         for f in `find src -name \*.[qc] ! -name .\* -print \
69                   | sed 's/\.[qc]$$//'`; do \
70                 if test $$f = src/libpspp/version; then continue; fi;     \
71                 if test -e $$f.q; then echo $$f.q; else echo $$f.c; fi    \
72         done | sort | uniq > $@.tmp
73         if test ! -e $@ || ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi
74         rm -f $@.tmp
75
76 check: all
77         rm -rf _check
78         mkdir _check
79         cd _check && ../configure $(CONFIGUREFLAGS)
80         cd _check && make distcheck
81         rm -rf _check
82
83 _build: all
84         test -d _build || mkdir _build
85         cd _build && ../configure $(CONFIGUREFLAGS)
86
87 PO_FILES = po/ChangeLog po/Makefile po/Makefile.in po/Makefile.in.in    \
88 po/POTFILES po/POTFILES.in po/Rules-quot po/boldquot.sed                \
89 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
90 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
91 po/Makevars.template
92
93 clean:
94         rm -f config.sub config.guess config.rpath
95         rm -f ABOUT-NLS
96         rm -fr autom4te.cache
97         rm -f aclocal.m4
98         rm -f missing mkinstalldirs
99         rm -f install-sh
100         rm -f configure Makefile 
101         rm -f depcomp
102         rm -rf intl gl
103         rm -f m4/*.m4
104         rm -f $(PO_FILES)
105         rm -f mdate-sh texinfo.tex
106         rm -f doc/stamp-vti
107         rm -f config.h.in~
108         find . -name Makefile.in -exec rm -f {} \; 
109         rm -f compile
110
111 .PHONY: all gettextize potfiles clean