X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/885824d34f6f6626fde2fb041801408cbaf1f6f1..ed62d3fbeda6bb085991cdd683ceacfc57f7afbe:/src/Makefile.os2 diff --git a/src/Makefile.os2 b/src/Makefile.os2 index e3c930a..8fe9af8 100644 --- a/src/Makefile.os2 +++ b/src/Makefile.os2 @@ -1,187 +1,316 @@ -################################################## -### -### Makefile for OS/2 version of LCLint -### -### designed for use with gmake (GNU make) -### -### based on David Evans' original makefile for Unix systems -### -### This file should not need to be edited. -### -### configuration is set by top-level makefile and written to file -### config.inc included by this file. -### -### Commands: -### -### make all -### builds a release version of lclint from scratch using optimizations -### - -O=.o -E= - - -include ../config.inc - -.SUFFIXES: -.SUFFIXES: $E $O .h .c .l .check - -### -### object files needed for building lclint: -### note that there is no dependency checking done! -### -OBJ=abstract$O aliasChecks$O aliasTable$O cgrammar$O checking$O \ - clabstract$O clause$O clauseStack$O context$O cprim$O cscanner$O \ - cstring$O cstringSList$O ctype$O ctypeList$O cvar$O \ - declaratorInvNodeList$O declaratorNodeList$O ekind$O enumNameList$O \ - enumNameSList$O exprChecks$O exprNode$O exprNodeList$O \ - exprNodeSList$O fcnNodeList$O fileIdList$O fileStack$O fileTable$O \ - fileloc$O filelocList$O filelocStack$O flagMarker$O flagMarkerList$O \ - flags$O general$O globSet$O globals$O guardSet$O hashTable$O \ - idDecl$O idDeclList$O importNodeList$O imports$O indxMap$O \ - initDeclNodeList$O intSet$O interfaceNodeList$O lclctypes$O lclinit$O \ - lcllib$O lclscan$O lclscanline$O lclsyntable$O lcltokentable$O \ - letDeclNodeList$O lh$O llerror$O llgrammar$O llmain$O lltok$O \ - lslOpList$O lslOpSet$O lslinit$O lslparse$O lsymbol$O lsymbolList$O \ - lsymbolSet$O ltoken$O ltokenList$O macrocache$O mapping$O message$O \ - messageLog$O multiVal$O nameChecks$O osd$O out$O pairNodeList$O \ - paramNodeList$O pcpp$O programNodeList$O qtype$O qual$O qualList$O \ - quantifierNodeList$O replaceNodeList$O sRef$O sRefSet$O sRefSetList$O \ - sRefTable$O scan$O scanline$O shift$O sigNodeSet$O signature$O \ - sort$O sortList$O sortSet$O sortSetList$O source$O specialClauses$O \ - stDeclNodeList$O storeRefNodeList$O structNames$O symtable$O \ - syntable$O termNodeList$O tokentable$O traitRefNodeList$O typeIdSet$O \ - typeNameNodeList$O uentry$O uentryList$O usymIdSet$O usymtab$O \ - usymtab_interface$O varDeclarationNodeList$O varKinds$O varNodeList$O \ - ynm$O - - -### -### main (and only) target: lclint with all optimizations. -### - -all : lclint$E -lclint$E : $(OBJ) - $(CC) $(OFLAG) $(OBJ) $(LINKFLAGS) - -### -### subtarget: local constants header file. -### - -localconstants: - cmd /c if exist Headers\local_constants.last del Headers\local_constants.last - cmd /c if exist Headers\local_constants.h ren Headers\local_constants.h local_constants.last - echo /* local_constants.h - created automatically by gmake localconstants */ > Headers\local_constants.h - echo /*@constant observer char *DEFAULT_CPPCMD;@*/ >> Headers\local_constants.h - echo # define DEFAULT_CPPCMD $(DEFAULT_CPPCMD) >> Headers\local_constants.h - echo /*@constant observer char *SYSTEM_LIBDIR;@*/ >> Headers\local_constants.h - echo # define SYSTEM_LIBDIR $(SYSTEM_LIBDIR) >> Headers\local_constants.h - echo /*@constant observer char *DEFAULT_LARCHPATH;@*/ >> Headers\local_constants.h - echo # define DEFAULT_LARCHPATH $(DEFAULT_LARCHPATH) >> Headers\local_constants.h - echo /*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/ >> Headers\local_constants.h - echo # define DEFAULT_LCLIMPORTDIR $(DEFAULT_LCLIMPORTDIR) >> Headers\local_constants.h - -### -### grammars -### - -### -### -p xx flag to bison renames yyparse ==> xxparse, xxlex ==> xxlex -### this is probably NOT compatible with yacc. -### - -signature.c : signature.c.der signature.y -ifdef BISON - $(BISON) $(YFLAGS) -p lsl signature.y - $(CAT) bison.head signature.tab.c > signature.c - $(MV) Headers\signature_gen.h Headers\signature_gen.bak - $(CAT) bison.head signature.tab.h > Headers\signature_gen.h -else - (CP) signature.c.der signature.c -endif - -cgrammar.c : cgrammar.c.der cgrammar.y -ifdef BISON - $(BISON) $(YFLAGS) cgrammar.y - $(CAT) bison.head cgrammar.tab.c > cgrammar.c - $(MV) Headers\cgrammar_tokens.h Headers\cgrammar_tokens.bak - $(CAT) bison.head cgrammar.tab.h > Headers\cgrammar_tokens.h -else - $(CP) cgrammar.c.der cgrammar.c -endif - -### llgrammar2.h is necessary so +singleinclude may be used - -llgrammar.c : llgrammar.c.der llgrammar.y -ifdef BISON - $(BISON) $(YFLAGS) -p yl llgrammar.y - $(CAT) bison.head llgrammar.tab.c > llgrammar.c - $(MV) Headers\llgrammar_gen2.h Headers\llgrammar_gen2.bak - $(CAT) bison.head llgrammar.tab.h > Headers\llgrammar_gen2.h - $(MV) Headers\llgrammar_gen.h Headers\llgrammar_gen.bak - $(CAT) bison.head llgrammar.tab.h > Headers\llgrammar_gen.h -else - $(CP) llgrammar.c.der llgrammar.c -endif - -cscanner.c : cscanner.c.der cscanner.l -ifdef FLEX - $(FLEX) $(LFLAGS) -olex.yy.c cscanner.l - $(CAT) flex.head lex.yy.c > cscanner.c -else - $(CP) cscanner.c.der cscanner.c -endif - -### -### header files dependant on grammars -### - -Headers\signature2.h : signature.c -Headers\cgrammar2.h : cgrammar.c -Headers\llgrammar.h : llgrammar.c - -### -### defaults -### - -### Flags for checking a single file -SINGLEFLAGS = +neverinclude -supcounts +partial -showsummary -load lclint.lcd - -.c$O: - $(CC) $(CPPFLAGS) -c $*.c - -### -### cleaning -### -### Standard entries to remove files from the directories -### up --- remove .o files and grammar derivatives -### tidy --- eliminate unwanted files -### clean --- delete derived files, except for spec-derived files -### pristine --- delete all derived files -### - -pristine: clean - -$(RM) -f *.lcs *.lslo - -clean: tidy - -$(RM) core lclint - -$(RM) *.out *.output *.bib *.dvi *.idx *.log *$O *.toc - -$(RM) cgrammar.c cscanner.c - -tidy: - -$(RM) ,* .,* *.CKP *.BAK .emacs_[0-9]* core a.out *.*~ - -up: - -$(RM) cgrammar.c llgrammar.c signature.c cscanner.c - -$(RM) *$O - -### -### other flags are in .lclintrc file -### - -lint: - $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint - - - - +# +# splint Makefile for GNU Make on OS/2 systems +# +# Derived from original Unix makefile by Herbert +# + +SHELL = /usr/bin/ksh + +include ../os2/make.vars +binDir = ../bin + + +.SUFFIXES = +.SUFFIXES = .c .h $O $(EXEEXT) .l .check + +# Some preferences +### We use the no-lines option to prevent confusion with splint flag settings. +### Should fix splint to avoid this... +YFLAGS = -v -t -d --debug --no-lines +LFLAGS = -L + +BISON_SRC = cgrammar.y llgrammar.y mtgrammar.y signature.y + + +## We only build Splint +bin_PROGRAMS = splint$(EXEEXT) + +## This is a fake program, so we can easily substitute in the extra LCL objects +EXTRA_PROGRAMS = lcl + +AM_CPPFLAGS = -IHeaders + +## The main sources + +SETSRC = globSet.c intSet.c typeIdSet.c guardSet.c usymIdSet.c sRefSet.c + +LISTSRC = clauseStack.c filelocStack.c \ + cstringList.c cstringSList.c sRefSetList.c ctypeList.c \ + enumNameList.c enumNameSList.c exprNodeList.c exprNodeSList.c \ + uentryList.c fileIdList.c filelocList.c qualList.c sRefList.c \ + flagMarkerList.c idDeclList.c flagSpec.c + +CPPSRC = cppmain.c cpplib.c cppexp.c cpphash.c cpperror.c + +CSRC = uentry.c cprim.c macrocache.c qual.c qtype.c stateClause.c \ + stateClauseList.c ctype.c cvar.c clabstract.c idDecl.c clause.c \ + globalsClause.c modifiesClause.c warnClause.c functionClause.c \ + functionClauseList.c metaStateConstraint.c metaStateConstraintList.c \ + metaStateExpression.c metaStateSpecifier.c functionConstraint.c \ + pointers.c + +SPLINTSRC = exprNode.c exprChecks.c llmain.c help.c rcfiles.c +CHECKSRC = structNames.c transferChecks.c varKinds.c nameChecks.c + +GLOBSRC = context.c globals.c flags.c general.c osd.c reader.c mtreader.c + +GRAMSRC = cgrammar.c cscanner.c mtscanner.c mtgrammar.c llgrammar.c signature.c + +OVERFLOWCHSRC = constraintGeneration.c constraintTerm.c \ + constraintExprData.c constraintExpr.c constraint.c \ + constraintList.c constraintResolve.c \ + constraintOutput.c loopHeuristics.c + +GENERALSRC = exprData.c cstring.c fileloc.c message.c inputStream.c \ + fileTable.c cstringTable.c valueTable.c stateValue.c \ + llerror.c messageLog.c flagMarker.c aliasTable.c ynm.c \ + sRefTable.c genericTable.c ekind.c usymtab.c multiVal.c \ + lltok.c sRef.c lcllib.c randomNumbers.c fileLib.c + +METASTATESRC = stateInfo.c stateCombinationTable.c metaStateTable.c \ + metaStateInfo.c annotationTable.c annotationInfo.c mttok.c \ + mtDeclarationNode.c mtDeclarationPieces.c mtDeclarationPiece.c \ + mtContextNode.c mtValuesNode.c mtDefaultsNode.c \ + mtAnnotationsNode.c mtMergeNode.c mtAnnotationList.c \ + mtAnnotationDecl.c mtTransferClauseList.c mtTransferClause.c \ + mtTransferAction.c mtLoseReferenceList.c mtLoseReference.c \ + mtDefaultsDeclList.c mtDefaultsDecl.c mtMergeItem.c \ + mtMergeClause.c mtMergeClauseList.c + +## These are only used if LCL is enabled + +LCLONLYSRC = usymtab_interface.c abstract.c ltoken.c lclscanline.c \ + lclsyntable.c lcltokentable.c sort.c symtable.c lclinit.c \ + shift.c lclscan.c lsymbol.c mapping.c + +LSLSRC = tokentable.c scan.c scanline.c lslparse.c \ + lh.c checking.c lclctypes.c imports.c lslinit.c syntable.c + +LCLSETSRC = lsymbolSet.c sigNodeSet.c lslOpSet.c sortSet.c + +LCLLISTSRC = initDeclNodeList.c sortList.c declaratorInvNodeList.c \ + interfaceNodeList.c sortSetList.c declaratorNodeList.c \ + letDeclNodeList.c stDeclNodeList.c storeRefNodeList.c \ + lslOpList.c lsymbolList.c termNodeList.c ltokenList.c \ + traitRefNodeList.c pairNodeList.c typeNameNodeList.c \ + fcnNodeList.c paramNodeList.c programNodeList.c \ + varDeclarationNodeList.c varNodeList.c quantifierNodeList.c \ + replaceNodeList.c importNodeList.c + +IFILES = ctbase.i cttable.i exprDataQuite.i + + +#Files that are used on systems that do not have bison or yacc +DER_BISON_FILES = signature.c.der cgrammar.c.der mtgrammar.c.der \ + llgrammar.c.der +DER_FILES = $(DER_BISON_FILES) + + +COMMONSRC = $(OVERFLOWCHSRC) $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \ + $(GLOBSRC) $(IFACESRC) $(LISTSRC) $(SETSRC) $(METASTATESRC) + +ALLSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) + +#files to run Splint on +LINTSRC = $(COMMONSRC) $(SPLINTSRC) cscanner.c cgrammar.c + +LCLSRC = $(LCLSETSRC) $(LCLLISTSRC) $(LSLSRC) $(CMNSRC) $(LCLONLYSRC) +lcl_SOURCES = $(LCLSRC) +CONFIG_HEADER = $(top_builddir)/config.h + +splint_SOURCES = $(ALLSRC) + +lcl_OBJECTS = lsymbolSet$O sigNodeSet$O \ + lslOpSet$O sortSet$O initDeclNodeList$O \ + sortList$O declaratorInvNodeList$O \ + interfaceNodeList$O sortSetList$O \ + declaratorNodeList$O letDeclNodeList$O \ + stDeclNodeList$O storeRefNodeList$O \ + lslOpList$O lsymbolList$O \ + termNodeList$O ltokenList$O \ + traitRefNodeList$O pairNodeList$O \ + typeNameNodeList$O fcnNodeList$O \ + paramNodeList$O programNodeList$O \ + varDeclarationNodeList$O varNodeList$O \ + quantifierNodeList$O replaceNodeList$O \ + importNodeList$O tokentable$O scan$O \ + scanline$O lslparse$O lh$O \ + checking$O lclctypes$O imports$O \ + lslinit$O syntable$O \ + usymtab_interface$O abstract$O ltoken$O \ + lclscanline$O lclsyntable$O \ + lcltokentable$O sort$O symtable$O \ + lclinit$O shift$O lclscan$O \ + lsymbol$O mapping$O + +splint_OBJECTS = cgrammar$O cscanner$O \ + mtscanner$O mtgrammar$O llgrammar$O \ + signature$O cppmain$O cpplib$O \ + cppexp$O cpphash$O cpperror$O \ + context$O uentry$O cprim$O \ + macrocache$O qual$O qtype$O \ + stateClause$O stateClauseList$O ctype$O \ + cvar$O clabstract$O idDecl$O \ + clause$O globalsClause$O \ + modifiesClause$O warnClause$O \ + functionClause$O functionClauseList$O \ + metaStateConstraint$O metaStateConstraintList$O \ + metaStateExpression$O metaStateSpecifier$O \ + functionConstraint$O pointers$O \ + structNames$O transferChecks$O \ + varKinds$O nameChecks$O exprData$O \ + cstring$O fileloc$O message$O \ + inputStream$O fileTable$O \ + cstringTable$O valueTable$O \ + stateValue$O llerror$O messageLog$O \ + flagMarker$O aliasTable$O ynm$O \ + sRefTable$O genericTable$O ekind$O \ + usymtab$O multiVal$O lltok$O \ + sRef$O lcllib$O randomNumbers$O \ + fileLib$O globals$O \ + flags$O general$O osd$O \ + reader$O mtreader$O clauseStack$O \ + filelocStack$O cstringList$O \ + cstringSList$O sRefSetList$O \ + ctypeList$O enumNameList$O \ + enumNameSList$O exprNodeList$O \ + exprNodeSList$O uentryList$O \ + fileIdList$O filelocList$O qualList$O \ + sRefList$O flagMarkerList$O \ + idDeclList$O flagSpec$O globSet$O \ + intSet$O typeIdSet$O guardSet$O \ + usymIdSet$O sRefSet$O stateInfo$O \ + stateCombinationTable$O metaStateTable$O \ + metaStateInfo$O annotationTable$O \ + annotationInfo$O mttok$O \ + mtDeclarationNode$O mtDeclarationPieces$O \ + mtDeclarationPiece$O mtContextNode$O \ + mtValuesNode$O mtDefaultsNode$O \ + mtAnnotationsNode$O mtMergeNode$O \ + mtAnnotationList$O mtAnnotationDecl$O \ + mtTransferClauseList$O mtTransferClause$O \ + mtTransferAction$O mtLoseReferenceList$O \ + mtLoseReference$O mtDefaultsDeclList$O \ + mtDefaultsDecl$O mtMergeItem$O \ + mtMergeClause$O mtMergeClauseList$O \ + exprNode$O exprChecks$O llmain$O \ + help$O rcfiles$O constraintGeneration$O \ + constraintTerm$O constraintExprData$O \ + constraintExpr$O constraint$O \ + constraintList$O constraintResolve$O \ + constraintOutput$O loopHeuristics$O snprintf$O + +# Keep it fake +.PHONY: lcl$(EXEEXT) + +DEFS = -DHAVE_CONFIG_H +DEFAULT_INCLUDES = -I. -I.. +LDADD = $(lcl_OBJECTS) + +## Sources that need to be built +BUILT_SOURCES = Headers/signature_gen.h Headers/cgrammar_tokens.h \ + Headers/llgrammar_gen.h Headers/llgrammar_gen2.h \ + Headers/mtgrammar_tokens.h signature.c cgrammar.c \ + llgrammar.c mtgrammar.c Headers/flag_codes.gen \ + $(DER_FILES) + +all: $(BUILT_SOURCES) splint$(EXEEXT) $(binDir)/splint$(EXEEXT) + +Headers/signature_gen.h signature.c: signature.c.der signature.y +ifndef BISON + $(CP) signature.c.der signature.c +else + echo "Making signature.c" + $(BISON) $(YFLAGS) -p lsl signature.y + $(CAT) bison.head signature.tab.c bison.reset >signature.c + $(CP) signature.c signature.c.der + -$(MV) Headers/signature_gen.h Headers/signature_gen.bak + $(CAT) bison.head signature.tab.h bison.reset >Headers/signature_gen.h + $(RM) signature.tab.c signature.tab.h +endif + +## 11/29/001 drl added copy so that the file cgrammar.c.der is created + +Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y +ifndef BISON + $(CP) cgrammar.c.der cgrammar.c +else + @echo "Making cgrammar.c" + @echo "Expect 141 shift/reduce conflicts and 111 reduce/reduce conflicts." + @echo "(see cgrammar.y for explanation)" + $(BISON) $(YFLAGS) cgrammar.y + $(CAT) bison.head cgrammar.tab.c bison.reset | $(SED) \ + -e 's/YYSTYPE/cgrammar_YYSTYPE/g' -e 's/lsllex/cgrammar_lsllex/' \ + >cgrammar.c + $(CP) cgrammar.c cgrammar.c.der + -$(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak + $(CAT) bison.head cgrammar.tab.h bison.reset | $(SED) \ + -e 's/YYSTYPE/cgrammar_YYSTYPE/g' -e 's/lsllex/cgrammar_lsllex/g' \ + >Headers/cgrammar_tokens.h + $(RM) cgrammar.tab.c cgrammar.tab.h +endif + +## 10/16/001 drl added copy so that the file mtgrammar.c.der is created +## also removed the dependency for this file on mtgrammary.c + +Headers/mtgrammar_tokens.h mtgrammar.c: mtgrammar.y +ifndef BISON + $(CP) mtgrammar.c.der mtgrammar.c +else + @echo "Making mtgrammar.c" + @echo "Expect 11 shift/reduce conflicts." + $(BISON) $(YFLAGS) -p mt mtgrammar.y + $(CAT) bison.head mtgrammar.tab.c bison.reset >mtgrammar.c + $(CP) mtgrammar.c mtgrammar.c.der + -$(MV) Headers/mtgrammar_tokens.h Headers/mtgrammar_tokens.bak + $(CAT) bison.head mtgrammar.tab.h bison.reset >Headers/mtgrammar_tokens.h + $(RM) mtgrammar.tab.c mtgrammar.tab.h +endif + +Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der llgrammar.y +ifndef BISON + $(CP) llgrammar.c.der llgrammar.c +else + @echo "Making llgrammar.c" + @echo "Expect 2 shift/reduce conflicts" + $(BISON) $(YFLAGS) -p yl llgrammar.y + $(CAT) bison.head llgrammar.tab.c bison.reset >llgrammar.c + $(CP) llgrammar.c llgrammar.c.der + -$(MV) Headers/llgrammar_gen2.h Headers/llgrammar_gen2.bak + -$(MV) Headers/llgrammar_gen.h Headers/llgrammar_gen.bak + $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen2.h + $(CAT) bison.head llgrammar.tab.h bison.reset >Headers/llgrammar_gen.h + $(RM) llgrammar.tab.c llgrammar.tab.h +endif + +cscanner.c: cscanner.l + $(FLEX) $(LFLAGS) cscanner.l + $(CAT) flex.head lexyy.c flex.reset | $(SED) \ + -e 's/YYSTYPE/cgrammar_YYSTYPE/g' -e 's/lsllex/cgrammar_lsllex/g' \ + >cscanner.c + +Headers/flag_codes.gen: flags.def + grep "FLG_" flags.def > Headers/flag_codes.gen + +$(binDir)/splint$(EXEEXT): splint$(EXEEXT) + -$(RM) -f $(binDir)/splint$(EXEEXT) + $(CP) splint$(EXEEXT) $(binDir)/splint$(EXEEXT) + +up: clean + rm -f cgrammar.c llgrammar.c mtgrammar.c signature.c cscanner.c + + +clean: + -rm -f $(splint_OBJECTS) core *.core *~ + + +CLEANFILES = splint$(EXEEXT) $(binDir)/splint$(EXEEXT) + +%$O: %.c + $(CC) $(CFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) -c $< + +splint$(EXEEXT) : $(splint_OBJECTS) $(lcl_OBJECTS) + $(CC) $(OFLAG)$@ $^ $(LDFLAGS) + +list: + @echo "$(splint_OBJECTS)"