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