diff --git a/Makefile b/Makefile index 950bc8891..dd8644326 100644 --- a/Makefile +++ b/Makefile @@ -68,16 +68,16 @@ all: cppcheck testrunner tools test: testrunner -tools: errmsg dmake +tools: tools/errmsg tools/dmake -errmsg: tools/errmsg.cpp - g++ -Wall -pedantic -o errmsg tools/errmsg.cpp +tools/errmsg: tools/errmsg.cpp + g++ $(CXXFLAGS) -o tools/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 +tools/dmake: tools/dmake.cpp src/filelister.cpp src/filelister.h + g++ $(CXXFLAGS) -o tools/dmake tools/dmake.cpp src/filelister.cpp clean: - rm -f src/*.o test/*.o testrunner cppcheck dmake errmsg + rm -f src/*.o test/*.o testrunner cppcheck tools/dmake tools/errmsg install: cppcheck install -d ${BIN} @@ -191,7 +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 +src/errormessage.h: tools/errmsg + tools/errmsg mv errormessage.h src/ diff --git a/tools/dmake.cpp b/tools/dmake.cpp index b40dd33bb..2dc6e2a04 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -101,13 +101,13 @@ int main() fout << "\tg++ $(CXXFLAGS) -o testrunner $(TESTOBJ)\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 << "tools:\ttools/errmsg\ttools/dmake\n\n"; + fout << "tools/errmsg:\ttools/errmsg.cpp\n"; + fout << "\tg++ $(CXXFLAGS) -o tools/errmsg tools/errmsg.cpp\n\n"; + fout << "tools/dmake:\ttools/dmake.cpp\tsrc/filelister.cpp\tsrc/filelister.h\n"; + fout << "\tg++ $(CXXFLAGS) -o tools/dmake tools/dmake.cpp src/filelister.cpp\n\n"; fout << "clean:\n"; - fout << "\trm -f src/*.o test/*.o testrunner cppcheck dmake errmsg\n\n"; + fout << "\trm -f src/*.o test/*.o testrunner cppcheck tools/dmake tools/errmsg\n\n"; fout << "install:\tcppcheck\n"; fout << "\tinstall -d ${BIN}\n"; fout << "\tinstall cppcheck ${BIN}\n\n"; @@ -134,8 +134,8 @@ 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 << "src/errormessage.h:\ttools/errmsg\n"; + fout << "\ttools/errmsg\n"; fout << "\tmv errormessage.h src/\n\n"; return 0;