summaryrefslogtreecommitdiff
blob: f697f94e4502daaaf0d984496644a1a4a48654cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
https://github.com/nondeterministic/mailfilter/commit/4b3991b1334d83d5f209723ab3ec58d168baff2d

https://bugs.gentoo.org/649514

--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,15 +31,11 @@ bin_PROGRAMS = mailfilter
 rcfile.cc: rcfile.ll rcparser.hh
 	   $(LEX) $(AM_LFLAGS) -Prc -o$@ $<
 
-# The final `touch' is necessary to be able to invoke flex/bison more
-# than once and to not confuse the ../ylwrap script.
-rcparser.hh: y.tab.c
-y.tab.c: rcfile.yy
-	   $(YACC) -p rc $(YFLAGS) -o$@ $<;   \
-	   mv -f y.tab.c rcparser.cc;         \
-	   mv -f y.tab.h rcparser.hh;         \
-	   $(CXXCOMPILE) -c rcparser.cc;      \
-	   touch y.tab.c
+rcparser.hh: rcparser.cc
+rcparser.cc: rcfile.yy
+		   $(YACC) $(YFLAGS) -b rc -p rc $<;  \
+		   mv rc.tab.c rcparser.cc; \
+		   mv rc.tab.h rcparser.hh
 
 # Almost the same as above, but this time for the RFC 822 parser:
 rfc822.cc: rfc822.ll rfc822parser.hh
@@ -47,58 +43,41 @@ rfc822.cc: rfc822.ll rfc822parser.hh
 
 rfc822parser.hh: rfc822parser.cc
 rfc822parser.cc: rfc822.yy
-		   $(YACC) $(YFLAGS) -p rfc -o$@ $<;  \
-		   $(CXXCOMPILE) -c rfc822parser.cc;  \
-		   touch y.tab.c
+		   $(YACC) $(YFLAGS) -b rfc -p rfc $<;  \
+		   mv rfc.tab.c rfc822parser.cc; \
+		   mv rfc.tab.h rfc822parser.hh
 
-# This thing is a workaround to avoid compile errors.
-# We always re-generate the source from the flex/bison input, so it
-# always matches the installed versions and does not lead to errors.
-CLEANFILES = rcfile.cc rcparser.hh rcparser.cc y.tab.c ylwrap    \
-             rfc822parser.output rfc822parser.cc rfc822parser.hh \
-	     rfc822.cc y.output
-
-nodist_mailfilter_SOURCES = rcfile.cc rcparser.hh y.tab.c rfc822.cc
-
-nodist_mailfilter_OBJECTS = y.tab.$(OBJEXT)
-
-# Looks like automake still wants to distribute rcfile.cc, even if it
-# is in nodist_*_sources.
-dist-hook:
-	rm -f $(distdir)/rcfile.cc                              \
-	      $(distdir)/rfc822parser.cc                        \
-	      $(distdir)/rfcparser.cc
+CLEANFILES = *.output
 
 # If this gets updated, remember to update the doxygen.in config file!
-mailfilter_SOURCES =	md5c.c md5.h                            \
-			defines.hh                              \
-			rcfile.ll rcfile.hh                     \
-			rfc822.ll                               \
-			mailfilter.hh mailfilter.cc             \
-			header.hh header.cc                     \
-			weeder.hh weeder.cc                     \
-			preferences.hh preferences.cc           \
-			feedback.hh feedback.cc                 \
-			filter.hh filter.cc                     \
-			score.hh score.cc                       \
-			account.hh account.cc                   \
-			protocol.hh protocol.cc                 \
-			connection.hh                           \
-			socket.hh socket.cc                     \
-			pop3.hh pop3.cc                         \
-			apop.hh apop.cc                         \
+mailfilter_SOURCES =	md5c.c md5.h                              \
+			defines.hh                                \
+			rcfile.ll rcfile.hh                       \
+			rcparser.hh rcparser.cc                   \
+			rfc822.ll rfc822parser.hh rfc822parser.cc \
+			mailfilter.hh mailfilter.cc               \
+			header.hh header.cc                       \
+			weeder.hh weeder.cc                       \
+			preferences.hh preferences.cc             \
+			feedback.hh feedback.cc                   \
+			filter.hh filter.cc                       \
+			score.hh score.cc                         \
+			account.hh account.cc                     \
+			protocol.hh protocol.cc                   \
+			connection.hh                             \
+			socket.hh socket.cc                       \
+			pop3.hh pop3.cc                           \
+			apop.hh apop.cc                           \
 			imap.hh imap.cc
 
 if !GETOPT
 mailfilter_SOURCES += getopt.c getopt1.c getopt.h
 endif
 
-mailfilter_LDADD = rcparser.o rfc822parser.o
-
-INCLUDES = -I$(includedir)                                      \
-	-I$(srcdir) -I$(top_srcdir)/include -I$(top_srcdir)     \
-	-DLOCALEDIR=\"$(datadir)/locale\"                       \
-	-I$(top_srcdir)/intl                                    \
-	-I$(top_builddir) -I$(top_builddir)/include -I.
+AM_CPPFLAGS = -I$(includedir)                                     \
+	      -I$(srcdir) -I$(top_srcdir)/include -I$(top_srcdir) \
+	      -DLOCALEDIR=\"$(datadir)/locale\"                   \
+	      -I$(top_srcdir)/intl                                \
+	      -I$(top_builddir) -I$(top_builddir)/include -I.
 
 LIBS = @LEXLIB@ @LIBS@