X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/d46ce6a45c4df08223f6a9aeebb53ba1bd173925..7bf960677344d11a101697c76672a0be4b3759f2:/src/Makefile diff --git a/src/Makefile b/src/Makefile index 57960e6..aa3fca3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -30,7 +30,7 @@ ### .SUFFIXES : .h .c .o .l .check -.PHONY : all dorerelease retest rerelease homeversion +.PHONY : all dorerelease retest rerelease homeversion test updateversion .IGNORE : dorerelease retest rerelease ### @@ -44,9 +44,13 @@ include Makefile.sys ### (can't be 1 unless you have lclint already!) ### -CHECK = 0 ### set to 1 +CHECK = 1 ### set to 1 -LCLINT = //tmp/lclint-2.5q/bin/lclint +#LCLINT = //tmp/lclint-2.5q/bin/lclint +#LCLINTNEW = //afs/cert.org/usr/dlaroche/evLCLintDev/bin/lclint +#LCLINTNEW = /home/drl7x/evLCLintDev/evLCLintDev/bin/lclint +LCLINTNEW = /home/drl7x/stabletest/LCLintDev/bin/lclint +LCLINT = ../bin/lclint ### ### source files @@ -62,16 +66,18 @@ all : dorelease quick: lclint +nocheck: + CHECK=0; export CHECK; ${MAKE} -e + lclint : $(OBJ) @echo '// ' @echo '// Linking:' @echo '// ' $(CC) -o lclint $(OBJ) $(LINKFLAGS) -object: $(OBJ) +purify: ${OBJ} + purify ${CC} -o lclint ${OBJ} ${LINKFLAGS} -mylint: - CC="$(LCLINT)" ; export CC ; $(MAKE) -e object ### ### grammars ### @@ -83,10 +89,10 @@ mylint: 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 + $(BISON) $(YFLAGS) -p lsl signature.y + $(CAT) bison.head signature.tab.c bison.reset > signature.c + -$(MV) Headers/signature_gen.h Headers/signature_gen.bak + $(CAT) bison.head signature.tab.h bison.reset > Headers/signature_gen.h else $(CP) signature.c.der signature.c endif @@ -94,26 +100,39 @@ endif cgrammar.c : cgrammar.c.der cgrammar.y ifdef BISON $(BISON) $(YFLAGS) cgrammar.y - @echo '// Expect 119 shift/reduce conflicts and 114 reduce/reduce conflicts.' + @echo '// Expect 119 shift/reduce conflicts and 115 reduce/reduce conflicts.' @echo '// (see cgrammar.y for explanation)' - @$(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 + @$(CAT) bison.head cgrammar.tab.c bison.reset > cgrammar.c + -@$(MV) Headers/cgrammar_tokens.h Headers/cgrammar_tokens.bak + @$(CAT) bison.head cgrammar.tab.h bison.reset > Headers/cgrammar_tokens.h + @$(RM) cgrammar.tab.c cgrammar.tab.h else $(CP) cgrammar.c.der cgrammar.c endif +mtgrammar.c: mtgrammar.y +ifdef BISON + $(BISON) $(YFLAGS) -p mt mtgrammar.y + @$(CAT) bison.head mtgrammar.tab.c bison.reset > mtgrammar.c +# @$(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 +else + $(CP) mtgrammar.c.der mtgrammar.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 @echo '// Expect 2 shift/reduce conflicts.' - @$(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 + @$(CAT) bison.head llgrammar.tab.c bison.reset > llgrammar.c + -@$(MV) Headers/llgrammar_gen2.h Headers/llgrammar_gen2.bak + @$(CAT) bison.head llgrammar.tab.h bison.reset > Headers/llgrammar_gen2.h + -@$(MV) Headers/llgrammar_gen.h Headers/llgrammar_gen.bak + @$(CAT) bison.head llgrammar.tab.h bison.reset > Headers/llgrammar_gen.h + @$(RM) llgrammar.tab.c llgrammar.tab.h else $(CP) llgrammar.c.der llgrammar.c endif @@ -121,7 +140,7 @@ endif cscanner.c : cscanner.c.der cscanner.l ifdef FLEX $(FLEX) $(LFLAGS) cscanner.l - $(CAT) flex.head lex.yy.c > cscanner.c + $(CAT) flex.head lex.yy.c flex.reset > cscanner.c else $(CP) cscanner.c.der cscanner.c endif @@ -136,36 +155,55 @@ signature.o : signature.c cgrammar.o : cgrammar.c $(CC) $(CPPFLAGS) -c $*.c -llgrammar.o : llgrammar.c +cscanner.o : cscanner.c $(CC) $(CPPFLAGS) -c $*.c -cscanner.o : cscanner.c +mtgrammar.o : mtgrammar.c + $(CC) $(CPPFLAGS) -c $*.c + +llgrammar.o : llgrammar.c $(CC) $(CPPFLAGS) -c $*.c + ### ### header files dependant on grammars ### Headers/signature2.h : signature.c +Headers/signature_gen.h : signature.c Headers/cgrammar2.h : cgrammar.c +Headers/cgrammar_tokens.h : cgrammar.c Headers/llgrammar.h : llgrammar.c +Headers/mtgrammar_tokens.h : mtgrammar.c + +Headers/flag_codes.gen : flags.def + grep "FLG_" flags.def > Headers/flag_codes.gen ### ### defaults ### ### Flags for checking a single file -SINGLEFLAGS = +neverinclude -supcounts +partial -showsummary -load lclint.lcd +SINGLEFLAGS = -f lclint.lclintrc -supcounts +partial -unrecogcomments + +LCLINT29 = ${HOME}/lclint-2.9c/src/lclint .c.check: lclint.lcd lclint - $(LCLINT) $(LINTFLAGS) $(SINGLEFLAGS) $*.c + -../bin/lclint $(CPPFLAGS) $(LINTFLAGS) $(SINGLEFLAGS) -load lclint.lcd +neverinclude $*.c +showsourceloc -mts file +# -$(LCLINT29) $(CPPFLAGS) $(LINTFLAGS) $(SINGLEFLAGS) -load lclint.lcd +neverinclude $*.c +showsourceloc + +lcllib.c: Headers/llgrammar.h +clabstract.c: Headers/cgrammar_tokens.h +scan.c: Headers/signature2.h Headers/signature_gen.h +stateClause.c: Headers/cgrammar_tokens.h + .c.o: ifeq ($(CHECK), 1) - $(LCLINT) $(LINTFLAGS) $(SINGLEFLAGS) $*.c + ${MAKE} $*.check endif - @echo '// Compiling '$*.c' / compiled: '`$(OFILES)`' (of 120 files)' - @$(CC) $(CFLAGS) -c $*.c + @echo '// Compiling '$*.c' / compiled: '`$(OFILES)`' (of 161 files)' + $(CC) $(CFLAGS) -c $*.c ### ### alternatives (tests, releases, backups, etc.) @@ -173,7 +211,23 @@ endif ### -e option makes environment variables take precedence -.PHONY : test quicktest opt up +.PHONY : test quicktest opt up backup + +backup: + tar zcvf ../lclint-`date +%Y-%d-%m-%H-%M`.tgz ${ALLSRC} ${GRAMS} Headers/*.h *.i flags.def + +betarelease: + mkdir ~/temp/lclint-`cat ${VERSION_NUMBER}` + mkdir ~/temp/lclint-`cat ${VERSION_NUMBER}`/src + cp Makefile* ${ALLSRC} ${GRAMS} *.i flags.def ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/ + cp -r Headers ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/ + cp -r ../lib ~/temp/lclint-`cat ${VERSION_NUMBER}`/lib + cp -r ../imports ~/temp/lclint-`cat ${VERSION_NUMBER}`/imports + cp -r ../test ~/temp/lclint-`cat ${VERSION_NUMBER}`/test + cp ../configure ../Makefile* ../README ~/temp/lclint-`cat ${VERSION_NUMBER}`/ + cd ~/temp/lclint-`cat ${VERSION_NUMBER}`; rm */*.core ; tar zcvf ~/public_html/lclint/lclint-`cat ~/LCLintDev/src/${VERSION_NUMBER}`-beta.tgz * + chmod 644 ~/public_html/lclint/lclint-`cat ${VERSION_NUMBER}`.tgz + @echo "Make release lclint-`cat ${VERSION_NUMBER}` opt : ifneq (,$(findstring csh, $(SHELL))) @@ -183,7 +237,7 @@ else endif updateversion: - @$(MV) Headers/herald.h Headers/herald.last + -@$(MV) Headers/herald.h Headers/herald.last @echo '/* herald.h - created automatically by gmake updateversion */' > Headers/herald.h @echo '/*@constant observer char *LCL_VERSION;@*/' >> Headers/herald.h @echo '# define LCL_VERSION "LCLint '`cat $(VERSION_NUMBER)`' --- '`cat DATE`'"' \ @@ -244,17 +298,14 @@ endif @echo '// Updating version information' @$(MAKE) -e updateversion @echo '// Updating local constants' -### @$(MAKE) -e localconstants + @$(MAKE) -e localconstants + @echo '// Updating flags' + @$(MAKE) -e Headers/flag_codes.gen @echo '// ' @echo '// Compiling:' @echo '// ' @$(MAKE) -e opt - @echo '// Done Release '`cat $(VERSION_NUMBER)` - - -flags: flags.def - grep "FLG_" flags.def > Headers/flag_codes.gen - + @echo '// Done Release' ### ### cleaning ### @@ -269,6 +320,12 @@ flags: flags.def pristine: clean -$(RM) -f *.lcs *.lslo + -$(RM) signature.c signature.tab.c signature.tab.h + -$(RM) llgrammar.c llgrammar.tab.c llgrammar.tab.h + -$(RM) Headers/cgrammar_tokens.h + -$(RM) lex.yy.c + -$(RM) cgrammar.tab.h + -$(RM) Headers/*_gen.h* Headers/*_gen2.h* clean: tidy -$(RM) core lclint @@ -280,7 +337,7 @@ tidy: -$(RM) ,* .,* *.CKP *.BAK .emacs_[0-9]* core a.out *.*~ up: - -$(RM) cgrammar.c llgrammar.c signature.c cscanner.c + -$(RM) cgrammar.c llgrammar.c signature.c cscanner.c mtgrammar.c *.tab.[c,h] -$(RM) *.o ### @@ -308,14 +365,74 @@ depend: $(CHECKS): lclint.lcd +flags: flags.def + grep "FLG_" flags.def > Headers/flag_codes.gen + touch flags.c + ### ### other flags are in .lclintrc file ### +tags: + etags ${ALLSRC} ${GRAMS} Headers/*.h *.i + +lintweak: + ${HOME}/lclint-build/lclint-2.5q-freebsdbin/lclint -f weak.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) + +lintnew: + ${LCLINTNEW} -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw + +lintfcn: + ${LCLINTNEW} -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +fcnconstraint + +linttest: + ${LCLINTNEW} -f lclint.lclintrc $(CPPFLAGS) +singleinclude cpphash.c +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +partial + lint: - $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +forcehints +singleinclude -exportLocal -nestcomments -uniondef -abstract -namechecks -protoparammatch -boolops $(ALLSRC) -dump lclint + ../bin/lclint -f lclint.lclintrc llmain.c $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -supcounts -fcnuse -exportlocal -unrecogcomments -constuse -mts file + +# -mts file + +lintabstract: + lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -exportlocal -constuse test.c +partial + +# -fcnuse -constuse -exportlocal -supcounts + +lintnodestroy: + lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal -unrecogcomments -fcnuse -constuse -exportlocal -supcounts -compdestroy + +linttest1g: + lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude test.c -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -constuse -exportlocal -supcounts +partial + +lint26: + ${HOME}/lclint-2.6b/bin/lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -constuse -exportlocal -supcounts + +lint28: + ${HOME}/lclint-2.8a/bin/lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -constuse -exportlocal -supcounts + +lint29: + ${HOME}/lclint-2.9a/bin/lclint -f lclint.lclintrc $(CPPFLAGS) -larchpath .:${HOME}/lclint-2.9a/lib/ +singleinclue $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -constuse -exportlocal -supcounts + +lintm: + lclint-2.5m -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint + +test: + cp lclint ../bin/lclint + cd ../test ; ${MAKE} test + +libs: + cd ../lib ; ${MAKE} +myall: + -$(RM) -f ../bin/lclint; \ + ${MAKE} -C .. +ctype.o: ctbase.i cttable.i +#exprNode.o: exprData.i +ctype.c: ctbase.i cttable.i +tokentable.c: Headers/signature_gen.h +#lint: +# $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +forcehints +singleinclude -exportlocal -exportheader -abstract -namechecks -protoparammatch -temptrans -boolops $(ALLSRC) -dump lclint