From f83741503e783e9a9fcfb0eb465f8e1ff5f1e838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 9 Jan 2009 19:28:55 +0000 Subject: [PATCH] make: updated the make so that the tools are built with "make all". And added the errormessage.h generator to the makefile also --- Makefile | 16 ++++++++++++++-- tools/dmake.cpp | 12 ++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a16afab4d..950bc8891 100644 --- a/Makefile +++ b/Makefile @@ -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/ + diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 0a9f8ff21..b40dd33bb 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -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; }