1 ##################################################
3 ### Makefile for OS/2 version of LCLint
5 ### designed for use with gmake (GNU make)
7 ### based on David Evans' original makefile for Unix systems
9 ### This file should not need to be edited.
11 ### configuration is set by top-level makefile and written to file
12 ### config.inc included by this file.
17 ### builds a release version of lclint from scratch using optimizations
24 include ../os2/config.inc
27 .SUFFIXES: $E $O .h .c .l .check
30 ### object files needed for building lclint:
31 ### note that there is no dependency checking done!
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
74 ### main (and only) target: lclint with all optimizations.
77 all: Headers\\flag_codes.gen lclint$E
79 $(CC) $(OFLAG) $(OBJ) $(LINKFLAGS)
82 ### subtarget: local constants header file.
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
103 ### -p xx flag to bison renames yyparse ==> xxparse, xxlex ==> xxlex
104 ### this is probably NOT compatible with yacc.
107 signature.c : signature.c.der signature.y
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
114 (CP) signature.c.der signature.c
117 cgrammar.c : cgrammar.c.der cgrammar.y
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
124 $(CP) cgrammar.c.der cgrammar.c
127 ### llgrammar2.h is necessary so +singleinclude may be used
129 llgrammar.c : llgrammar.c.der llgrammar.y
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
138 $(CP) llgrammar.c.der llgrammar.c
141 cscanner.c : cscanner.c.der cscanner.l
143 $(FLEX) $(LFLAGS) -olex.yy.c cscanner.l
144 $(CAT) flex.head lex.yy.c > cscanner.c
146 $(CP) cscanner.c.der cscanner.c
150 ### compile without warnings
152 signature.o : signature.c
153 $(CC) $(CPPFLAGS) -c $*.c
155 cgrammar.o : cgrammar.c
156 $(CC) $(CPPFLAGS) -c $*.c
158 cscanner.o : cscanner.c
159 $(CC) $(CPPFLAGS) -c $*.c
161 mtgrammar.o : mtgrammar.c
162 $(CC) $(CPPFLAGS) -c $*.c
164 llgrammar.o : llgrammar.c
165 $(CC) $(CPPFLAGS) -c $*.c
169 ### header files dependant on grammars
172 Headers\signature2.h : signature.c
173 Headers\cgrammar2.h : cgrammar.c
174 Headers\llgrammar.h : llgrammar.c
177 ### generated headers
180 Headers\\flag_codes.gen: flags.def
188 ### Flags for checking a single file
189 SINGLEFLAGS = +neverinclude -supcounts +partial -showsummary -load lclint.lcd
192 $(CC) $(CFLAGS) $(CPPFLAGS) -c $*.c
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
205 -$(RM) -f *.lcs *.lslo
209 -$(RM) *.out *.output *.bib *.dvi *.idx *.log *$O *.toc
210 -$(RM) cgrammar.c cscanner.c
213 -$(RM) ,* .,* *.CKP *.BAK .emacs_[0-9]* core a.out *.*~
216 -$(RM) cgrammar.c llgrammar.c signature.c cscanner.c
220 ### other flags are in .lclintrc file
224 $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint