]> andersk Git - splint.git/blob - src/Makefile.os2
Fixed the OS/2 specific files for the latest release.
[splint.git] / src / Makefile.os2
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 \r
11 BISON_SRC = cgrammar.y  llgrammar.y  mtgrammar.y  signature.y\r
12 \r
13 \r
14 ## We only build Splint\r
15 bin_PROGRAMS = splint$(EXEEXT)\r
16 \r
17 ## This is a fake program, so we can easily substitute in the extra LCL objects\r
18 EXTRA_PROGRAMS = lcl\r
19 \r
20 AM_CPPFLAGS = -IHeaders\r
21 \r
22 ## The main sources\r
23 \r
24 SETSRC = globSet.c intSet.c typeIdSet.c guardSet.c usymIdSet.c sRefSet.c\r
25 \r
26 LISTSRC = 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
32 CPPSRC = cppmain.c cpplib.c cppexp.c cpphash.c cpperror.c\r
33 \r
34 CSRC = context.c uentry.c cprim.c macrocache.c qual.c qtype.c stateClause.c \\r
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
38        metaStateExpression.c metaStateSpecifier.c functionConstraint.c \\r
39        pointers.c cscannerHelp.c        \r
40 \r
41 SPLINTSRC = exprNode.c exprChecks.c llmain.c help.c rcfiles.c\r
42 CHECKSRC = structNames.c transferChecks.c varKinds.c nameChecks.c\r
43 \r
44 GLOBSRC = globals.c flags.c general.c osd.c reader.c mtreader.c\r
45 \r
46 GRAMSRC = cgrammar.c cscanner.c mtscanner.c mtgrammar.c llgrammar.c signature.c\r
47 \r
48 OVERFLOWCHSRC = constraintList.c constraintResolve.c \\r
49                 constraintGeneration.c constraintTerm.c \\r
50                 constraintExprData.c constraintExpr.c constraint.c \\r
51                 loopHeuristics.c \r
52 \r
53 GENERALSRC = 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
59 METASTATESRC = 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
71 LCLONLYSRC = 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
75 LSLSRC = 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
78 LCLSETSRC  = lsymbolSet.c sigNodeSet.c lslOpSet.c sortSet.c\r
79 \r
80 LCLLISTSRC = 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
89 IFILES =  ctbase.i  cttable.i  exprDataQuite.i\r
90 \r
91 #Files that are used on systems that do not have bison or yacc\r
92 DER_BISON_FILES = signature.c.der  cgrammar.c.der  mtgrammar.c.der \\r
93                   llgrammar.c.der \r
94 DER_FILES = $(DER_BISON_FILES)\r
95 \r
96 \r
97 COMMONSRC =  $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \\r
98             $(GLOBSRC) $(LISTSRC) $(SETSRC) $(METASTATESRC)\r
99 \r
100 LCLSRC = $(LCLSETSRC) $(LCLLISTSRC) $(LSLSRC) $(COMMONSRC) $(LCLONLYSRC) \r
101 \r
102 ALLSRC = $(GRAMSRC) $(SPLINTSRC) $(OVERFLOWCHSRC) $(LCLSRC)\r
103 # snprintf.c\r
104 \r
105 #files to run Splint on\r
106 LINTSRC = $(COMMONSRC) $(SPLINTSRC)\r
107 \r
108 lcl_SOURCES = $(LCLSRC)\r
109 CONFIG_HEADER = ../config.h\r
110 \r
111 splint_SOURCES = $(ALLSRC)\r
112 splint_OBJECTS = $(splint_SOURCES:.c=$O)\r
113 \r
114 # Keep it fake\r
115 .PHONY: lcl$(EXEEXT)\r
116 \r
117 DEFS = -DHAVE_CONFIG_H -D__pid_t=pid_t\r
118 DEFAULT_INCLUDES =  -I. -I..\r
119 \r
120 ## Sources that need to be built\r
121 BUILT_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
127 all: $(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
147 \r
148 Headers/signature_gen.h signature.c: signature.c.der signature.y\r
149 ifndef BISON\r
150         $(CP) signature.c.der signature.c\r
151 else \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
159 endif\r
160 \r
161 ## 11/29/001 drl added copy so that the file cgrammar.c.der is created\r
162 \r
163 Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y\r
164 ifndef BISON\r
165         $(CP) cgrammar.c.der cgrammar.c\r
166 else \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
171         $(CAT) bison.head cgrammar.tab.c bison.reset >cgrammar.c\r
172         $(CP) cgrammar.c cgrammar.c.der\r
173         -$(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak\r
174         $(CAT) bison.head cgrammar.tab.h bison.reset >Headers/cgrammar_tokens.h\r
175         $(RM) cgrammar.tab.c cgrammar.tab.h\r
176 endif\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
181 Headers/mtgrammar_tokens.h mtgrammar.c: mtgrammar.y\r
182 ifndef BISON\r
183         $(CP) mtgrammar.c.der mtgrammar.c\r
184 else \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
193 endif\r
194 \r
195 Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der llgrammar.y\r
196 ifndef BISON\r
197         $(CP) llgrammar.c.der llgrammar.c\r
198 else \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
209 endif\r
210 \r
211 cscanner.c: cscanner.l\r
212         $(FLEX) $(LFLAGS) cscanner.l \r
213         $(CAT) flex.head lexyy.c flex.reset > cscanner.c\r
214 \r
215 Headers/flag_codes.gen: flags.def\r
216         grep "FLG_" flags.def > Headers/flag_codes.gen\r
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
222 clean: \r
223         -rm -f $(splint_OBJECTS) core *.core *~ \r
224         -rm -f cgrammar.c llgrammar.c mtgrammar.c signature.c cscanner.c\r
225 \r
226 CLEANFILES = splint$(EXEEXT)  $(binDir)/splint$(EXEEXT)\r
227 \r
228 snprintf$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
232 %$O: %.c\r
233         $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) -c $<\r
234 \r
235 splint$(EXEEXT) : $(CONFIG_HEADER) $(BUILT_SOURCES) $(splint_OBJECTS) \r
236         $(CC) $(OFLAG)$@ $(splint_OBJECTS) $(LDFLAGS)\r
237 \r
238 list:\r
239         @echo "$(splint_OBJECTS)"\r
This page took 0.05833 seconds and 5 git commands to generate.