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