2009-01-06 15:18:36 +01:00
|
|
|
TMPSRCS=checkbufferoverrun.cpp checkclass.cpp checkheaders.cpp checkmemoryleak.cpp checkfunctionusage.cpp checkother.cpp filelister.cpp preprocessor.cpp tokenize.cpp cppcheck.cpp settings.cpp token.cpp cppcheckexecutor.cpp errormessage.cpp
|
|
|
|
SRCS=$(TMPSRCS:%=src/%)
|
2008-11-13 21:48:25 +01:00
|
|
|
OBJS=$(SRCS:%.cpp=%.o)
|
2009-01-06 15:18:36 +01:00
|
|
|
TMPTESTS=testbufferoverrun.o testcharvar.o testclass.o testconstructors.o testdivision.o testfunctionusage.o testincompletestatement.o testother.o testmemleak.o testmemleakmp.o testpreprocessor.o testredundantif.o testsimplifytokens.o testtokenize.o testtoken.o testunusedprivfunc.o testunusedvar.o testfilelister.o
|
|
|
|
TESTS=$(TMPTESTS:%=test/%)
|
2008-11-13 21:48:25 +01:00
|
|
|
BIN = ${DESTDIR}/usr/bin
|
2008-12-25 18:11:01 +01:00
|
|
|
CFLAGS = -Wall -pedantic -g
|
2008-11-13 21:48:25 +01:00
|
|
|
|
2009-01-06 15:18:36 +01:00
|
|
|
all: ${OBJS} src/main.o
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -o cppcheck $^
|
2009-01-06 15:18:36 +01:00
|
|
|
test: ${OBJS} test/testrunner.o test/testsuite.o ${TESTS}
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -o testrunner $^
|
2009-01-06 15:18:36 +01:00
|
|
|
cppcheckexecutor.o: src/cppcheckexecutor.cpp src/cppcheckexecutor.h src/cppcheck.h src/errorlogger.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
cppcheck.o: src/cppcheck.cpp src/cppcheck.h src/settings.h src/errorlogger.h src/preprocessor.h src/tokenize.h src/token.h src/checkmemoryleak.h src/checkbufferoverrun.h src/checkclass.h src/checkheaders.h src/checkother.h src/checkfunctionusage.h src/filelister.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
main.o: src/main.cpp src/cppcheck.h src/settings.h src/errorlogger.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
checkbufferoverrun.o: src/checkbufferoverrun.cpp src/checkbufferoverrun.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
checkclass.o: src/checkclass.cpp src/checkclass.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
checkfunctionusage.o: src/checkfunctionusage.cpp src/checkfunctionusage.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
checkheaders.o: src/checkheaders.cpp src/checkheaders.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
checkmemoryleak.o: src/checkmemoryleak.cpp src/checkmemoryleak.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
checkother.o: src/checkother.cpp src/checkother.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
filelister.o: src/filelister.cpp src/filelister.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
preprocessor.o: src/preprocessor.cpp src/preprocessor.h src/errorlogger.h src/token.h src/tokenize.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
settings.o: src/settings.cpp src/settings.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
errormessage.o: src/errormessage.cpp src/errormessage.h
|
2009-01-03 14:51:55 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testbufferoverrun.o: test/testbufferoverrun.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkbufferoverrun.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testcharvar.o: test/testcharvar.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testclass.o: test/testclass.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testconstructors.o: test/testconstructors.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testdivision.o: test/testdivision.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testfunctionusage.o: test/testfunctionusage.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h test/testsuite.h src/checkfunctionusage.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testincompletestatement.o: test/testincompletestatement.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testother.o: test/testother.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testmemleak.o: test/testmemleak.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testmemleakmp.o: test/testmemleakmp.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testpreprocessor.o: test/testpreprocessor.cpp test/testsuite.h src/errorlogger.h src/preprocessor.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testredundantif.o: test/testredundantif.cpp test/testsuite.h src/errorlogger.h src/checkother.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testrunner.o: test/testrunner.cpp test/testsuite.h src/errorlogger.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testsuite.o: test/testsuite.cpp test/testsuite.h src/errorlogger.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testtoken.o: test/testtoken.cpp test/testsuite.h src/errorlogger.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testtokenize.o: test/testtokenize.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testunusedprivfunc.o: test/testunusedprivfunc.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testunusedvar.o: test/testunusedvar.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
testfilelister.o: test/testfilelister.cpp src/filelister.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
token.o: src/token.cpp src/token.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2009-01-06 15:18:36 +01:00
|
|
|
tokenize.o: src/tokenize.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/filelister.h
|
2008-12-25 18:11:01 +01:00
|
|
|
g++ $(CFLAGS) -c $*.cpp
|
2008-11-23 21:12:43 +01:00
|
|
|
|
2008-11-13 21:48:25 +01:00
|
|
|
clean:
|
2009-01-06 15:18:36 +01:00
|
|
|
rm -f src/*.o test/*.o testrunner cppcheck
|
2008-11-13 21:48:25 +01:00
|
|
|
install: cppcheck
|
|
|
|
install -d ${BIN}
|
|
|
|
install cppcheck ${BIN}
|
2008-11-23 21:12:43 +01:00
|
|
|
|