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