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
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 OBJ=abstract$O aliasChecks$O aliasTable$O cgrammar$O checking$O \
34 clabstract$O clause$O clauseStack$O context$O cprim$O cscanner$O \
35 cstring$O cstringSList$O ctype$O ctypeList$O cvar$O \
36 declaratorInvNodeList$O declaratorNodeList$O ekind$O enumNameList$O \
37 enumNameSList$O exprChecks$O exprNode$O exprNodeList$O \
38 exprNodeSList$O fcnNodeList$O fileIdList$O fileStack$O fileTable$O \
39 fileloc$O filelocList$O filelocStack$O flagMarker$O flagMarkerList$O \
40 flags$O general$O globSet$O globals$O guardSet$O hashTable$O \
41 idDecl$O idDeclList$O importNodeList$O imports$O indxMap$O \
42 initDeclNodeList$O intSet$O interfaceNodeList$O lclctypes$O lclinit$O \
43 lcllib$O lclscan$O lclscanline$O lclsyntable$O lcltokentable$O \
44 letDeclNodeList$O lh$O llerror$O llgrammar$O llmain$O lltok$O \
45 lslOpList$O lslOpSet$O lslinit$O lslparse$O lsymbol$O lsymbolList$O \
46 lsymbolSet$O ltoken$O ltokenList$O macrocache$O mapping$O message$O \
47 messageLog$O multiVal$O nameChecks$O osd$O out$O pairNodeList$O \
48 paramNodeList$O pcpp$O programNodeList$O qtype$O qual$O qualList$O \
49 quantifierNodeList$O replaceNodeList$O sRef$O sRefSet$O sRefSetList$O \
50 sRefTable$O scan$O scanline$O shift$O sigNodeSet$O signature$O \
51 sort$O sortList$O sortSet$O sortSetList$O source$O specialClauses$O \
52 stDeclNodeList$O storeRefNodeList$O structNames$O symtable$O \
53 syntable$O termNodeList$O tokentable$O traitRefNodeList$O typeIdSet$O \
54 typeNameNodeList$O uentry$O uentryList$O usymIdSet$O usymtab$O \
55 usymtab_interface$O varDeclarationNodeList$O varKinds$O varNodeList$O \
60 ### main (and only) target: lclint with all optimizations.
65 $(CC) $(OFLAG) $(OBJ) $(LINKFLAGS)
68 ### subtarget: local constants header file.
72 cmd /c if exist Headers\local_constants.last del Headers\local_constants.last
73 cmd /c if exist Headers\local_constants.h ren Headers\local_constants.h local_constants.last
74 echo /* local_constants.h - created automatically by gmake localconstants */ > Headers\local_constants.h
75 echo /*@constant observer char *DEFAULT_CPPCMD;@*/ >> Headers\local_constants.h
76 echo # define DEFAULT_CPPCMD $(DEFAULT_CPPCMD) >> Headers\local_constants.h
77 echo /*@constant observer char *SYSTEM_LIBDIR;@*/ >> Headers\local_constants.h
78 echo # define SYSTEM_LIBDIR $(SYSTEM_LIBDIR) >> Headers\local_constants.h
79 echo /*@constant observer char *DEFAULT_LARCHPATH;@*/ >> Headers\local_constants.h
80 echo # define DEFAULT_LARCHPATH $(DEFAULT_LARCHPATH) >> Headers\local_constants.h
81 echo /*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/ >> Headers\local_constants.h
82 echo # define DEFAULT_LCLIMPORTDIR $(DEFAULT_LCLIMPORTDIR) >> Headers\local_constants.h
89 ### -p xx flag to bison renames yyparse ==> xxparse, xxlex ==> xxlex
90 ### this is probably NOT compatible with yacc.
93 signature.c : signature.c.der signature.y
95 $(BISON) $(YFLAGS) -p lsl signature.y
96 $(CAT) bison.head signature.tab.c > signature.c
97 $(MV) Headers\signature_gen.h Headers\signature_gen.bak
98 $(CAT) bison.head signature.tab.h > Headers\signature_gen.h
100 (CP) signature.c.der signature.c
103 cgrammar.c : cgrammar.c.der cgrammar.y
105 $(BISON) $(YFLAGS) cgrammar.y
106 $(CAT) bison.head cgrammar.tab.c > cgrammar.c
107 $(MV) Headers\cgrammar_tokens.h Headers\cgrammar_tokens.bak
108 $(CAT) bison.head cgrammar.tab.h > Headers\cgrammar_tokens.h
110 $(CP) cgrammar.c.der cgrammar.c
113 ### llgrammar2.h is necessary so +singleinclude may be used
115 llgrammar.c : llgrammar.c.der llgrammar.y
117 $(BISON) $(YFLAGS) -p yl llgrammar.y
118 $(CAT) bison.head llgrammar.tab.c > llgrammar.c
119 $(MV) Headers\llgrammar_gen2.h Headers\llgrammar_gen2.bak
120 $(CAT) bison.head llgrammar.tab.h > Headers\llgrammar_gen2.h
121 $(MV) Headers\llgrammar_gen.h Headers\llgrammar_gen.bak
122 $(CAT) bison.head llgrammar.tab.h > Headers\llgrammar_gen.h
124 $(CP) llgrammar.c.der llgrammar.c
127 cscanner.c : cscanner.c.der cscanner.l
129 $(FLEX) $(LFLAGS) -olex.yy.c cscanner.l
130 $(CAT) flex.head lex.yy.c > cscanner.c
132 $(CP) cscanner.c.der cscanner.c
136 ### header files dependant on grammars
139 Headers\signature2.h : signature.c
140 Headers\cgrammar2.h : cgrammar.c
141 Headers\llgrammar.h : llgrammar.c
147 ### Flags for checking a single file
148 SINGLEFLAGS = +neverinclude -supcounts +partial -showsummary -load lclint.lcd
151 $(CC) $(CPPFLAGS) -c $*.c
156 ### Standard entries to remove files from the directories
157 ### up --- remove .o files and grammar derivatives
158 ### tidy --- eliminate unwanted files
159 ### clean --- delete derived files, except for spec-derived files
160 ### pristine --- delete all derived files
164 -$(RM) -f *.lcs *.lslo
168 -$(RM) *.out *.output *.bib *.dvi *.idx *.log *$O *.toc
169 -$(RM) cgrammar.c cscanner.c
172 -$(RM) ,* .,* *.CKP *.BAK .emacs_[0-9]* core a.out *.*~
175 -$(RM) cgrammar.c llgrammar.c signature.c cscanner.c
179 ### other flags are in .lclintrc file
183 $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint