]> andersk Git - splint.git/blame - src/Makefile.am
Work around for the MaxSet(c) >= sizeof c -1 simplification.
[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; \
914641fc 128 -$(MV) Headers/signature_gen.h Headers/signature_gen.bak; \
8fe44445 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; \
914641fc 141 -$(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak; \
8fe44445 142 $(CAT) bison.head cgrammar.tab.h bison.reset >Headers/cgrammar_tokens.h; \
143 $(RM) cgrammar.tab.c cgrammar.tab.h; \
144 fi
145
914641fc 146## 10/16/001 drl added copy so that the file mtgrammar.c.der is created
147## also removed the dependency for this file on mtgrammary.c
148
149Headers/mtgrammar_tokens.h mtgrammar.c: mtgrammar.y
8fe44445 150 if test x$(BISON) = xno; then \
151 $(CP) mtgrammar.c.der mtgrammar.c; \
152 else \
153 $(BISON) $(YFLAGS) -p mt mtgrammar.y; \
154 $(CAT) bison.head mtgrammar.tab.c bison.reset >mtgrammar.c; \
e12110be 155 $(CP) mtgrammar.c mtgrammar.c.der; \
914641fc 156 -$(MV) Headers/mtgrammar_tokens.h Headers/mtgrammar_tokens.bak; \
8fe44445 157 $(CAT) bison.head mtgrammar.tab.h bison.reset >Headers/mtgrammar_tokens.h; \
158 $(RM) mtgrammar.tab.c mtgrammar.tab.h; \
159 fi
160
161Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der llgrammar.y
162 if test x$(BISON) = xno; then \
163 $(CP) llgrammar.c.der llgrammar.c; \
164 else \
165 echo '* Expect 2 shift/reduce conflicts'; \
166 $(BISON) $(YFLAGS) -p yl llgrammar.y; \
167 $(CAT) bison.head llgrammar.tab.c bison.reset >llgrammar.c; \
914641fc 168 -$(MV) Headers/llgrammar_gen2.h Headers/llgrammar_gen2.bak; \
8fe44445 169 $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen2.h; \
914641fc 170 0$(MV) Headers/llgrammar_gen.h Headers/llgrammar_gen.bak; \
8fe44445 171 $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen.h; \
172 $(RM) llgrammar.tab.c llgrammar.tab.h; \
173 fi
174
175cscanner.c: cscanner.l
176 $(LEX) $(LFLAGS) cscanner.l
177 $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset > cscanner.c
178
179Headers/flag_codes.gen: flags.def
180 grep "FLG_" flags.def > Headers/flag_codes.gen
181
182## Checking rules
183
184CHECKS = $(subst .c,.check,$(lclint_SOURCES))
185
186## Other rules
187
188.PHONY: nocheck
189nocheck:
190 $(MAKE) CHECK=0
191
a469ccf0 192.PHONY: test
193test:
53a89507 194 cd ../test; ${MAKE} --no-print-directory
a469ccf0 195
196### Automake generates wrong tags
197.PHONY: etags
198etags:
199 maketags
200
8fe44445 201lintnew:
202 ./lclint -f lclint.lclintrc $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(ALLSRC) $(LCLSRC) -dump lclint \
203 +forcehints -misplacedsharequal +showsourceloc -unrecogcomments \
204 -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw
205
e5f31c00 206lintbuffercheck:
207 ./lclint -f lclint.lclintrc $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(ALLSRC) $(LCLSRC) -dump lclint \
208 +forcehints -misplacedsharequal +showsourceloc -unrecogcomments \
e5508969 209 -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +arraybounds +arrayboundsread
e5f31c00 210
8fe44445 211
212
213.PHONY: purify
214purify: $(lclint_OBJECTS)
215 purify $(LINK) -o lclint$(EXEEXT) $^ $(lclint_LDADD)
216
53a89507 217all: lclint$(EXEEXT)
218CLEANFILES = lclint$(EXEEXT)
This page took 0.076181 seconds and 5 git commands to generate.