Use trunc module from gnulib instead of our home-grown solution.
[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         assert \
9         byteswap \
10         c-ctype \
11         c-strtod \
12         crypto/md4 \
13         dirname \
14         exit \
15         fpieee \
16         fprintf-posix \
17         full-read \
18         full-write \
19         fseeko \
20         fwriteerror \
21         gethostname \
22         getline \
23         getlogin_r \
24         getopt \
25         gettext-h \
26         gettimeofday \
27         intprops \
28         inttostr \
29         linebreak \
30         localcharset \
31         mbchar \
32         memcasecmp \
33         memchr \
34         memcmp \
35         memmem \
36         memmove \
37         mempcpy \
38         memset \
39         minmax \
40         mkstemp \
41         printf-posix \
42         printf-safe \
43         progname \
44         relocatable-prog \
45         snprintf \
46         snprintf-posix \
47         sprintf-posix \
48         stdarg \
49         stdbool \
50         stdint \
51         stpcpy \
52         strcase \
53         strcspn \
54         strerror \
55         strftime \
56         strsep \
57         strtod \
58         strtok_r \
59         strtol \
60         strtoul \
61         sys_stat \
62         tmpfile \
63         trunc \
64         unistd \
65         unlocked-io \
66         vasprintf-posix \
67         vfprintf-posix \
68         vprintf-posix \
69         vsnprintf \
70         vsnprintf-posix \
71         vsprintf-posix \
72         xalloc \
73         xalloc-die \
74         xmalloca \
75         xsize \
76         xstrndup \
77         xvasprintf
78
79 all: po/POTFILES.in
80         test -d m4 || mkdir m4
81         echo '*' > m4/.cvsignore
82         touch m4/Makefile.am
83         $(GNULIB_TOOL) --import --no-changelog --m4-base=gl/m4 \
84                 --source-base=gl --lib=libgl --tests-base=tests \
85                 --doc-base=gl/doc --import $(GNULIB_MODULES)
86         echo '*' > gl/.cvsignore
87         echo '*' > gl/m4/.cvsignore
88         libtoolize --force --automake
89         autopoint --force
90         aclocal -I m4 -I gl/m4
91         autoconf
92         autoheader
93         automake --add-missing --copy --no-force
94
95 gettextize:
96         test -d m4 || mkdir m4
97         touch m4/Makefile.am
98         gettextize --force --no-changelog
99
100 po/POTFILES.in:
101         for f in `find src \( -name \*.[qc] -o -name \*.glade \) ! -name .\* -print` ; do \
102                 if test $$f = src/libpspp/version.c; then continue; fi;   \
103                 if test -e `dirname $$f`/`basename $$f .c`.q ; then continue; fi; \
104                 echo $$f ; \
105         done | sort | uniq > $@.tmp
106         if test ! -e $@ || ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi
107         rm -f $@.tmp
108
109 check: all
110         rm -rf _check
111         mkdir _check
112         cd _check && ../configure $(CONFIGUREFLAGS)
113         cd _check && make distcheck
114         rm -rf _check
115
116 _build: all
117         test -d _build || mkdir _build
118         cd _build && ../configure $(CONFIGUREFLAGS)
119
120 _debug: all
121         test -d _debug || mkdir _debug
122         cd _debug && ../configure $(CONFIGUREFLAGS) --enable-debug
123
124 PO_FILES = po/ChangeLog po/Makefile po/Makefile.in po/Makefile.in.in    \
125 po/POTFILES po/POTFILES.in po/Rules-quot po/boldquot.sed                \
126 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
127 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
128 po/Makevars.template po/pspp.pot
129
130 clean:
131         rm -f config.sub config.guess config.rpath
132         rm -f ABOUT-NLS
133         rm -fr autom4te.cache
134         rm -f aclocal.m4
135         rm -f missing mkinstalldirs
136         rm -f install-sh
137         rm -f configure Makefile 
138         rm -f depcomp
139         rm -rf intl gl
140         rm -f m4/*.m4
141         rm -f $(PO_FILES) po/*.gmo 
142         rm -f mdate-sh texinfo.tex
143         rm -f doc/stamp-vti
144         rm -f config.h.in~
145         rm -f config.h.in
146         find . -name Makefile.in -exec rm -f {} \; 
147         rm -f compile
148         rm -f ltmain.sh
149         rm -f reloc-ldflags install-reloc
150
151 .PHONY: all gettextize potfiles clean