]> andersk Git - splint.git/blobdiff - src/Makefile
*** empty log message ***
[splint.git] / src / Makefile
index c4b34c464a149c7de437a1a488a86c065331e689..538f2853aca307e8d0aae32b5c1b021514ae7dc2 100644 (file)
@@ -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,10 +44,14 @@ 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 = ../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
+LCLINTNEW = lclint
+LCLINT = ../bin/lclint
 
 ###
 ### source files
@@ -63,13 +67,17 @@ 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}
 
 ###
 ### grammars
@@ -82,10 +90,10 @@ object: $(OBJ)
 
 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
@@ -93,26 +101,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 141 shift/reduce conflicts and 111 reduce/reduce conflicts.'
        @echo '//           (see cgrammar.y for explanation)'
-       @$(CAT) bison.head cgrammar.tab.c > cgrammar.c
+       @$(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 > Headers/cgrammar_tokens.h
+       @$(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
+       @$(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 > Headers/llgrammar_gen2.h
+       @$(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 > Headers/llgrammar_gen.h
+       @$(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
@@ -120,7 +141,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
@@ -135,41 +156,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 
+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 181 files)'
+       $(CC) $(CPPFLAGS) $(CFLAGS) -c $*.c
 
 ###
 ### alternatives (tests, releases, backups, etc.)
@@ -177,7 +212,35 @@ 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 cscanner.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/cscanner.c.der
+       cp lastversion maketags ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/
+       cp *.head *.reset ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/
+       cp cgrammar.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/cgrammar.c.der
+       cp llgrammar.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/llgrammar.c.der
+       cp signature.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/signature.c.der
+       cp mtgrammar.c ~/temp/lclint-`cat ${VERSION_NUMBER}`/src/mtgrammar.c.der
+       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* ../LICENSE ../README ../BUFFERCHECKING ~/temp/lclint-`cat ${VERSION_NUMBER}`/
+       cd ~/temp/lclint-`cat ${VERSION_NUMBER}`; mkdir bin
+       cd ~/temp/lclint-`cat ${VERSION_NUMBER}`; rm -r test/temp
+       cd ~/temp/lclint-`cat ${VERSION_NUMBER}`; rm -f *~ */*~ */*/*~ #* */#* */*/#* .#* */.#* */*/.# */*.core
+       cd ~/temp/lclint-`cat ${VERSION_NUMBER}`; rm -rf CVS */CVS */*/CVS */*/*/CVS */*/*/*/CVS
+       cd ~/temp/; tar czvf ~/public_html/lclint/lclint-`cat ~/LCLintDev/src/${VERSION_NUMBER}`.src.tgz lclint-`cat ~/LCLintDev/src/${VERSION_NUMBER}`
+       chmod 644 ~/public_html/lclint/lclint-`cat ${VERSION_NUMBER}`.src.tgz
+       ls -l ~/public_html/lclint/lclint-*.tgz
+       @echo "Made release lclint-`cat ${VERSION_NUMBER}`"
 
 opt :
 ifneq (,$(findstring csh, $(SHELL)))
@@ -248,19 +311,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)`
-
-
-Headers/flag_codes.h: flags
-
-flags: flags.def
-       grep "FLG_" flags.def > Headers/flag_codes.gen
-
+       @echo '//  Done Release'        
 ###
 ### cleaning
 ###
@@ -292,7 +350,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
 
 ###
@@ -300,7 +358,7 @@ up:
 ###
 
 depend:
-       $(MAKEDEPEND) $(CINCLUDES) $(CFLAGS) -f Makefile.depend $(SRC) $(GRAMS)
+       $(MAKEDEPEND) $(CINCLUDES) $(CPPFLAGS) -f Makefile.depend $(SRC) $(GRAMS)
 
 ###
 ### analysing dependancies takes a long time and doesn't work terribly
@@ -320,19 +378,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
 ### 
 
-#lint: 
-#      $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +forcehints +singleinclude -nestcomments -fcnuse -allimponly -modglobsnomods -uniondef -exportlocal -exportheader -abstract -namechecks -protoparammatch -boolops $(ALLSRC) -dump  lclint
+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 -exportheader -abstract -namechecks -protoparammatch -temptrans -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; \
-       gmake -C ..
+       ${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
This page took 0.049822 seconds and 4 git commands to generate.