X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/3e3ec46998ea67d6742eb30afc16058c5537004e..5b99bfd6792ab9229bb5b1d9048833d21b22ecef:/src/Makefile.am diff --git a/src/Makefile.am b/src/Makefile.am index 0f2956f..86f467f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,23 +36,24 @@ LISTSRC = clauseStack.c filelocStack.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 \ +CSRC = context.c 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 + metaStateExpression.c metaStateSpecifier.c functionConstraint.c \ + pointers.c cscannerHelp.c -SPLINTSRC = exprNode.c exprChecks.c llmain.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 +GLOBSRC = globals.c flags.c general.c osd.c reader.c mtreader.c -GRAMSRC = cgrammar.c cscanner.c mtscanner.c mtreader.c mtgrammar.c +GRAMSRC = cgrammar.c cscanner.c mtscanner.c mtgrammar.c llgrammar.c signature.c -OVERFLOWCHSRC = constraintGeneration.c constraintTerm.c \ +OVERFLOWCHSRC = constraintList.c constraintResolve.c \ + constraintGeneration.c constraintTerm.c \ constraintExprData.c constraintExpr.c constraint.c \ - constraintList.c constraintResolve.c \ - constraintOutput.c loopHeuristics.c + loopHeuristics.c GENERALSRC = exprData.c cstring.c fileloc.c message.c inputStream.c \ fileTable.c cstringTable.c valueTable.c stateValue.c \ @@ -79,8 +80,6 @@ LCLONLYSRC = usymtab_interface.c abstract.c ltoken.c lclscanline.c \ LSLSRC = tokentable.c scan.c scanline.c lslparse.c \ lh.c checking.c lclctypes.c imports.c lslinit.c syntable.c -LCLGRAMSRC = llgrammar.c signature.c - LCLSETSRC = lsymbolSet.c sigNodeSet.c lslOpSet.c sortSet.c LCLLISTSRC = initDeclNodeList.c sortList.c declaratorInvNodeList.c \ @@ -92,7 +91,6 @@ LCLLISTSRC = initDeclNodeList.c sortList.c declaratorInvNodeList.c \ varDeclarationNodeList.c varNodeList.c quantifierNodeList.c \ replaceNodeList.c importNodeList.c - HEADERSRC = Headers/abstBodyNode.h Headers/ltokenList.h \ Headers/abstract.h Headers/macrocache.h \ Headers/abstractNode.h Headers/mapping.h \ @@ -143,7 +141,7 @@ HEADERSRC = Headers/abstBodyNode.h Headers/ltokenList.h \ Headers/declaratorInvNodeList.h Headers/pairNodeList.h \ Headers/declaratorNode.h Headers/paramNode.h \ Headers/declaratorNodeList.h Headers/paramNodeList.h \ - Headers/dmalloc.h Headers/portab.h \ + Headers/dmalloc.h Headers/osd.h \ Headers/ekind.h Headers/pp.h \ Headers/enumNameList.h Headers/privateNode.h \ Headers/enumNameSList.h Headers/programNode.h \ @@ -155,7 +153,7 @@ HEADERSRC = Headers/abstBodyNode.h Headers/ltokenList.h \ Headers/exprNode.h Headers/quantifierNode.h \ Headers/exprNodeList.h Headers/quantifierNodeList.h \ Headers/exprNodeSList.h Headers/randomNumbers.h \ - Headers/fcnNode.h Headers/rangeTable.h \ + Headers/fcnNode.h Headers/rcfiles.h \ Headers/fcnNodeList.h Headers/reader.h \ Headers/fileId.h Headers/refTable-branch.h \ Headers/fileIdList.h Headers/renamingNode.h \ @@ -176,13 +174,13 @@ HEADERSRC = Headers/abstBodyNode.h Headers/ltokenList.h \ Headers/general.h Headers/sortList.h \ Headers/genericTable.h Headers/sortSet.h \ Headers/globalList.h Headers/sortSetList.h \ - Headers/globalsClause.h Headers/source.h \ - Headers/globals.h Headers/specialClauses.h \ + Headers/globalsClause.h \ + Headers/globals.h \ Headers/globSet.h Headers/sRef.h \ Headers/gram.h Headers/sRefList.h \ Headers/guardSet.h Headers/sRefSet.h \ Headers/handle.h Headers/sRefSetList.h \ - Headers/hashTable.h Headers/sRefSetStack.h \ + Headers/sRefSetStack.h \ Headers/idDecl.h Headers/sRefTable.h \ Headers/idDeclList.h Headers/stateClause.h \ Headers/importNode.h Headers/stateClauseList.h \ @@ -213,11 +211,11 @@ HEADERSRC = Headers/abstBodyNode.h Headers/ltokenList.h \ Headers/letDeclNodeList.h Headers/typeNameNodeList.h \ Headers/lh.h Headers/typeNamePack.h \ Headers/limwr.h Headers/typeNode.h \ - Headers/llbasic.h Headers/uentry.h \ + Headers/uentry.h \ Headers/llerror.h Headers/uentryList.h \ Headers/llglobals.h Headers/usymId.h \ Headers/llgrammar2.h Headers/usymIdSet.h \ - Headers/llgrammar_gen2.h Headers/usymtab-branch.h \ + Headers/llgrammar_gen2.h \ Headers/llgrammar_gen.h Headers/usymtab.h \ Headers/llgrammar.h Headers/usymtab_interface.h \ Headers/llmain.h Headers/valueMatrix.h \ @@ -230,14 +228,20 @@ HEADERSRC = Headers/abstBodyNode.h Headers/ltokenList.h \ Headers/lsymbol.h Headers/version.h \ Headers/lsymbolList.h Headers/warnClause.h \ Headers/lsymbolSet.h Headers/ynm.h \ - Headers/ltoken.h Headers/splintMacros.nf + Headers/ltoken.h Headers/splintMacros.nf \ + Headers/typeId.h \ + Headers/pointers.h Headers/mstring.h Headers/help.h + IFILES = ctbase.i cttable.i exprDataQuite.i ## Non-built files we need to distribute -EXTRA_DIST = DATE $(BISON_SRC) bison.head bison.reset $(HEADERSRC) \ +EXTRA_DIST = $(BISON_SRC) bison.head bison.reset $(HEADERSRC) \ flags.def cscanner.l flex.head flex.reset $(IFILES) \ + .splintrc LICENSE \ + Headers/cscannerHelp.h \ Headers/256_random_numbers.nf Headers/splintMacros.nf Headers/reservedNames.nf +#Makefile.binary.am Makefile.binary.in #Files that are used on systems that do not have bison or yacc @@ -246,19 +250,18 @@ DER_BISON_FILES = signature.c.der cgrammar.c.der mtgrammar.c.der \ DER_FILES = $(DER_BISON_FILES) -COMMONSRC = $(OVERFLOWCHSRC) $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \ +COMMONSRC = $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \ $(GLOBSRC) $(IFACESRC) $(LISTSRC) $(SETSRC) $(METASTATESRC) -ALLSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC) +ALLSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) $(OVERFLOWCHSRC) $(DER_FILES) $(HEADERSRC) #files to run Splint on -LINTSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) +LINTSRC = $(COMMONSRC) $(SPLINTSRC) +# cscanner.c cgrammar.c #ALLSRC = $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC) -LCLSRC = $(LCLSETSRC) $(LCLLISTSRC) $(LSLSRC) $(CMNSRC) $(LCLONLYSRC) \ - $(LCLGRAMSRC) - +LCLSRC = $(LCLSETSRC) $(LCLLISTSRC) $(LSLSRC) $(CMNSRC) $(LCLONLYSRC) lcl_SOURCES = $(LCLSRC) splint_SOURCES = $(ALLSRC) @@ -282,10 +285,24 @@ BUILT_SOURCES = Headers/signature_gen.h Headers/cgrammar_tokens.h \ ## Grammars +signature.c.der: + @if test x$(BISON) = xno; then \ + echo "Cannot make signature.c.der because bison is not here" \ + 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 || true; \ + $(CAT) bison.head signature.tab.h bison.reset >Headers/signature_gen.h; \ + $(RM) signature.tab.c signature.tab.h; \ + fi + Headers/signature_gen.h signature.c: signature.c.der signature.y - if test x$(BISON) = xno; then \ + @if test x$(BISON) = xno; then \ $(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; \ @@ -296,17 +313,17 @@ Headers/signature_gen.h signature.c: signature.c.der signature.y ## 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 - if test x$(BISON) = xno; then \ +Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y bison.head bison.reset + @if test x$(BISON) = xno; then \ $(CP) cgrammar.c.der cgrammar.c; \ else \ - echo '* Expect 141 shift/reduce conflicts and 111 reduce/reduce conflicts.'; \ - echo '* (see cgrammar.y for explanation)'; \ + echo '* Making cgrammar.c'; \ + echo '* Note: Expect 157 shift/reduce conflicts and 123 reduce/reduce conflicts. (see cgrammar.y for explanation)'; \ $(BISON) $(YFLAGS) cgrammar.y; \ - $(CAT) bison.head cgrammar.tab.c bison.reset >cgrammar.c; \ + $(CAT) bison.head cgrammar.tab.c bison.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > 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 >Headers/cgrammar_tokens.h; \ + $(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak || true; \ + $(CAT) bison.head cgrammar.tab.h bison.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > Headers/cgrammar_tokens.h; \ $(RM) cgrammar.tab.c cgrammar.tab.h; \ fi @@ -314,9 +331,11 @@ Headers/cgrammar_tokens.h cgrammar.c: cgrammar.c.der cgrammar.y ## also removed the dependency for this file on mtgrammary.c Headers/mtgrammar_tokens.h mtgrammar.c: mtgrammar.y - if test x$(BISON) = xno; then \ + @if test x$(BISON) = xno; then \ $(CP) mtgrammar.c.der mtgrammar.c; \ else \ + echo '* Making mtgrammar.c'; \ + echo '* Note: 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; \ @@ -328,10 +347,11 @@ Headers/mtgrammar_tokens.h mtgrammar.c: mtgrammar.y ## 11/29/001 drl added copy so that the file llgrammar.c.der is created Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der llgrammar.y - if test x$(BISON) = xno; then \ + @if test x$(BISON) = xno; then \ $(CP) llgrammar.c.der llgrammar.c; \ else \ - echo '* Expect 2 shift/reduce conflicts'; \ + echo '* Making llgrammar.c'; \ + echo '* Note: 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; \ @@ -344,10 +364,12 @@ Headers/llgrammar_gen.h Headers/llgrammar_gen2.h llgrammar.c: llgrammar.c.der ll cscanner.c: cscanner.l $(LEX) $(LFLAGS) cscanner.l - $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset > cscanner.c + $(CAT) flex.head @LEX_OUTPUT_ROOT@.c flex.reset | $(SED) 's/YYSTYPE/cgrammar_YYSTYPE/g' | $(SED) 's/lsllex/cgrammar_lsllex/g' > cscanner.c Headers/flag_codes.gen: flags.def grep "FLG_" flags.def > Headers/flag_codes.gen + $(MAKE) + cd ../lib; $(MAKE) ## Checking rules @@ -361,7 +383,11 @@ nocheck: .PHONY: test test: - cd ../test; ${MAKE} --no-print-directory + ${MAKE} ; cd ../test; ${MAKE} --no-print-directory + +.PHONY: libs +libs: + ${MAKE} ; cd ../lib; ${MAKE} --no-print-directory ### Automake generates wrong tags .PHONY: etags @@ -371,15 +397,47 @@ etags: lintnew: splintme splintme: - ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(LCLSRC) -dump lclint \ - +forcehints -misplacedsharequal +showsourceloc -unrecogcomments \ - -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw + ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(OVERFLOWCHSRC) $(LINTSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw -mts tainted + +splintmebounds: + ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(OVERFLOWCHSRC) $(LINTSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw -mts tainted +bounds +impboundsconstraints + +splintmesupcounts: + ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(OVERFLOWCHSRC) $(LINTSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -incondefs -exportlocal -supcounts -constuse -mts file -mts filerw lintbuffercheck: - ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(LCLSRC) -dump lclint \ - +forcehints -misplacedsharequal +showsourceloc -unrecogcomments \ - -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +arraybounds +arrayboundsread +implictconstraint + ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(OVERFLOWCHSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +bounds -DLINTBUFFERCHECK + +valsplint: + valgrind -v --leak-resolution=high --num-callers=20 --show-reachable=no --leak-check=yes ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(OVERFLOWCHSRC) $(LCLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw + + +splintsome: + ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude lcllib.c -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +partial + +# drl changed to use # for comment +#/* $(LINTSRC) $(LCLSRC)*/ + +splinttest: + ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude test.c +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -incondefs -exportlocal -constuse -mts file -mts filerw +keep +supcounts +partial -null + +binDir = bin + +all: splint$(EXEEXT) ../$(top_builddir)/$(binDir)/splint$(EXEEXT) + +../$(top_builddir)/$(binDir)/splint$(EXEEXT): splint$(EXEEXT) + -$(RM) -f $(top_builddir)/$(binDir)/splint$(EXEEXT) + ln -s $(top_builddir)/src/splint$(EXEEXT) $(top_builddir)/$(binDir)/splint$(EXEEXT) + +up: + -rm cgrammar.c llgrammar.c mtgrammar.c signature.c cscanner.c + $(MAKE) clean +CLEANFILES = splint$(EXEEXT) ../$(top_builddir)/$(binDir)/splint$(EXEEXT) -all: splint$(EXEEXT) -CLEANFILES = splint$(EXEEXT) +.c.o: + @echo "Compiling "$<"..."; \ + source='$<' object='$@' libtool=no \ + depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \ + $(CCDEPMODE) $(depcomp) \ + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<