Use the select and pipe2 modules from gnulib
[pspp] / 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-snprintf \
11         c-strcase \
12         c-strcasestr \
13         c-ctype \
14         c-strtod \
15         c-xvasprintf \
16         clean-temp \
17         close \
18         configmake \
19         count-one-bits \
20         crc \
21         crypto/md4 \
22         crypto/md5 \
23         dirname \
24         dtoastr \
25         environ \
26         fatal-signal \
27         fcntl \
28         fpieee \
29         fprintf-posix \
30         full-read \
31         full-write \
32         fseeko \
33         ftello \
34         fwriteerror \
35         getline \
36         gettext \
37         gettimeofday \
38         getopt-gnu \
39         gitlog-to-changelog \
40         include_next \
41         isfinite \
42         isinf \
43         isnan \
44         intprops \
45         inttostr \
46         localcharset \
47         mbchar \
48         mbiter \
49         memcasecmp \
50         memchr \
51         memchr2 \
52         mempcpy \
53         memrchr \
54         minmax \
55         mkdtemp \
56         mkstemp \
57         pipe2 \
58         printf-posix \
59         printf-safe \
60         progname \
61         rawmemchr \
62         read-file \
63         regex \
64         relocatable-prog \
65         rename \
66         round \
67         select \
68         snprintf \
69         snprintf-posix \
70         sprintf-posix \
71         stdarg \
72         stdbool \
73         stdint \
74         stpcpy \
75         strerror \
76         strftime \
77         strtod \
78         strtok_r \
79         sys_stat \
80         tempname \
81         trunc \
82         unicase/u8-casecmp \
83         unicase/u8-casefold \
84         unicase/u8-tolower \
85         unicase/u8-toupper \
86         unictype/ctype-print \
87         unictype/category-of \
88         unigbrk/uc-is-grapheme-break \
89         unilbrk/u8-possible-linebreaks \
90         uninorm/nfkd \
91         unistd \
92         unistr/u8-check \
93         unistr/u8-cpy \
94         unistr/u8-mblen \
95         unistr/u8-mbtouc \
96         unistr/u8-mbtoucr \
97         unistr/u8-strlen \
98         unistr/u8-strmbtouc \
99         unistr/u8-strncat \
100         unistr/u8-uctomb \
101         uniwidth/u8-strwidth \
102         unitypes \
103         unlocked-io \
104         vasprintf-posix \
105         version-etc \
106         version-etc-fsf \
107         vfprintf-posix \
108         vprintf-posix \
109         vsnprintf \
110         vsnprintf-posix \
111         vsprintf-posix \
112         xalloc \
113         xalloc-die \
114         xmalloca \
115         xmemdup0 \
116         xsize \
117         xstrndup \
118         xvasprintf
119
120 all: prep_ph
121         $(MAKE) -f Smake Makefile.in configure
122
123 .PHONY: prep_ph
124 prep_ph: 
125         test -e ChangeLog || touch ChangeLog
126         test -d m4 || mkdir m4
127         touch m4/Makefile.am
128         $(GNULIB_TOOL) --add-import --no-changelog --m4-base=gl/m4 \
129                 --source-base=gl --lib=libgl --tests-base=tests \
130                 --doc-base=gl/doc --aux-dir=build-aux  \
131                 --libtool $(GNULIB_MODULES)
132         libtoolize --force --automake
133
134 aclocal.m4:
135         aclocal -I m4 -I gl/m4
136
137 configure: configure.ac aclocal.m4
138         autoconf
139
140 config.h.in: configure.ac
141         autoheader
142
143 Makefile.in: Makefile.am config.h.in aclocal.m4
144         automake --add-missing --copy --no-force --include-deps
145
146
147 gettextize:
148         test -d m4 || mkdir m4
149         touch m4/Makefile.am
150         gettextize --force --no-changelog
151
152 check: all
153         rm -rf _check
154         mkdir _check
155         cd _check && ../configure $(CONFIGUREFLAGS)
156         cd _check && make distcheck
157         rm -rf _check
158
159 _build: all
160         test -d _build || mkdir _build
161         cd _build && ../configure $(CONFIGUREFLAGS)
162
163 _debug: all
164         test -d _debug || mkdir _debug
165         cd _debug && ../configure $(CONFIGUREFLAGS) --enable-debug
166
167 PO_FILES = po/ChangeLog \
168 po/Rules-quot po/boldquot.sed           \
169 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
170 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
171 po/Makevars.template po/pspp.pot
172
173 clean:
174         rm -f config.sub config.guess config.rpath
175         rm -fr autom4te.cache
176         rm -f aclocal.m4
177         rm -f missing mkinstalldirs
178         rm -f install-sh
179         rm -f configure Makefile 
180         rm -f depcomp
181         rm -rf intl gl
182         rm -f m4/*.m4
183         rm -f $(PO_FILES) po/*.gmo 
184         rm -f mdate-sh texinfo.tex
185         rm -f doc/stamp-vti
186         rm -f config.h.in~
187         rm -f config.h.in
188         find . -name Makefile.in -exec rm -f {} \; 
189         rm -f compile
190         rm -f ltmain.sh
191         rm -f reloc-ldflags install-reloc
192
193 .PHONY: all gettextize clean