]> andersk Git - splint.git/blame - src/Makefile.am
Updated build to use automake files created by Tim Van Holder.
[splint.git] / src / Makefile.am
CommitLineData
8fe44445 1## Note: starting comments with ## means they don't end up in Makefile
2
3AUTOMAKE_OPTIONS = 1.5 foreign
4
5SUFFIXES = .h .c .o .l .check
6
7# Check files before compiling; requires lclint!
8CHECK = 1
9
10# Some preferences
11YFLAGS = -v -t -d --debug
12
13## Non-built files we need to distribute
14EXTRA_DIST = DATE
15
16## We only build LCLint
17bin_PROGRAMS = lclint
18
19## This is a fake program, so we can easily substitute in the extra LCL objects
20EXTRA_PROGRAMS = lcl
21
22AM_CPPFLAGS = -IHeaders
23
24## The main sources
25
26SETSRC = globSet.c intSet.c typeIdSet.c guardSet.c usymIdSet.c sRefSet.c
27
28LISTSRC = clauseStack.c filelocStack.c \
29 cstringList.c cstringSList.c sRefSetList.c ctypeList.c \
30 enumNameList.c enumNameSList.c exprNodeList.c exprNodeSList.c \
31 uentryList.c fileIdList.c filelocList.c qualList.c sRefList.c \
32 flagMarkerList.c idDeclList.c flagSpec.c
33
34CPPSRC = cppmain.c cpplib.c cppexp.c cpphash.c cpperror.c
35
36CSRC = uentry.c cprim.c macrocache.c qual.c qtype.c stateClause.c \
37 stateClauseList.c ctype.c cvar.c clabstract.c idDecl.c clause.c \
38 globalsClause.c modifiesClause.c warnClause.c functionClause.c \
39 functionClauseList.c metaStateConstraint.c metaStateConstraintList.c \
40 metaStateExpression.c metaStateSpecifier.c functionConstraint.c
41
42LCLINTSRC = exprNode.c exprChecks.c llmain.c
43CHECKSRC = structNames.c transferChecks.c varKinds.c nameChecks.c
44
45GLOBSRC = context.c globals.c flags.c general.c osd.c reader.c
46
47GRAMSRC = cgrammar.c cscanner.c mtscanner.c mtreader.c mtgrammar.c
48
49OVERFLOWCHSRC = constraintGeneration.c constraintTerm.c \
50 constraintExprData.c constraintExpr.c constraint.c \
51 constraintList.c constraintResolve.c \
52 constraintOutput.c loopHeuristics.c
53
54GENERALSRC = exprData.c cstring.c fileloc.c message.c inputStream.c \
55 fileTable.c cstringTable.c valueTable.c stateValue.c \
56 llerror.c messageLog.c flagMarker.c aliasTable.c ynm.c \
57 sRefTable.c genericTable.c ekind.c usymtab.c multiVal.c \
58 lltok.c sRef.c lcllib.c randomNumbers.c fileLib.c
59
60METASTATESRC = stateInfo.c stateCombinationTable.c metaStateTable.c \
61 metaStateInfo.c annotationTable.c annotationInfo.c mttok.c \
62 mtDeclarationNode.c mtDeclarationPieces.c mtDeclarationPiece.c \
63 mtContextNode.c mtValuesNode.c mtDefaultsNode.c \
64 mtAnnotationsNode.c mtMergeNode.c mtAnnotationList.c \
65 mtAnnotationDecl.c mtTransferClauseList.c mtTransferClause.c \
66 mtTransferAction.c mtLoseReferenceList.c mtLoseReference.c \
67 mtDefaultsDeclList.c mtDefaultsDecl.c mtMergeItem.c \
68 mtMergeClause.c mtMergeClauseList.c
69
70## These are only used if LCL is enabled
71
72LCLONLYSRC = usymtab_interface.c abstract.c ltoken.c lclscanline.c \
73 lclsyntable.c lcltokentable.c sort.c symtable.c lclinit.c \
74 shift.c lclscan.c lsymbol.c mapping.c
75
76LSLSRC = tokentable.c scan.c scanline.c lslparse.c \
77 lh.c checking.c lclctypes.c imports.c lslinit.c syntable.c
78
79LCLGRAMSRC = llgrammar.c signature.c
80
81LCLSETSRC = lsymbolSet.c sigNodeSet.c lslOpSet.c sortSet.c
82
83LCLLISTSRC = initDeclNodeList.c sortList.c declaratorInvNodeList.c \
84 interfaceNodeList.c sortSetList.c declaratorNodeList.c \
85 letDeclNodeList.c stDeclNodeList.c storeRefNodeList.c \
86 lslOpList.c lsymbolList.c termNodeList.c ltokenList.c \
87 traitRefNodeList.c pairNodeList.c typeNameNodeList.c \
88 fcnNodeList.c paramNodeList.c programNodeList.c \
89 varDeclarationNodeList.c varNodeList.c quantifierNodeList.c \
90 replaceNodeList.c importNodeList.c
91
92COMMONSRC = $(OVERFLOWCHSRC) $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \
93 $(GLOBSRC) $(IFACESRC) $(LISTSRC) $(SETSRC) $(METASTATESRC)
94
95ALLSRC = $(GRAMSRC) $(COMMONSRC) $(LCLINTSRC)
96
97LCLSRC = $(LCLSETSRC) $(LCLLISTSRC) $(LSLSRC) $(CMNSRC) $(LCLONLYSRC) \
98 $(LCLGRAMSRC)
99
100lcl_SOURCES = $(LCLSRC)
101
102lclint_SOURCES = $(ALLSRC)
103lclint_LDADD = $(LCLOBJ) @LEXLIB@
104
105# Ensure the LCL objects get built if needed
106lclint_DEPENDENCIES = $(LCLOBJ)
107
108# Keep it fake
109.PHONY: lcl$(EXEEXT)
110lcl$(EXEEXT):
111 @echo "This is a fake target"; \
112 echo "Use configure's --with-lcl option to enable lcl"
113
114## Sources that need to be built
115BUILT_SOURCES = Headers/signature_gen.h Headers/cgrammar_tokens.h \
116 Headers/llgrammar_gen.h Headers/llgrammar_gen2.h \
117 Headers/mtgrammar_tokens.h signature.c cgrammar.c \
118 llgrammar.c mtgrammar.c Headers/flag_codes.gen
119
120## Grammars
121
122Headers/signature_gen.h signature.c: signature.c.der signature.y
123 if test x$(BISON) = xno; then \
124 $(CP) signature.c.der signature.c; \
125 else \
126 $(BISON) $(YFLAGS) -p lsl signature.y; \
127 $(CAT) bison.head signature.tab.c bison.reset >signature.c; \
128 $(MV) Headers/signature_gen.h Headers/signature_gen.bak; \
129 $(CAT) bison.head signature.tab.h bison.reset >Headers/signature_gen.h; \
130 $(RM) signature.tab.c signature.tab.h; \
131 fi
132
133Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y
134 if test x$(BISON) = xno; then \
135 $(CP) cgrammar.c.der cgrammar.c; \
136 else \
137 echo '* Expect 141 shift/reduce conflicts and 111 reduce/reduce conflicts.'; \
138 echo '* (see cgrammar.y for explanation)'; \
139 $(BISON) $(YFLAGS) cgrammar.y; \
140 $(CAT) bison.head cgrammar.tab.c bison.reset >cgrammar.c; \
141 $(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak; \
142 $(CAT) bison.head cgrammar.tab.h bison.reset >Headers/cgrammar_tokens.h; \
143 $(RM) cgrammar.tab.c cgrammar.tab.h; \
144 fi
145
146Headers/mtgrammar_tokens.h mtgrammar.c: mtgrammar.c.der mtgrammar.y
147 if test x$(BISON) = xno; then \
148 $(CP) mtgrammar.c.der mtgrammar.c; \
149 else \
150 $(BISON) $(YFLAGS) -p mt mtgrammar.y; \
151 $(CAT) bison.head mtgrammar.tab.c bison.reset >mtgrammar.c; \
152 $(MV) Headers/mtgrammar_tokens.h Headers/mtgrammar_tokens.bak; \
153 $(CAT) bison.head mtgrammar.tab.h bison.reset >Headers/mtgrammar_tokens.h; \
154 $(RM) mtgrammar.tab.c mtgrammar.tab.h; \
155 fi
156
157Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der llgrammar.y
158 if test x$(BISON) = xno; then \
159 $(CP) llgrammar.c.der llgrammar.c; \
160 else \
161 echo '* Expect 2 shift/reduce conflicts'; \
162 $(BISON) $(YFLAGS) -p yl llgrammar.y; \
163 $(CAT) bison.head llgrammar.tab.c bison.reset >llgrammar.c; \
164 $(MV) Headers/llgrammar_gen2.h Headers/llgrammar_gen2.bak; \
165 $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen2.h; \
166 $(MV) Headers/llgrammar_gen.h Headers/llgrammar_gen.bak; \
167 $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen.h; \
168 $(RM) llgrammar.tab.c llgrammar.tab.h; \
169 fi
170
171cscanner.c: cscanner.l
172 $(LEX) $(LFLAGS) cscanner.l
173 $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset > cscanner.c
174
175Headers/flag_codes.gen: flags.def
176 grep "FLG_" flags.def > Headers/flag_codes.gen
177
178## Checking rules
179
180CHECKS = $(subst .c,.check,$(lclint_SOURCES))
181
182## Other rules
183
184.PHONY: nocheck
185nocheck:
186 $(MAKE) CHECK=0
187
188lintnew:
189 ./lclint -f lclint.lclintrc $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(ALLSRC) $(LCLSRC) -dump lclint \
190 +forcehints -misplacedsharequal +showsourceloc -unrecogcomments \
191 -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw
192
193
194
195.PHONY: purify
196purify: $(lclint_OBJECTS)
197 purify $(LINK) -o lclint$(EXEEXT) $^ $(lclint_LDADD)
198
199## This ensures that lclint can be run from ../bin
200## $(CP) was $(Ln_S) but that doesn't work for me...
201
202all: $(top_builddir)/bin/lclint$(EXEEXT)
203$(top_builddir)/bin/lclint$(EXEEXT): lclint$(EXEEXT)
204 $(CP) $< $@
205
206CLEANFILES = $(top_builddir)/bin/lclint$(EXEEXT)
This page took 0.50513 seconds and 5 git commands to generate.