Clean up output subsystem.
[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         alloca \
9         alloca-opt \
10         assert \
11         c-ctype \
12         c-strtod \
13         full-read \
14         full-write \
15         gethostname \
16         getline \
17         getlogin_r \
18         getopt \
19         gettext \
20         intprops \
21         memcasecmp \
22         memchr \
23         memcmp \
24         memmem \
25         memmove \
26         memset \
27         progname \
28         readlink \
29         restrict \
30         snprintf \
31         stat-macros \
32         stdbool \
33         stpcpy \
34         strcase \
35         strcspn \
36         strerror \
37         strftime \
38         strsep \
39         strstr \
40         strtod \
41         strtok_r \
42         strtol \
43         strtoul \
44         unistd \
45         vsnprintf \
46         xalloc \
47         xalloc-die \
48         xreadlink \
49         xvasprintf
50
51 all: po/POTFILES.in
52         test -d m4 || mkdir m4
53         touch m4/Makefile.am
54         $(GNULIB_TOOL) --import --no-changelog --m4-base=gl/m4 \
55                 --source-base=gl --lib=libgl --tests-base=tests \
56                 --import $(GNULIB_MODULES)
57         autoreconf --install
58
59 gettextize:
60         test -d m4 || mkdir m4
61         touch m4/Makefile.am
62         gettextize -f -c --intl --no-changelog
63
64 po/POTFILES.in:
65         for f in `find src -name \*.[qc] ! -name .\* -print \
66                   | sed 's/\.[qc]$$//'`; do \
67                 if test $$f = src/libpspp/version.c; then break; fi;              \
68                 if test -e $$f.q; then echo $$f.q; else echo $$f.c; fi    \
69         done | sort | uniq > $@.tmp
70         if test ! -e $@ || ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi
71         rm -f $@.tmp
72
73 check: all
74         rm -rf _check
75         mkdir _check
76         cd _check && ../configure $(CONFIGUREFLAGS)
77         cd _check && make distcheck
78         rm -rf _check
79
80 _build: all
81         test -d _build || mkdir _build
82         cd _build && ../configure $(CONFIGUREFLAGS)
83
84 PO_FILES = po/ChangeLog po/Makefile po/Makefile.in po/Makefile.in.in    \
85 po/POTFILES po/POTFILES.in po/Rules-quot po/boldquot.sed                \
86 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
87 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
88 po/Makevars.template
89
90 clean:
91         rm -f config.sub config.guess config.rpath
92         rm -f ABOUT-NLS
93         rm -fr autom4te.cache
94         rm -f aclocal.m4
95         rm -f missing mkinstalldirs
96         rm -f install-sh
97         rm -f configure Makefile 
98         rm -f depcomp
99         rm -rf intl gl
100         rm -f m4/*.m4
101         rm -f $(PO_FILES)
102         rm -f mdate-sh texinfo.tex
103         rm -f doc/stamp-vti
104         rm -f config.h.in~
105         find . -name Makefile.in -exec rm -f {} \; 
106         rm -f compile
107
108 .PHONY: all gettextize potfiles clean