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