]> git.draconx.ca Git - cdecl99.git/blob - Makefile.am
Rename libcdecl.c to parse-decl.c
[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_'
13 libcdecl_la_SOURCES = src/scan.c src/parse.c src/parse-decl.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
23 # These are required to prevent the builtin lex/yacc rules from
24 # superseding ours...
25 src/scan.c src/scan.h: src/scan.stamp
26 src/parse.c src/parse.h: src/parse.stamp
27
28 # Supporting rules for bison/flex.
29
30 BISON_V   = $(BISON_V_$(V))
31 BISON_V_  = $(BISON_V_$(AM_DEFAULT_VERBOSITY))
32 BISON_V_0 = @echo "  BISON " $<;
33
34 FLEX_V   = $(FLEX_V_$(V))
35 FLEX_V_  = $(FLEX_V_$(AM_DEFAULT_VERBOSITY))
36 FLEX_V_0 = @echo "  FLEX  " $<;
37
38 .y.c: ;
39 .l.c: ;
40
41 .y.stamp:
42         $(AM_V_at) touch $@.tmp
43         $(BISON_V) $(BISON) -o $*.c --defines=$*.h.tmp $(BISONFLAGS) $<
44         $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
45                 rm -f $*.h.tmp; \
46         else \
47                 mv -f $*.h.tmp $*.h; \
48         fi
49         $(AM_V_at) mv -f $@.tmp $@
50
51 .l.stamp:
52         $(AM_V_at) touch $@.tmp
53         $(FLEX_V) $(FLEX) -o $*.c --header-file=$*.h.tmp $(FLEXFLAGS) $<
54         $(AM_V_at) if cmp $*.h.tmp $*.h >/dev/null 2>&1; then \
55                 rm -f $*.h.tmp; \
56         else \
57                 mv -f $*.h.tmp $*.h; \
58         fi
59         $(AM_V_at) mv -f $@.tmp $@
60
61 .stamp.c:
62         @if test -f $@; then :; else \
63                 rm -f $<; \
64                 $(MAKE) $(AM_MAKEFLAGS) $<; \
65         fi
66
67 .stamp.h:
68         @if test -f $@; then :; else \
69                 rm -f $<; \
70                 $(MAKE) $(AM_MAKEFLAGS) $<; \
71         fi