# # 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)"