make: updated the make so that the tools are built with "make all". And added the errormessage.h generator to the makefile also

This commit is contained in:
Daniel Marjamäki 2009-01-09 19:28:55 +00:00
parent 7851b1042f
commit f83741503e
2 changed files with 24 additions and 4 deletions

View File

@ -64,12 +64,20 @@ cppcheck: $(OBJECTS)
testrunner: $(TESTOBJ)
g++ $(CXXFLAGS) -o testrunner $(TESTOBJ)
all: cppcheck testrunner
all: cppcheck testrunner tools
test: testrunner
tools: errmsg dmake
errmsg: tools/errmsg.cpp
g++ -Wall -pedantic -o errmsg tools/errmsg.cpp
dmake: tools/dmake.cpp src/filelister.cpp src/filelister.h
g++ -Wall -pedantic -o dmake tools/dmake.cpp src/filelister.cpp
clean:
rm -f src/*.o test/*.o testrunner cppcheck
rm -f src/*.o test/*.o testrunner cppcheck dmake errmsg
install: cppcheck
install -d ${BIN}
@ -183,3 +191,7 @@ test/testunusedprivfunc.o: test/testunusedprivfunc.cpp src/tokenize.h src/settin
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
src/errormessage.h: errmsg
./errmsg
mv errormessage.h src/

View File

@ -99,10 +99,15 @@ int main()
fout << "\tg++ $(CXXFLAGS) -o cppcheck $(OBJECTS)\n\n";
fout << "testrunner:\t$(TESTOBJ)\n";
fout << "\tg++ $(CXXFLAGS) -o testrunner $(TESTOBJ)\n\n";
fout << "all:\tcppcheck\ttestrunner\n\n";
fout << "all:\tcppcheck\ttestrunner\ttools\n\n";
fout << "test:\ttestrunner\n\n";
fout << "tools:\terrmsg\tdmake\n\n";
fout << "errmsg:\ttools/errmsg.cpp\n";
fout << "\tg++ -Wall -pedantic -o errmsg tools/errmsg.cpp\n\n";
fout << "dmake:\ttools/dmake.cpp\tsrc/filelister.cpp\tsrc/filelister.h\n";
fout << "\tg++ -Wall -pedantic -o dmake tools/dmake.cpp src/filelister.cpp\n\n";
fout << "clean:\n";
fout << "\trm -f src/*.o test/*.o testrunner cppcheck\n\n";
fout << "\trm -f src/*.o test/*.o testrunner cppcheck dmake errmsg\n\n";
fout << "install:\tcppcheck\n";
fout << "\tinstall -d ${BIN}\n";
fout << "\tinstall cppcheck ${BIN}\n\n";
@ -129,6 +134,9 @@ int main()
fout << "\n\tg++ $(CXXFLAGS) -c -o " << objfile(testfiles[i]) << " " << testfiles[i] << "\n\n";
}
fout << "src/errormessage.h:\terrmsg\n";
fout << "\t./errmsg\n";
fout << "\tmv errormessage.h src/\n\n";
return 0;
}