Commit 758a80c5 758a80c5696e5f7716f59e00077ea2bc6742b61b by Sam Roberts

Patches from Sergey to make the auto* stuff work, now uses lex/yacc

portably, and puts all the necessary files into the distribution.
1 parent 77037aee
1 CFLAGS = -Wall -pedantic -g -DTESTING 1 CFLAGS = -Wall -pedantic -g -DTESTING
2 INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/lib 2 INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/lib
3 YLWRAP = $(SHELL) $(srcdir)/ylwrap
4 YFLAGS = -d
5
6 BUILT_SOURCES=sieve-gram.c sieve-gram.h \
7 sieve-lex.c addr-lex.c \
8 addr.c addr.h
3 9
4 MOSTLYCLEANFILES= 10 MOSTLYCLEANFILES=
5 CLEANFILES= 11 CLEANFILES=
6 DISTCLEANFILES= 12 DISTCLEANFILES=
7 MAINTAINERCLEANFILES=\ 13 MAINTAINERCLEANFILES=$(BUILT_SOURCES)
8 sieve-gram.c sieve-gram.h \ 14 EXTRA_DIST = $(BUILT_SOURCES)
9 sieve-lex.c \
10 addr-lex.c \
11 addr.c addr.h
12 15
13 bin_PROGRAMS = test sieve 16 bin_PROGRAMS = sieve
14 17
15 SRC = \ 18 SRC = \
16 addr-lex.c \ 19 addr-lex.c \
...@@ -30,40 +33,51 @@ SRC = \ ...@@ -30,40 +33,51 @@ SRC = \
30 util.c \ 33 util.c \
31 xmalloc.c 34 xmalloc.c
32 35
33 test_DEPENDENCIES = 36 HDR = \
34 test_LDADD = 37 comparator.h \
35 test_SOURCES = \ 38 exitcodes.h \
36 test.c \ 39 hmac-md5.h \
37 ${SRC} 40 imparse.h \
38 41 interp.h \
42 md5.h \
43 md5global.h \
44 message.h \
45 parseaddr.h \
46 script.h \
47 sieve_err.h \
48 sieve_interface.h \
49 svfield.h \
50 sysexits.h \
51 tree.h \
52 util.h \
53 xmalloc.h
39 54
40 sieve_DEPENDENCIES = ../mailbox/libmailbox.la 55 sieve_DEPENDENCIES = ../mailbox/libmailbox.la
41 sieve_LDADD = ../mailbox/libmailbox.la ../lib/libmailutils.a 56 sieve_LDADD = ../mailbox/libmailbox.la ../lib/libmailutils.a
42 sieve_SOURCES = \ 57 sieve_SOURCES = \
43 sieve.c \ 58 sieve.c \
44 ${SRC} 59 ${SRC} $(HDR)
45
46 YACC = bison -y
47 YFLAGS = -d
48 LEX = flex
49 60
50 addr-lex.c: addr-lex.l addr.h 61 addr-lex.c: $(srcdir)/addr-lex.l addr.h
51 $(LEX) -t -Paddr addr-lex.l > $@ 62 $(YLWRAP) "$(LEX)" $(srcdir)/addr-lex.l lex.yy.c \
63 addr-lex.c -- -yy addr
52 64
53 addr.c addr.h: addr.y 65 addr.c addr.h: $(srcdir)/addr.y
54 $(YACC) $(YFLAGS) -p addr addr.y 66 $(YLWRAP) "$(YACC) $(YFLAGS)" $(srcdir)/addr.y \
55 mv -f y.tab.c addr.c 67 y.tab.c addr.c y.tab.h addr.h \
56 mv -f y.tab.h addr.h 68 -- -yy addr
57 69
58 sieve-lex.c: sieve-lex.l sieve-gram.h 70 sieve-lex.c: $(srcdir)/sieve-lex.l sieve-gram.h
59 $(LEX) -t sieve-lex.l > $@ 71 $(YLWRAP) "$(LEX)" $(srcdir)/sieve-lex.l lex.yy.c sieve-lex.c
60 72
61 sieve-gram.c sieve-gram.h: sieve-gram.y 73 sieve-gram.c sieve-gram.h: $(srcdir)/sieve-gram.y
62 $(YACC) $(YFLAGS) sieve-gram.y 74 $(YLWRAP) "$(YACC) $(YFLAGS)" $(srcdir)/sieve-gram.y \
63 mv -f y.tab.c sieve-gram.c 75 y.tab.c sieve-gram.c y.tab.h sieve-gram.h
64 mv -f y.tab.h sieve-gram.h
65 76
66 comparator.o: sieve-gram.h 77 comparator.o: sieve-gram.h
67 script.o: sieve-gram.h 78 script.o: sieve-gram.h
68 tree.o: sieve-gram.h 79 tree.o: sieve-gram.h
69 80
81 empty: clean
82 rm -f $(BUILT_SOURCES)
83
......