]> git.draconx.ca Git - cdecl99.git/blob - Makefile.am
Move typemap stuff into a separate file.
[cdecl99.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2
3 MAINTAINERCLEANFILES = src/scan.c src/scan.h src/scan.stamp \
4         src/parse.c src/parse.h src/parse.stamp
5
6 EXTRA_DIST = src/parse.stamp src/scan.stamp
7
8 include_HEADERS = src/cdecl.h
9 noinst_HEADERS = src/scan.h src/parse.h
10
11 lib_LTLIBRARIES = libcdecl.la
12 libcdecl_la_LDFLAGS = -export-symbols-regex '^cdecl_[[:lower:]]'
13 libcdecl_la_SOURCES = src/scan.c src/parse.c src/parse-decl.c src/typemap.c
14
15 bin_PROGRAMS = cdecl99
16 cdecl99_SOURCES = src/cdecl99.c
17 cdecl99_LDADD = libcdecl.la
18
19 src/parse.lo: src/scan.h
20 src/scan.lo: src/parse.h
21 src/parse-decl.lo: src/scan.h src/parse.h
22 src/typemap.lo: src/validtypes.h
23
24 src/validtypes.h: src/validtypes.in $(srcdir)/src/validtypes.sed
25         $(AM_V_GEN)sed -f $(srcdir)/src/validtypes.sed \
26                 < src/validtypes.in > $@.tmp
27         $(AM_V_at)mv -f $@.tmp $@
28
29 # These are required to prevent the builtin lex/yacc rules from
30 # superseding ours...
31 src/scan.c src/scan.h: src/scan.stamp
32 src/parse.c src/parse.h: src/parse.stamp
33
34 # Supporting rules for bison/flex.
35
36 BISON_V   = $(BISON_V_$(V))
37 BISON_V_  = $(BISON_V_$(AM_DEFAULT_VERBOSITY))
38 BISON_V_0 = @echo "  BISON " $<;
39
40 FLEX_V   = $(FLEX_V_$(V))
41 FLEX_V_  = $(FLEX_V_$(AM_DEFAULT_VERBOSITY))
42 FLEX_V_0 = @echo "  FLEX  " $<;
43
44 .y.c: ;
45 .l.c: ;
46
47 .y.stamp:
48         $(AM_V_at) touch $@.tmp
49         $(BISON_V) $(BISON) -o $*.c --defines=$*.h.tmp $(BISONFLAGS) $<
50         $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
51                 rm -f $*.h.tmp; \
52         else \
53                 mv -f $*.h.tmp $*.h; \
54         fi
55         $(AM_V_at) mv -f $@.tmp $@
56
57 .l.stamp:
58         $(AM_V_at) touch $@.tmp
59         $(FLEX_V) $(FLEX) -o $*.c --header-file=$*.h.tmp $(FLEXFLAGS) $<
60         $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
61                 rm -f $*.h.tmp; \
62         else \
63                 mv -f $*.h.tmp $*.h; \
64         fi
65         $(AM_V_at) mv -f $@.tmp $@
66
67 .stamp.c:
68         @if test -f $@; then :; else \
69                 rm -f $<; \
70                 $(MAKE) $(AM_MAKEFLAGS) $<; \
71         fi
72
73 .stamp.h:
74         @if test -f $@; then :; else \
75                 rm -f $<; \
76                 $(MAKE) $(AM_MAKEFLAGS) $<; \
77         fi