]> git.draconx.ca Git - cdecl99.git/blob - Makefile.am
Add note about old-style function declarations to the manual.
[cdecl99.git] / Makefile.am
1 # Copyright © 2011 Nick Bowler
2 #
3 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 # This is free software: you are free to do what the fuck you want to.
5 # There is NO WARRANTY, to the extent permitted by law.
6
7 ACLOCAL_AMFLAGS = -I m4
8 AUTOMAKE_OPTIONS = nostdinc
9
10 # For Gnulib
11 MOSTLYCLEANFILES =
12 noinst_LTLIBRARIES =
13
14 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src \
15         -I$(top_builddir)/lib -I$(top_srcdir)/lib \
16         -I$(top_builddir) -I$(top_srcdir) \
17         -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \
18         -DLOCALEDIR=\"$(localedir)\"
19
20 MAINTAINERCLEANFILES = src/scan.c src/scan.h src/scan.stamp \
21         src/parse.c src/parse.h src/parse.stamp
22
23 CLEANFILES = src/validtypes.h src/errtab.h
24
25 EXTRA_DIST = m4/gnulib-cache.m4 src/types.lst src/validtypes.sed \
26         src/errors.lst src/strtab.sed \
27         src/parse.stamp src/scan.stamp \
28         COPYING.WTFPL2
29
30 dist_man_MANS = doc/man/cdecl99.1 doc/man/libcdecl.3
31
32 include_HEADERS = src/cdecl.h
33 noinst_HEADERS = src/typemap.h src/output.h src/scan.h src/parse.h src/i18n.h \
34         src/error.h
35
36 noinst_DATA = $(MOFILES)
37
38 lib_LTLIBRARIES = libcdecl.la
39 libcdecl_la_LDFLAGS = -no-undefined \
40         -export-symbols-regex '^cdecl_[[:lower:]]'
41 libcdecl_la_SOURCES = src/scan.c src/parse.c src/parse-decl.c src/typemap.c \
42         src/output.c src/explain.c src/declare.c src/i18n.c src/error.c \
43         src/normalize.c
44 libcdecl_la_LIBADD = libgnu.la $(LTLIBINTL) $(LTLIBTHREAD)
45 $(libcdecl_la_OBJECTS): $(gnulib_headers)
46
47 bin_PROGRAMS = cdecl99
48 cdecl99_SOURCES = src/cdecl99.c
49 cdecl99_LDADD = libcdecl.la libgnu.la $(LTLIBINTL) $(LTLIBREADLINE)
50 $(cdecl99_OBJECTS): $(gnulib_headers)
51
52 src/parse.lo: src/scan.h
53 src/scan.lo: src/parse.h
54 src/parse-decl.lo: src/scan.h src/parse.h
55 src/typemap.lo: src/validtypes.h
56 src/error.lo: src/errtab.h
57 src/normalize.lo: src/ordspecs.h
58 src/output.lo: src/namespecs.h
59
60 src/validtypes.h: $(srcdir)/src/types.lst $(srcdir)/src/validtypes.sed
61         $(AM_V_GEN)sed -f $(srcdir)/src/validtypes.sed \
62                 < $(srcdir)/src/types.lst > $@.tmp
63         $(AM_V_at)mv -f $@.tmp $@
64
65 src/namespecs.h: $(srcdir)/src/specs.lst $(srcdir)/src/namespecs.sed
66         $(AM_V_GEN) sed -f $(srcdir)/src/namespecs.sed \
67                 < $(srcdir)/src/specs.lst > $@.tmp
68         $(AM_V_at) mv -f $@.tmp $@
69
70 src/ordspecs.h: $(srcdir)/src/specs.lst $(srcdir)/src/ordspecs.sed
71         $(AM_V_GEN) sed -f $(srcdir)/src/ordspecs.sed \
72                 < $(srcdir)/src/specs.lst > $@.tmp
73         $(AM_V_at) mv -f $@.tmp $@
74
75 src/errtab.h: $(srcdir)/src/errors.lst $(srcdir)/src/strtab.sed
76         $(AM_V_GEN)sed -f $(srcdir)/src/strtab.sed \
77                 < $(srcdir)/src/errors.lst > $@.tmp
78         $(AM_V_at)mv -f $@.tmp $@
79
80 # Supporting rules for gettext.
81 ALL_MOFILES = $(POFILES:.po=.mo)
82 EXTRA_DIST += po/$(PACKAGE).pot po/LINGUAS $(POFILES) $(ALL_MOFILES)
83 MAINTAINERCLEANFILES += po/$(PACKAGE).pot $(ALL_MOFILES)
84 XGETTEXT_OPTS = -D $(builddir) -D $(srcdir) --from-code=utf-8 \
85         --add-comments=TRANSLATORS: --foreign-user \
86         --package-name=$(PACKAGE) --package-version=$(PACKAGE_VERSION) \
87         --msgid-bugs-address=$(PACKAGE_BUGREPORT) \
88         --keyword=_ --keyword=N_ --keyword=PN_:1c,2
89
90 po/$(PACKAGE).pot: $(SOURCES) src/errors.lst
91         $(AM_V_at)  $(MKDIR_P) $(@D)
92         $(AM_V_GEN) $(XGETTEXT) $(XGETTEXT_OPTS) -o $@.tmp $(SOURCES)
93         $(AM_V_at)  $(XGETTEXT) $(XGETTEXT_OPTS) --omit-header -Lc \
94                 -ajo $@.tmp src/errors.lst
95         $(AM_V_at)  mv -f $@.tmp $@
96
97 .po.mo:
98         $(AM_V_at)$(MKDIR_P) $(@D)
99         $(AM_V_GEN)$(MSGFMT) -c -o $@ $<
100
101 install-data-local: install-mo
102 install-mo: $(MOFILES)
103         for mo in $?; do \
104                 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
105                 test x"$$lang" = x"" && exit 1; \
106                 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
107                 (set -x; $(MKDIR_P) "$$inst") \
108                         || exit $$?; \
109                 (set -x; $(INSTALL_DATA) "$$mo" "$$inst/$(PACKAGE).mo") \
110                         || exit $$?; \
111         done
112
113 installdirs-local: installdirs-mo
114 installdirs-mo:
115         for mo in $(MOFILES); do \
116                 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
117                 test x"$$lang" = x"" && exit 1; \
118                 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
119                 (set -x; $(MKDIR_P) "$$inst") || exit $$?; \
120         done
121
122 uninstall-local: uninstall-mo
123 uninstall-mo:
124         for mo in $(ALL_MOFILES); do \
125                 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
126                 test x"$$lang" = x"" && exit 1; \
127                 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
128                 (set -x; cd "$$inst" && rm -f '$(PACKAGE).mo'); \
129         done
130
131 .PHONY: install-mo installdirs-mo uninstall-mo
132
133 # These are required to prevent the builtin lex/yacc rules from
134 # superseding ours...
135 src/scan.c src/scan.h: src/scan.stamp
136 src/parse.c src/parse.h: src/parse.stamp
137
138 # The flex/bison rules refrain from updating unchanged headers for the
139 # convenience of developers, but the headers must be distributed with
140 # up-to-date timestamps, otherwise make will try to update them in a fresh
141 # VPATH build.
142 dist-hook: update-headers
143 update-headers:
144         touch -c '$(distdir)/src/scan.h'
145         touch -c '$(distdir)/src/parse.h'
146
147 # Supporting rules for bison/flex.
148
149 BISON_V   = $(BISON_V_$(V))
150 BISON_V_  = $(BISON_V_$(AM_DEFAULT_VERBOSITY))
151 BISON_V_0 = @echo "  BISON " $<;
152
153 FLEX_V   = $(FLEX_V_$(V))
154 FLEX_V_  = $(FLEX_V_$(AM_DEFAULT_VERBOSITY))
155 FLEX_V_0 = @echo "  FLEX  " $<;
156
157 .y.c: ;
158 .l.c: ;
159
160 .y.stamp:
161         $(AM_V_at) touch $@.tmp
162         $(BISON_V) $(BISON) -o $*.c --defines=$*.h.tmp $(BISONFLAGS) $<
163         $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
164                 rm -f $*.h.tmp; \
165         else \
166                 mv -f $*.h.tmp $*.h; \
167         fi
168         $(AM_V_at) mv -f $@.tmp $@
169
170 .l.stamp:
171         $(AM_V_at) touch $@.tmp
172         $(FLEX_V) $(FLEX) -o $*.c --header-file=$*.h.tmp $(FLEXFLAGS) $<
173         $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
174                 rm -f $*.h.tmp; \
175         else \
176                 mv -f $*.h.tmp $*.h; \
177         fi
178         $(AM_V_at) mv -f $@.tmp $@
179
180 .stamp.c:
181         @if test -f $@; then :; else \
182                 rm -f $<; \
183                 $(MAKE) $(AM_MAKEFLAGS) $<; \
184         fi
185
186 .stamp.h:
187         @if test -f $@; then :; else \
188                 rm -f $<; \
189                 $(MAKE) $(AM_MAKEFLAGS) $<; \
190         fi
191
192 include $(top_srcdir)/lib/gnulib.mk
193 include $(top_srcdir)/glconfig.mk