]> andersk Git - splint.git/blob - src/Makefile.os2
Changes for the OS/2 port: cpplib.c (fixed cstring_replaceAll()
[splint.git] / src / Makefile.os2
1 ##################################################
2 ###                                         
3 ### Makefile for OS/2 version of LCLint                     
4 ###                                         
5 ### designed for use with gmake (GNU make)
6 ###
7 ### based on David Evans' original makefile for Unix systems
8 ###
9 ### This file should not need to be edited. 
10 ###
11 ### configuration is set by top-level makefile and written to file
12 ###  config.inc included by this file.
13 ###
14 ### Commands:
15 ###
16 ### make all 
17 ###    builds a release version of lclint from scratch using optimizations
18 ###
19
20 O=.o
21 E=
22
23
24 include ../os2/config.inc
25
26 .SUFFIXES:
27 .SUFFIXES: $E $O .h .c .l .check
28
29 ###
30 ### object files needed for building lclint:
31 ###  note that there is no dependency checking done!
32 ###
33 FIRSTOBJ=cgrammar$O llgrammar$O signature$O
34 OBJ=$(FIRSTOBJ) abstract$O aliasTable$O annotationInfo$O annotationTable$O  \
35     checking$O clabstract$O clause$O clauseStack$O constraint$O \
36     constraintExpr$O constraintExprData$O constraintGeneration$O \
37     constraintList$O constraintOutput$O constraintResolve$O constraintTerm$O \
38     context$O cpperror$O cppexp$O cpphash$O cpplib$O cppmain$O cprim$O \
39     cscanner$O cstring$O cstringList$O cstringSList$O cstringTable$O ctype$O \
40     ctypeList$O cvar$O declaratorInvNodeList$O declaratorNodeList$O ekind$O \
41     enumNameList$O enumNameSList$O exprChecks$O exprData$O exprNode$O \
42     exprNodeList$O exprNodeSList$O fcnNodeList$O fileLib$O fileIdList$O \
43     fileTable$O fileloc$O filelocList$O filelocStack$O flagMarker$O \
44     flagMarkerList$O flagSpec$O flags$O forjunk$O functionClause$O \
45     functionClauseList$O functionConstraint$O general$O genericTable$O \
46     globalsClause$O globSet$O globals$O guardSet$O idDecl$O idDeclList$O \
47     importNodeList$O imports$O initDeclNodeList$O inputStream$O intSet$O \
48     interfaceNodeList$O lclctypes$O lclinit$O lcllib$O lclscan$O \
49     lclscanline$O lclsyntable$O lcltokentable$O letDeclNodeList$O lh$O \
50     llerror$O llmain$O lltok$O lslOpList$O lslOpSet$O lslinit$O \
51     lslparse$O lsymbol$O lsymbolList$O lsymbolSet$O ltoken$O ltokenList$O \
52     macrocache$O mapping$O message$O messageLog$O metaStateConstraint$O \
53     metaStateConstraintList$O metaStateExpression$O metaStateInfo$O \
54     metaStateSpecifier$O metaStateTable$O modifiesClause$O mtAnnotationDecl$O \
55     mtAnnotationList$O mtAnnotationsNode$O mtContextNode$O \
56     mtDeclarationNode$O mtDeclarationPiece$O mtDeclarationPieces$O \
57     mtDefaultsDecl$O mtDefaultsDeclList$O mtDefaultsNode$O mtLoseReference$O \
58     mtLoseReferenceList$O mtMergeClause$O mtMergeClauseList$O mtMergeItem$O \
59     mtMergeNode$O mtTransferAction$O mtTransferClause$O \
60     mtTransferClauseList$O mtValuesNode$O mtgrammar$O mtreader$O mtscanner$O \
61     mttok$O multiVal$O nameChecks$O osd$O pairNodeList$O paramNodeList$O \
62     programNodeList$O qtype$O qual$O qualList$O quantifierNodeList$O \
63     randomNumbers$O reader$O replaceNodeList$O sRef$O sRefSet$O sRefSetList$O \
64     sRefTable$O scan$O scanline$O shift$O sigNodeSet$O \
65     sort$O sortList$O sortSet$O sortSetList$O stateClause$O stateClauseList$O \
66     stateCombinationTable$O stateInfo$O stateValue$O stDeclNodeList$O \
67     storeRefNodeList$O structNames$O symtable$O syntable$O termNodeList$O \
68     tokentable$O traitRefNodeList$O transferChecks$O typeIdSet$O \
69     typeNameNodeList$O uentry$O uentryList$O usymIdSet$O usymtab$O \
70     usymtab_interface$O valueTable$O varDeclarationNodeList$O varKinds$O \
71     varNodeList$O warnClause$O ynm$O 
72
73 ###
74 ### main (and only) target: lclint with all optimizations.
75 ###
76
77 all: Headers\\flag_codes.gen lclint$E
78 lclint$E : $(OBJ) 
79         $(CC) $(OFLAG) $(OBJ) $(LINKFLAGS)
80
81 ###
82 ### subtarget: local constants header file.
83 ###
84
85 localconstants:
86         cmd /c if exist Headers\local_constants.last del Headers\local_constants.last
87         cmd /c if exist Headers\local_constants.h ren Headers\local_constants.h local_constants.last
88         $(ECHO) "/* local_constants.h - created automatically by gmake localconstants */" > Headers\local_constants.h
89         $(ECHO) "/*@constant observer char *DEFAULT_CPPCMD;@*/" >> Headers\local_constants.h 
90         $(ECHO) -E "# define DEFAULT_CPPCMD \"$(DEFAULT_CPPCMD)\"" >> Headers\local_constants.h
91         $(ECHO) "/*@constant observer char *SYSTEM_LIBDIR;@*/" >> Headers\local_constants.h 
92         $(ECHO) -E "# define SYSTEM_LIBDIR \"$(SYSTEM_LIBDIR)\"" >> Headers\local_constants.h 
93         $(ECHO) "/*@constant observer char *DEFAULT_LARCHPATH;@*/" >> Headers\local_constants.h 
94         $(ECHO) -E "# define DEFAULT_LARCHPATH \"$(DEFAULT_LARCHPATH)\"" >> Headers\local_constants.h 
95         $(ECHO) "/*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/" >> Headers\local_constants.h 
96         $(ECHO) -E "# define DEFAULT_LCLIMPORTDIR \"$(DEFAULT_LCLIMPORTDIR)\"" >> Headers\local_constants.h 
97
98 ###
99 ### grammars
100 ###
101
102 ###
103 ### -p xx flag to bison renames yyparse ==> xxparse, xxlex ==> xxlex
104 ### this is probably NOT compatible with yacc.
105 ###
106
107 signature.c : signature.c.der signature.y
108 ifdef BISON
109         $(BISON) $(YFLAGS) -p lsl signature.y
110         $(CAT) bison.head signature.tab.c > signature.c
111         -$(MV) Headers\signature_gen.h Headers\signature_gen.bak
112         $(CAT) bison.head signature.tab.h > Headers\signature_gen.h
113 else
114         (CP) signature.c.der signature.c
115 endif
116
117 cgrammar.c : cgrammar.c.der cgrammar.y
118 ifdef BISON
119         $(BISON) $(YFLAGS) cgrammar.y
120         $(CAT) bison.head cgrammar.tab.c > cgrammar.c
121         -$(MV) Headers\cgrammar_tokens.h Headers\cgrammar_tokens.bak
122         $(CAT) bison.head cgrammar.tab.h > Headers\cgrammar_tokens.h
123 else
124         $(CP) cgrammar.c.der cgrammar.c
125 endif
126
127 ### llgrammar2.h is necessary so +singleinclude may be used
128
129 llgrammar.c  : llgrammar.c.der llgrammar.y
130 ifdef BISON
131         $(BISON) $(YFLAGS) -p yl llgrammar.y
132         $(CAT) bison.head llgrammar.tab.c > llgrammar.c
133         -$(MV) Headers\llgrammar_gen2.h Headers\llgrammar_gen2.bak
134         $(CAT) bison.head llgrammar.tab.h > Headers\llgrammar_gen2.h
135         -$(MV) Headers\llgrammar_gen.h Headers\llgrammar_gen.bak
136         $(CAT) bison.head llgrammar.tab.h > Headers\llgrammar_gen.h
137 else
138         $(CP) llgrammar.c.der llgrammar.c
139 endif
140
141 cscanner.c : cscanner.c.der cscanner.l
142 ifdef FLEX                              
143         $(FLEX) $(LFLAGS) -olex.yy.c cscanner.l  
144         $(CAT) flex.head lex.yy.c > cscanner.c
145 else
146         $(CP) cscanner.c.der cscanner.c
147 endif
148
149 ###
150 ### compile without warnings
151 ### 
152 signature.o : signature.c
153         $(CC) $(CPPFLAGS) -c $*.c
154
155 cgrammar.o : cgrammar.c
156         $(CC) $(CPPFLAGS) -c $*.c
157
158 cscanner.o : cscanner.c
159         $(CC) $(CPPFLAGS) -c $*.c
160
161 mtgrammar.o : mtgrammar.c
162         $(CC) $(CPPFLAGS) -c $*.c
163
164 llgrammar.o : llgrammar.c
165         $(CC) $(CPPFLAGS) -c $*.c
166
167
168 ###
169 ### header files dependant on grammars
170 ###
171
172 Headers\signature2.h : signature.c
173 Headers\cgrammar2.h : cgrammar.c
174 Headers\llgrammar.h : llgrammar.c
175
176 ###
177 ### generated headers
178 ###
179
180 Headers\\flag_codes.gen: flags.def
181         grep "FLG_" $< >$@
182         touch flags.c
183
184 ###
185 ### defaults
186 ###
187
188 ### Flags for checking a single file
189 SINGLEFLAGS = +neverinclude -supcounts +partial -showsummary -load lclint.lcd
190
191 .c$O:
192         $(CC) $(CFLAGS) $(CPPFLAGS) -c $*.c 
193
194 ###
195 ### cleaning
196 ###
197 ### Standard entries to remove files from the directories
198 ###    up       --- remove .o files and grammar derivatives
199 ###    tidy     --- eliminate unwanted files
200 ###    clean    --- delete derived files, except for spec-derived files
201 ###    pristine --- delete all derived files
202 ###
203
204 pristine: clean
205         -$(RM) -f *.lcs *.lslo
206
207 clean: tidy
208         -$(RM) core lclint 
209         -$(RM) *.out *.output *.bib *.dvi *.idx *.log *$O *.toc
210         -$(RM) cgrammar.c cscanner.c
211
212 tidy:
213         -$(RM) ,* .,* *.CKP *.BAK .emacs_[0-9]* core a.out *.*~
214
215 up: 
216         -$(RM) cgrammar.c llgrammar.c signature.c cscanner.c 
217         -$(RM) *$O
218
219 ###
220 ### other flags are in .lclintrc file
221 ### 
222
223 lint: 
224         $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint
225
226
227
This page took 0.073831 seconds and 5 git commands to generate.