tools/dmake: A few simple fixes. Commited the new Makefile

This commit is contained in:
Daniel Marjamäki 2009-01-06 20:12:59 +00:00
parent 2b671fef16
commit 149ab87931
2 changed files with 181 additions and 81 deletions

257
Makefile
View File

@ -1,89 +1,184 @@
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 CXXFLAGS=-Wall -pedantic -g
SRCS=$(TMPSRCS:%=src/%)
OBJS=$(SRCS:%.cpp=%.o)
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/%)
BIN = ${DESTDIR}/usr/bin
CFLAGS = -Wall -pedantic -g
all: ${OBJS} src/main.o
g++ $(CFLAGS) -o cppcheck $^ ###### Object Files
test: ${OBJS} test/testrunner.o test/testsuite.o ${TESTS}
g++ $(CFLAGS) -o testrunner $^ OBJECTS = src/checkbufferoverrun.o \
cppcheckexecutor.o: src/cppcheckexecutor.cpp src/cppcheckexecutor.h src/cppcheck.h src/errorlogger.h src/checkclass.o \
g++ $(CFLAGS) -c $*.cpp src/checkfunctionusage.o \
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 src/checkheaders.o \
g++ $(CFLAGS) -c $*.cpp src/checkmemoryleak.o \
main.o: src/main.cpp src/cppcheck.h src/settings.h src/errorlogger.h src/checkother.o \
g++ $(CFLAGS) -c $*.cpp src/cppcheck.o \
checkbufferoverrun.o: src/checkbufferoverrun.cpp src/checkbufferoverrun.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/cppcheckexecutor.o \
g++ $(CFLAGS) -c $*.cpp src/errormessage.o \
checkclass.o: src/checkclass.cpp src/checkclass.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/filelister.o \
g++ $(CFLAGS) -c $*.cpp src/main.o \
checkfunctionusage.o: src/checkfunctionusage.cpp src/checkfunctionusage.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/preprocessor.o \
g++ $(CFLAGS) -c $*.cpp src/settings.o \
checkheaders.o: src/checkheaders.cpp src/checkheaders.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/token.o \
g++ $(CFLAGS) -c $*.cpp src/tokenize.o
checkmemoryleak.o: src/checkmemoryleak.cpp src/checkmemoryleak.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CFLAGS) -c $*.cpp TESTOBJ = test/testbufferoverrun.o \
checkother.o: src/checkother.cpp src/checkother.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h test/testcharvar.o \
g++ $(CFLAGS) -c $*.cpp test/testclass.o \
filelister.o: src/filelister.cpp src/filelister.h test/testconstructors.o \
g++ $(CFLAGS) -c $*.cpp test/testdivision.o \
preprocessor.o: src/preprocessor.cpp src/preprocessor.h src/errorlogger.h src/token.h src/tokenize.h test/testfilelister.o \
g++ $(CFLAGS) -c $*.cpp test/testfunctionusage.o \
settings.o: src/settings.cpp src/settings.h test/testincompletestatement.o \
g++ $(CFLAGS) -c $*.cpp test/testmemleak.o \
errormessage.o: src/errormessage.cpp src/errormessage.h test/testmemleakmp.o \
g++ $(CFLAGS) -c $*.cpp test/testother.o \
testbufferoverrun.o: test/testbufferoverrun.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkbufferoverrun.h test/testsuite.h test/testpreprocessor.o \
g++ $(CFLAGS) -c $*.cpp test/testredundantif.o \
testcharvar.o: test/testcharvar.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h test/testrunner.o \
g++ $(CFLAGS) -c $*.cpp test/testsimplifytokens.o \
testclass.o: test/testclass.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h test/testsuite.o \
g++ $(CFLAGS) -c $*.cpp test/testtoken.o \
testconstructors.o: test/testconstructors.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h test/testtokenize.o \
g++ $(CFLAGS) -c $*.cpp test/testunusedprivfunc.o \
testdivision.o: test/testdivision.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h test/testunusedvar.o \
g++ $(CFLAGS) -c $*.cpp src/checkbufferoverrun.o \
testfunctionusage.o: test/testfunctionusage.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h test/testsuite.h src/checkfunctionusage.h src/checkclass.o \
g++ $(CFLAGS) -c $*.cpp src/checkfunctionusage.o \
testincompletestatement.o: test/testincompletestatement.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h src/checkheaders.o \
g++ $(CFLAGS) -c $*.cpp src/checkmemoryleak.o \
testother.o: test/testother.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h src/checkother.o \
g++ $(CFLAGS) -c $*.cpp src/cppcheck.o \
testmemleak.o: test/testmemleak.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h src/cppcheckexecutor.o \
g++ $(CFLAGS) -c $*.cpp src/errormessage.o \
testmemleakmp.o: test/testmemleakmp.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h src/filelister.o \
g++ $(CFLAGS) -c $*.cpp src/preprocessor.o \
testpreprocessor.o: test/testpreprocessor.cpp test/testsuite.h src/errorlogger.h src/preprocessor.h src/settings.o \
g++ $(CFLAGS) -c $*.cpp src/token.o \
testredundantif.o: test/testredundantif.cpp test/testsuite.h src/errorlogger.h src/checkother.h src/tokenize.o
g++ $(CFLAGS) -c $*.cpp
testrunner.o: test/testrunner.cpp test/testsuite.h src/errorlogger.h
g++ $(CFLAGS) -c $*.cpp ###### Targets
testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h
g++ $(CFLAGS) -c $*.cpp cppcheck: $(OBJECTS)
testsuite.o: test/testsuite.cpp test/testsuite.h src/errorlogger.h g++ $(CXXFLAGS) -o cppcheck $(OBJECTS)
g++ $(CFLAGS) -c $*.cpp
testtoken.o: test/testtoken.cpp test/testsuite.h src/errorlogger.h src/token.h testrunner: $(TESTOBJ)
g++ $(CFLAGS) -c $*.cpp g++ $(CXXFLAGS) -o testrunner $(TESTOBJ)
testtokenize.o: test/testtokenize.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h
g++ $(CFLAGS) -c $*.cpp all: cppcheck testrunner
testunusedprivfunc.o: test/testunusedprivfunc.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
g++ $(CFLAGS) -c $*.cpp test: testrunner
testunusedvar.o: test/testunusedvar.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h
g++ $(CFLAGS) -c $*.cpp
testfilelister.o: test/testfilelister.cpp src/filelister.h
g++ $(CFLAGS) -c $*.cpp
token.o: src/token.cpp src/token.h
g++ $(CFLAGS) -c $*.cpp
tokenize.o: src/tokenize.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/filelister.h
g++ $(CFLAGS) -c $*.cpp
clean: clean:
rm -f src/*.o test/*.o testrunner cppcheck rm -f src/*.o test/*.o testrunner cppcheck
install: cppcheck install: cppcheck
install -d ${BIN} install -d ${BIN}
install cppcheck ${BIN} install cppcheck ${BIN}
###### Build
src/checkbufferoverrun.o: src/checkbufferoverrun.cpp src/checkbufferoverrun.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o src/checkbufferoverrun.o src/checkbufferoverrun.cpp
src/checkclass.o: src/checkclass.cpp src/checkclass.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o src/checkclass.o src/checkclass.cpp
src/checkfunctionusage.o: src/checkfunctionusage.cpp src/checkfunctionusage.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o src/checkfunctionusage.o src/checkfunctionusage.cpp
src/checkheaders.o: src/checkheaders.cpp src/checkheaders.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o src/checkheaders.o src/checkheaders.cpp
src/checkmemoryleak.o: src/checkmemoryleak.cpp src/checkmemoryleak.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o src/checkmemoryleak.o src/checkmemoryleak.cpp
src/checkother.o: src/checkother.cpp src/checkother.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o src/checkother.o src/checkother.cpp
src/cppcheck.o: src/cppcheck.cpp src/cppcheck.h src/settings.h src/errorlogger.h src/checkfunctionusage.h src/tokenize.h src/token.h src/preprocessor.h src/checkmemoryleak.h src/checkbufferoverrun.h src/checkclass.h src/checkheaders.h src/checkother.h src/filelister.h
g++ $(CXXFLAGS) -c -o src/cppcheck.o src/cppcheck.cpp
src/cppcheckexecutor.o: src/cppcheckexecutor.cpp src/cppcheckexecutor.h src/errorlogger.h src/cppcheck.h src/settings.h src/checkfunctionusage.h src/tokenize.h src/token.h
g++ $(CXXFLAGS) -c -o src/cppcheckexecutor.o src/cppcheckexecutor.cpp
src/errormessage.o: src/errormessage.cpp src/errormessage.h
g++ $(CXXFLAGS) -c -o src/errormessage.o src/errormessage.cpp
src/filelister.o: src/filelister.cpp src/filelister.h
g++ $(CXXFLAGS) -c -o src/filelister.o src/filelister.cpp
src/main.o: src/main.cpp src/cppcheckexecutor.h src/errorlogger.h
g++ $(CXXFLAGS) -c -o src/main.o src/main.cpp
src/preprocessor.o: src/preprocessor.cpp src/preprocessor.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o src/preprocessor.o src/preprocessor.cpp
src/settings.o: src/settings.cpp src/settings.h
g++ $(CXXFLAGS) -c -o src/settings.o src/settings.cpp
src/token.o: src/token.cpp src/token.h
g++ $(CXXFLAGS) -c -o src/token.o src/token.cpp
src/tokenize.o: src/tokenize.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/filelister.h
g++ $(CXXFLAGS) -c -o src/tokenize.o src/tokenize.cpp
test/testbufferoverrun.o: test/testbufferoverrun.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkbufferoverrun.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testbufferoverrun.o test/testbufferoverrun.cpp
test/testcharvar.o: test/testcharvar.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testcharvar.o test/testcharvar.cpp
test/testclass.o: test/testclass.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testclass.o test/testclass.cpp
test/testconstructors.o: test/testconstructors.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testconstructors.o test/testconstructors.cpp
test/testdivision.o: test/testdivision.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testdivision.o test/testdivision.cpp
test/testfilelister.o: test/testfilelister.cpp test/testsuite.h src/errorlogger.h src/filelister.h
g++ $(CXXFLAGS) -c -o test/testfilelister.o test/testfilelister.cpp
test/testfunctionusage.o: test/testfunctionusage.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h test/testsuite.h src/checkfunctionusage.h
g++ $(CXXFLAGS) -c -o test/testfunctionusage.o test/testfunctionusage.cpp
test/testincompletestatement.o: test/testincompletestatement.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h
g++ $(CXXFLAGS) -c -o test/testincompletestatement.o test/testincompletestatement.cpp
test/testmemleak.o: test/testmemleak.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testmemleak.o test/testmemleak.cpp
test/testmemleakmp.o: test/testmemleakmp.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testmemleakmp.o test/testmemleakmp.cpp
test/testother.o: test/testother.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testother.o test/testother.cpp
test/testpreprocessor.o: test/testpreprocessor.cpp test/testsuite.h src/errorlogger.h src/preprocessor.h
g++ $(CXXFLAGS) -c -o test/testpreprocessor.o test/testpreprocessor.cpp
test/testredundantif.o: test/testredundantif.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testredundantif.o test/testredundantif.cpp
test/testrunner.o: test/testrunner.cpp test/testsuite.h src/errorlogger.h
g++ $(CXXFLAGS) -c -o test/testrunner.o test/testrunner.cpp
test/testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h
g++ $(CXXFLAGS) -c -o test/testsimplifytokens.o test/testsimplifytokens.cpp
test/testsuite.o: test/testsuite.cpp test/testsuite.h src/errorlogger.h
g++ $(CXXFLAGS) -c -o test/testsuite.o test/testsuite.cpp
test/testtoken.o: test/testtoken.cpp test/testsuite.h src/errorlogger.h src/token.h
g++ $(CXXFLAGS) -c -o test/testtoken.o test/testtoken.cpp
test/testtokenize.o: test/testtokenize.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h
g++ $(CXXFLAGS) -c -o test/testtokenize.o test/testtokenize.cpp
test/testunusedprivfunc.o: test/testunusedprivfunc.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
g++ $(CXXFLAGS) -c -o test/testunusedprivfunc.o test/testunusedprivfunc.cpp
test/testunusedvar.o: test/testunusedvar.cpp test/testsuite.h src/errorlogger.h src/tokenize.h src/settings.h src/token.h src/checkother.h
g++ $(CXXFLAGS) -c -o test/testunusedvar.o test/testunusedvar.cpp

View File

@ -78,6 +78,11 @@ int main()
fout << "\tg++ $(CXXFLAGS) -o testrunner $(TESTOBJ)\n\n"; fout << "\tg++ $(CXXFLAGS) -o testrunner $(TESTOBJ)\n\n";
fout << "all:\tcppcheck\ttestrunner\n\n"; fout << "all:\tcppcheck\ttestrunner\n\n";
fout << "test:\ttestrunner\n\n"; fout << "test:\ttestrunner\n\n";
fout << "clean:\n";
fout << "\trm -f src/*.o test/*.o testrunner cppcheck\n\n";
fout << "install:\tcppcheck\n";
fout << "\tinstall -d ${BIN}\n";
fout << "\tinstall cppcheck ${BIN}\n\n";
fout << "\n###### Build\n\n"; fout << "\n###### Build\n\n";