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