]> andersk Git - splint.git/blobdiff - src/Makefile
Merged code tree with Dave Evans's version. Many changes to numberous to list....
[splint.git] / src / Makefile
index c4b34c464a149c7de437a1a488a86c065331e689..0ff9bdd32db29be445e204daf1409d991d81f2d2 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
 
 ###
@@ -46,8 +46,10 @@ include Makefile.sys
 
 CHECK = 0 ### 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
+LCLINT = ../bin/lclint
 
 ###
 ### source files
@@ -63,13 +65,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
@@ -83,9 +89,9 @@ 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
+       @$(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 > Headers/signature_gen.h
+       @$(CAT) bison.head signature.tab.h bison.reset > Headers/signature_gen.h
 else
        $(CP) signature.c.der signature.c
 endif
@@ -93,26 +99,46 @@ 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
+       @$(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
+       chmod 600 cgrammar.c 
+       chmod 600 Headers/cgrammar_tokens.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
+       chmod 600 mtgrammar.c 
+       chmod 600 Headers/mtgrammar_tokens.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
+       chmod 400 llgrammar.c 
+       chmod 400 Headers/llgrammar_gen.h
+       chmod 400 Headers/llgrammar_gen2.h
 else
        $(CP) llgrammar.c.der llgrammar.c
 endif
@@ -120,7 +146,9 @@ endif
 cscanner.c : cscanner.c.der cscanner.l
 ifdef FLEX                             
        $(FLEX) $(LFLAGS) cscanner.l 
-       $(CAT) flex.head lex.yy.c > cscanner.c
+       -chmod 600 cscanner.c
+       $(CAT) flex.head lex.yy.c flex.reset > cscanner.c
+       chmod 400 cscanner.c
 else
        $(CP) cscanner.c.der cscanner.c
 endif
@@ -135,41 +163,51 @@ 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
+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/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 161 files)'
+       $(CC) $(CFLAGS) -c $*.c
 
 ###
 ### alternatives (tests, releases, backups, etc.)
@@ -177,7 +215,22 @@ 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 ~/lclint-dev/src/${VERSION_NUMBER}`-beta.tgz *
+       chmod 644 ~/public_html/lclint/lclint-`cat ${VERSION_NUMBER}`.tgz
 
 opt :
 ifneq (,$(findstring csh, $(SHELL)))
@@ -248,19 +301,12 @@ endif
        @echo '//  Updating version information'
        @$(MAKE) -e updateversion
        @echo '//  Updating local constants'
-###    @$(MAKE) -e localconstants
+       @$(MAKE) -e localconstants
        @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 +338,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
 
 ###
@@ -320,19 +366,71 @@ 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
 
 lint: 
-       $(LCLINT) -f lclint.lclintrc $(CPPFLAGS) +forcehints +singleinclude -exportlocal -exportheader -abstract -namechecks -protoparammatch -temptrans -boolops $(ALLSRC) -dump  lclint
+       ../bin/lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude $(ALLSRC) -dump lclint +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -supcounts -fcnuse -exportlocal -constuse 
+
+# -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
 
+linttest: 
+       lclint -f lclint.lclintrc $(CPPFLAGS) +singleinclude +forcehints -misplacedsharequal +showsourceloc -unrecogcomments -fcnuse -constuse -exportlocal -supcounts test.c
+
+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/ +singleinclude $(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 ..; ${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.044662 seconds and 4 git commands to generate.