]>
Commit | Line | Data |
---|---|---|
87fa79e5 | 1 | #\r |
2 | # splint Makefile for GNU Make on OS/2 systems\r | |
3 | #\r | |
4 | # Derived from original Unix makefile by Herbert\r | |
5 | #\r | |
6 | \r | |
7 | SHELL = /usr/bin/ksh\r | |
8 | \r | |
9 | include ../os2/make.vars\r | |
10 | binDir = ../bin\r | |
11 | \r | |
12 | \r | |
13 | .SUFFIXES = \r | |
14 | .SUFFIXES = .c .h $O $(EXEEXT) .l .check\r | |
15 | \r | |
16 | # Some preferences\r | |
17 | ### We use the no-lines option to prevent confusion with splint flag settings.\r | |
18 | ### Should fix splint to avoid this...\r | |
19 | YFLAGS = -v -t -d --debug --no-lines\r | |
20 | LFLAGS = -L\r | |
21 | \r | |
22 | BISON_SRC = cgrammar.y llgrammar.y mtgrammar.y signature.y\r | |
23 | \r | |
24 | \r | |
25 | ## We only build Splint\r | |
26 | bin_PROGRAMS = splint$(EXEEXT)\r | |
27 | \r | |
28 | ## This is a fake program, so we can easily substitute in the extra LCL objects\r | |
29 | EXTRA_PROGRAMS = lcl\r | |
30 | \r | |
31 | AM_CPPFLAGS = -IHeaders\r | |
32 | \r | |
33 | ## The main sources\r | |
34 | \r | |
35 | SETSRC = globSet.c intSet.c typeIdSet.c guardSet.c usymIdSet.c sRefSet.c\r | |
36 | \r | |
37 | LISTSRC = clauseStack.c filelocStack.c \\r | |
38 | cstringList.c cstringSList.c sRefSetList.c ctypeList.c \\r | |
39 | enumNameList.c enumNameSList.c exprNodeList.c exprNodeSList.c \\r | |
40 | uentryList.c fileIdList.c filelocList.c qualList.c sRefList.c \\r | |
41 | flagMarkerList.c idDeclList.c flagSpec.c\r | |
42 | \r | |
43 | CPPSRC = cppmain.c cpplib.c cppexp.c cpphash.c cpperror.c\r | |
44 | \r | |
6ee276d2 | 45 | CSRC = context.c uentry.c cprim.c macrocache.c qual.c qtype.c stateClause.c \\r |
87fa79e5 | 46 | stateClauseList.c ctype.c cvar.c clabstract.c idDecl.c clause.c \\r |
47 | globalsClause.c modifiesClause.c warnClause.c functionClause.c \\r | |
48 | functionClauseList.c metaStateConstraint.c metaStateConstraintList.c \\r | |
149b00db | 49 | metaStateExpression.c metaStateSpecifier.c functionConstraint.c \\r |
6ee276d2 | 50 | pointers.c cscannerHelp.c \r |
87fa79e5 | 51 | \r |
149b00db | 52 | SPLINTSRC = exprNode.c exprChecks.c llmain.c help.c rcfiles.c\r |
87fa79e5 | 53 | CHECKSRC = structNames.c transferChecks.c varKinds.c nameChecks.c\r |
54 | \r | |
6ee276d2 | 55 | GLOBSRC = globals.c flags.c general.c osd.c reader.c mtreader.c\r |
87fa79e5 | 56 | \r |
57 | GRAMSRC = cgrammar.c cscanner.c mtscanner.c mtgrammar.c llgrammar.c signature.c\r | |
58 | \r | |
6ee276d2 | 59 | OVERFLOWCHSRC = constraintList.c constraintResolve.c \\r |
60 | constraintGeneration.c constraintTerm.c \\r | |
87fa79e5 | 61 | constraintExprData.c constraintExpr.c constraint.c \\r |
6ee276d2 | 62 | loopHeuristics.c \r |
87fa79e5 | 63 | \r |
64 | GENERALSRC = exprData.c cstring.c fileloc.c message.c inputStream.c \\r | |
65 | fileTable.c cstringTable.c valueTable.c stateValue.c \\r | |
66 | llerror.c messageLog.c flagMarker.c aliasTable.c ynm.c \\r | |
67 | sRefTable.c genericTable.c ekind.c usymtab.c multiVal.c \\r | |
68 | lltok.c sRef.c lcllib.c randomNumbers.c fileLib.c\r | |
69 | \r | |
70 | METASTATESRC = stateInfo.c stateCombinationTable.c metaStateTable.c \\r | |
71 | metaStateInfo.c annotationTable.c annotationInfo.c mttok.c \\r | |
72 | mtDeclarationNode.c mtDeclarationPieces.c mtDeclarationPiece.c \\r | |
73 | mtContextNode.c mtValuesNode.c mtDefaultsNode.c \\r | |
74 | mtAnnotationsNode.c mtMergeNode.c mtAnnotationList.c \\r | |
75 | mtAnnotationDecl.c mtTransferClauseList.c mtTransferClause.c \\r | |
76 | mtTransferAction.c mtLoseReferenceList.c mtLoseReference.c \\r | |
77 | mtDefaultsDeclList.c mtDefaultsDecl.c mtMergeItem.c \\r | |
78 | mtMergeClause.c mtMergeClauseList.c\r | |
79 | \r | |
80 | ## These are only used if LCL is enabled\r | |
81 | \r | |
82 | LCLONLYSRC = usymtab_interface.c abstract.c ltoken.c lclscanline.c \\r | |
83 | lclsyntable.c lcltokentable.c sort.c symtable.c lclinit.c \\r | |
84 | shift.c lclscan.c lsymbol.c mapping.c\r | |
85 | \r | |
86 | LSLSRC = tokentable.c scan.c scanline.c lslparse.c \\r | |
87 | lh.c checking.c lclctypes.c imports.c lslinit.c syntable.c \r | |
88 | \r | |
89 | LCLSETSRC = lsymbolSet.c sigNodeSet.c lslOpSet.c sortSet.c\r | |
90 | \r | |
91 | LCLLISTSRC = initDeclNodeList.c sortList.c declaratorInvNodeList.c \\r | |
92 | interfaceNodeList.c sortSetList.c declaratorNodeList.c \\r | |
93 | letDeclNodeList.c stDeclNodeList.c storeRefNodeList.c \\r | |
94 | lslOpList.c lsymbolList.c termNodeList.c ltokenList.c \\r | |
95 | traitRefNodeList.c pairNodeList.c typeNameNodeList.c \\r | |
96 | fcnNodeList.c paramNodeList.c programNodeList.c \\r | |
97 | varDeclarationNodeList.c varNodeList.c quantifierNodeList.c \\r | |
98 | replaceNodeList.c importNodeList.c\r | |
99 | \r | |
100 | IFILES = ctbase.i cttable.i exprDataQuite.i\r | |
101 | \r | |
87fa79e5 | 102 | #Files that are used on systems that do not have bison or yacc\r |
103 | DER_BISON_FILES = signature.c.der cgrammar.c.der mtgrammar.c.der \\r | |
104 | llgrammar.c.der \r | |
105 | DER_FILES = $(DER_BISON_FILES)\r | |
106 | \r | |
107 | \r | |
6ee276d2 | 108 | COMMONSRC = $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \\r |
109 | $(GLOBSRC) $(LISTSRC) $(SETSRC) $(METASTATESRC)\r | |
110 | \r | |
111 | LCLSRC = $(LCLSETSRC) $(LCLLISTSRC) $(LSLSRC) $(COMMONSRC) $(LCLONLYSRC) \r | |
87fa79e5 | 112 | \r |
6ee276d2 | 113 | ALLSRC = $(GRAMSRC) $(SPLINTSRC) $(OVERFLOWCHSRC) $(LCLSRC) snprintf.c\r |
87fa79e5 | 114 | \r |
115 | #files to run Splint on\r | |
6ee276d2 | 116 | LINTSRC = $(COMMONSRC) $(SPLINTSRC)\r |
87fa79e5 | 117 | \r |
87fa79e5 | 118 | lcl_SOURCES = $(LCLSRC)\r |
119 | CONFIG_HEADER = $(top_builddir)/config.h\r | |
120 | \r | |
121 | splint_SOURCES = $(ALLSRC)\r | |
6ee276d2 | 122 | splint_OBJECTS = $(splint_SOURCES:.c=$O)\r |
87fa79e5 | 123 | \r |
124 | # Keep it fake\r | |
125 | .PHONY: lcl$(EXEEXT)\r | |
126 | \r | |
127 | DEFS = -DHAVE_CONFIG_H\r | |
128 | DEFAULT_INCLUDES = -I. -I..\r | |
87fa79e5 | 129 | \r |
130 | ## Sources that need to be built\r | |
131 | BUILT_SOURCES = Headers/signature_gen.h Headers/cgrammar_tokens.h \\r | |
132 | Headers/llgrammar_gen.h Headers/llgrammar_gen2.h \\r | |
133 | Headers/mtgrammar_tokens.h signature.c cgrammar.c \\r | |
134 | llgrammar.c mtgrammar.c Headers/flag_codes.gen \\r | |
135 | $(DER_FILES)\r | |
136 | \r | |
137 | all: $(BUILT_SOURCES) splint$(EXEEXT) $(binDir)/splint$(EXEEXT)\r | |
138 | \r | |
139 | Headers/signature_gen.h signature.c: signature.c.der signature.y\r | |
140 | ifndef BISON\r | |
141 | $(CP) signature.c.der signature.c\r | |
142 | else \r | |
143 | echo "Making signature.c"\r | |
144 | $(BISON) $(YFLAGS) -p lsl signature.y\r | |
145 | $(CAT) bison.head signature.tab.c bison.reset >signature.c\r | |
146 | $(CP) signature.c signature.c.der\r | |
147 | -$(MV) Headers/signature_gen.h Headers/signature_gen.bak\r | |
148 | $(CAT) bison.head signature.tab.h bison.reset >Headers/signature_gen.h\r | |
149 | $(RM) signature.tab.c signature.tab.h\r | |
150 | endif\r | |
151 | \r | |
152 | ## 11/29/001 drl added copy so that the file cgrammar.c.der is created\r | |
153 | \r | |
154 | Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y\r | |
155 | ifndef BISON\r | |
156 | $(CP) cgrammar.c.der cgrammar.c\r | |
157 | else \r | |
158 | @echo "Making cgrammar.c"\r | |
159 | @echo "Expect 141 shift/reduce conflicts and 111 reduce/reduce conflicts."\r | |
160 | @echo "(see cgrammar.y for explanation)"\r | |
161 | $(BISON) $(YFLAGS) cgrammar.y\r | |
6ee276d2 | 162 | $(CAT) bison.head cgrammar.tab.c bison.reset >cgrammar.c\r |
87fa79e5 | 163 | $(CP) cgrammar.c cgrammar.c.der\r |
164 | -$(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak\r | |
6ee276d2 | 165 | $(CAT) bison.head cgrammar.tab.h bison.reset >Headers/cgrammar_tokens.h\r |
87fa79e5 | 166 | $(RM) cgrammar.tab.c cgrammar.tab.h\r |
167 | endif\r | |
168 | \r | |
169 | ## 10/16/001 drl added copy so that the file mtgrammar.c.der is created\r | |
170 | ## also removed the dependency for this file on mtgrammary.c \r | |
171 | \r | |
172 | Headers/mtgrammar_tokens.h mtgrammar.c: mtgrammar.y\r | |
173 | ifndef BISON\r | |
174 | $(CP) mtgrammar.c.der mtgrammar.c\r | |
175 | else \r | |
176 | @echo "Making mtgrammar.c"\r | |
177 | @echo "Expect 11 shift/reduce conflicts."\r | |
178 | $(BISON) $(YFLAGS) -p mt mtgrammar.y\r | |
179 | $(CAT) bison.head mtgrammar.tab.c bison.reset >mtgrammar.c\r | |
180 | $(CP) mtgrammar.c mtgrammar.c.der\r | |
181 | -$(MV) Headers/mtgrammar_tokens.h Headers/mtgrammar_tokens.bak\r | |
182 | $(CAT) bison.head mtgrammar.tab.h bison.reset >Headers/mtgrammar_tokens.h\r | |
183 | $(RM) mtgrammar.tab.c mtgrammar.tab.h\r | |
184 | endif\r | |
185 | \r | |
186 | Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der llgrammar.y\r | |
187 | ifndef BISON\r | |
188 | $(CP) llgrammar.c.der llgrammar.c\r | |
189 | else \r | |
190 | @echo "Making llgrammar.c"\r | |
191 | @echo "Expect 2 shift/reduce conflicts"\r | |
192 | $(BISON) $(YFLAGS) -p yl llgrammar.y\r | |
193 | $(CAT) bison.head llgrammar.tab.c bison.reset >llgrammar.c\r | |
194 | $(CP) llgrammar.c llgrammar.c.der\r | |
195 | -$(MV) Headers/llgrammar_gen2.h Headers/llgrammar_gen2.bak\r | |
196 | -$(MV) Headers/llgrammar_gen.h Headers/llgrammar_gen.bak\r | |
197 | $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen2.h\r | |
198 | $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen.h\r | |
199 | $(RM) llgrammar.tab.c llgrammar.tab.h\r | |
200 | endif\r | |
201 | \r | |
202 | cscanner.c: cscanner.l\r | |
203 | $(FLEX) $(LFLAGS) cscanner.l \r | |
6ee276d2 | 204 | $(CAT) flex.head lexyy.c flex.reset > cscanner.c\r |
87fa79e5 | 205 | \r |
206 | Headers/flag_codes.gen: flags.def\r | |
207 | grep "FLG_" flags.def > Headers/flag_codes.gen\r | |
6ee276d2 | 208 | $(MAKE)\r |
209 | cd ../lib; $(MAKE)\r | |
87fa79e5 | 210 | \r |
211 | $(binDir)/splint$(EXEEXT): splint$(EXEEXT)\r | |
212 | -$(RM) -f $(binDir)/splint$(EXEEXT)\r | |
213 | $(CP) splint$(EXEEXT) $(binDir)/splint$(EXEEXT)\r | |
214 | \r | |
87fa79e5 | 215 | clean: \r |
216 | -rm -f $(splint_OBJECTS) core *.core *~ \r | |
6ee276d2 | 217 | -rm -f cgrammar.c llgrammar.c mtgrammar.c signature.c cscanner.c\r |
87fa79e5 | 218 | \r |
219 | CLEANFILES = splint$(EXEEXT) $(binDir)/splint$(EXEEXT)\r | |
220 | \r | |
6ee276d2 | 221 | snprintf$O: snprintf.c\r |
222 | $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) \\r | |
223 | -DHAVE_STRING_H -DHAVE_STDLIB_H -DHAVE_CTYPE_H $(CPPFLAGS) -c $<\r | |
224 | \r | |
87fa79e5 | 225 | %$O: %.c\r |
226 | $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) -c $<\r | |
227 | \r | |
6ee276d2 | 228 | splint$(EXEEXT) : $(splint_OBJECTS) \r |
87fa79e5 | 229 | $(CC) $(OFLAG)$@ $^ $(LDFLAGS)\r |
230 | \r | |
231 | list:\r | |
232 | @echo "$(splint_OBJECTS)"\r |