Applied a patch by Mike Frysinger

The proper variable to use for the C++ compiler is $(CXX).  Also, when
linking objects, $(LDFLAGS) should be used.
This commit is contained in:
Vesa Pikki 2009-03-09 19:35:43 +02:00
parent eb7cb81e53
commit 3d6e3d38bb
2 changed files with 56 additions and 56 deletions

View File

@ -1,5 +1,5 @@
CXXFLAGS=-Wall -Wextra -pedantic -g CXXFLAGS=-Wall -Wextra -pedantic -g
COMPILER=g++ CXX=g++
BIN=${DESTDIR}/usr/bin BIN=${DESTDIR}/usr/bin
@ -72,12 +72,12 @@ TESTOBJ = test/testbufferoverrun.o \
###### Targets ###### Targets
cppcheck: $(OBJECTS) cppcheck: $(OBJECTS)
$(COMPILER) $(CXXFLAGS) -o cppcheck $(OBJECTS) $(CXX) $(CXXFLAGS) -o cppcheck $(OBJECTS) $(LDFLAGS)
all: cppcheck testrunner tools all: cppcheck testrunner tools
testrunner: $(TESTOBJ) testrunner: $(TESTOBJ)
$(COMPILER) $(CXXFLAGS) -o testrunner $(TESTOBJ) $(CXX) $(CXXFLAGS) -o testrunner $(TESTOBJ) $(LDFLAGS)
test: all test: all
./testrunner ./testrunner
@ -85,10 +85,10 @@ test: all
tools: tools/errmsg tools/dmake tools: tools/errmsg tools/dmake
tools/errmsg: tools/errmsg.cpp tools/errmsg: tools/errmsg.cpp
$(COMPILER) $(CXXFLAGS) -o tools/errmsg tools/errmsg.cpp $(CXX) $(CXXFLAGS) -o tools/errmsg tools/errmsg.cpp $(LDFLAGS)
tools/dmake: tools/dmake.cpp src/filelister.cpp src/filelister.h tools/dmake: tools/dmake.cpp src/filelister.cpp src/filelister.h
$(COMPILER) $(CXXFLAGS) -o tools/dmake tools/dmake.cpp src/filelister.cpp $(CXX) $(CXXFLAGS) -o tools/dmake tools/dmake.cpp src/filelister.cpp $(LDFLAGS)
clean: clean:
rm -f src/*.o test/*.o testrunner cppcheck tools/dmake tools/errmsg rm -f src/*.o test/*.o testrunner cppcheck tools/dmake tools/errmsg
@ -101,133 +101,133 @@ install: cppcheck
###### Build ###### Build
src/checkbufferoverrun.o: src/checkbufferoverrun.cpp src/checkbufferoverrun.h src/settings.h src/tokenize.h src/errorlogger.h src/token.h src/checkbufferoverrun.o: src/checkbufferoverrun.cpp src/checkbufferoverrun.h src/settings.h src/tokenize.h src/errorlogger.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkbufferoverrun.o src/checkbufferoverrun.cpp $(CXX) $(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 src/checkclass.o: src/checkclass.cpp src/checkclass.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkclass.o src/checkclass.cpp $(CXX) $(CXXFLAGS) -c -o src/checkclass.o src/checkclass.cpp
src/checkdangerousfunctions.o: src/checkdangerousfunctions.cpp src/checkdangerousfunctions.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkdangerousfunctions.o: src/checkdangerousfunctions.cpp src/checkdangerousfunctions.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkdangerousfunctions.o src/checkdangerousfunctions.cpp $(CXX) $(CXXFLAGS) -c -o src/checkdangerousfunctions.o src/checkdangerousfunctions.cpp
src/checkfunctionusage.o: src/checkfunctionusage.cpp src/checkfunctionusage.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkfunctionusage.o: src/checkfunctionusage.cpp src/checkfunctionusage.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkfunctionusage.o src/checkfunctionusage.cpp $(CXX) $(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 src/filelister.h src/checkheaders.o: src/checkheaders.cpp src/checkheaders.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/filelister.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkheaders.o src/checkheaders.cpp $(CXX) $(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 src/checkmemoryleak.o: src/checkmemoryleak.cpp src/checkmemoryleak.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkmemoryleak.o src/checkmemoryleak.cpp $(CXX) $(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 src/checkother.o: src/checkother.cpp src/checkother.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkother.o src/checkother.cpp $(CXX) $(CXXFLAGS) -c -o src/checkother.o src/checkother.cpp
src/checksecurity.o: src/checksecurity.cpp src/checksecurity.h src/errorlogger.h src/settings.h src/token.h src/tokenize.h src/checksecurity.o: src/checksecurity.cpp src/checksecurity.h src/errorlogger.h src/settings.h src/token.h src/tokenize.h
$(COMPILER) $(CXXFLAGS) -c -o src/checksecurity.o src/checksecurity.cpp $(CXX) $(CXXFLAGS) -c -o src/checksecurity.o src/checksecurity.cpp
src/checkstl.o: src/checkstl.cpp src/checkstl.h src/errorlogger.h src/settings.h src/token.h src/tokenize.h src/checkstl.o: src/checkstl.cpp src/checkstl.h src/errorlogger.h src/settings.h src/token.h src/tokenize.h
$(COMPILER) $(CXXFLAGS) -c -o src/checkstl.o src/checkstl.cpp $(CXX) $(CXXFLAGS) -c -o src/checkstl.o src/checkstl.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/checkdangerousfunctions.h src/checkclass.h src/checkheaders.h src/checkother.h src/checkstl.h src/filelister.h 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/checkdangerousfunctions.h src/checkclass.h src/checkheaders.h src/checkother.h src/checkstl.h src/filelister.h
$(COMPILER) $(CXXFLAGS) -c -o src/cppcheck.o src/cppcheck.cpp $(CXX) $(CXXFLAGS) -c -o src/cppcheck.o src/cppcheck.cpp
src/cppcheckexecutor.o: src/cppcheckexecutor.cpp src/cppcheckexecutor.h src/errorlogger.h src/settings.h src/cppcheck.h src/checkfunctionusage.h src/tokenize.h src/token.h src/threadexecutor.h src/cppcheckexecutor.o: src/cppcheckexecutor.cpp src/cppcheckexecutor.h src/errorlogger.h src/settings.h src/cppcheck.h src/checkfunctionusage.h src/tokenize.h src/token.h src/threadexecutor.h
$(COMPILER) $(CXXFLAGS) -c -o src/cppcheckexecutor.o src/cppcheckexecutor.cpp $(CXX) $(CXXFLAGS) -c -o src/cppcheckexecutor.o src/cppcheckexecutor.cpp
src/errorlogger.o: src/errorlogger.cpp src/errorlogger.h src/settings.h src/tokenize.h src/token.h src/errorlogger.o: src/errorlogger.cpp src/errorlogger.h src/settings.h src/tokenize.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/errorlogger.o src/errorlogger.cpp $(CXX) $(CXXFLAGS) -c -o src/errorlogger.o src/errorlogger.cpp
src/filelister.o: src/filelister.cpp src/filelister.h src/filelister.o: src/filelister.cpp src/filelister.h
$(COMPILER) $(CXXFLAGS) -c -o src/filelister.o src/filelister.cpp $(CXX) $(CXXFLAGS) -c -o src/filelister.o src/filelister.cpp
src/main.o: src/main.cpp src/cppcheckexecutor.h src/errorlogger.h src/settings.h src/main.o: src/main.cpp src/cppcheckexecutor.h src/errorlogger.h src/settings.h
$(COMPILER) $(CXXFLAGS) -c -o src/main.o src/main.cpp $(CXX) $(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 src/preprocessor.o: src/preprocessor.cpp src/preprocessor.h src/tokenize.h src/settings.h src/errorlogger.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/preprocessor.o src/preprocessor.cpp $(CXX) $(CXXFLAGS) -c -o src/preprocessor.o src/preprocessor.cpp
src/settings.o: src/settings.cpp src/settings.h src/settings.o: src/settings.cpp src/settings.h
$(COMPILER) $(CXXFLAGS) -c -o src/settings.o src/settings.cpp $(CXX) $(CXXFLAGS) -c -o src/settings.o src/settings.cpp
src/threadexecutor.o: src/threadexecutor.cpp src/threadexecutor.h src/settings.h src/errorlogger.h src/cppcheck.h src/checkfunctionusage.h src/tokenize.h src/token.h src/threadexecutor.o: src/threadexecutor.cpp src/threadexecutor.h src/settings.h src/errorlogger.h src/cppcheck.h src/checkfunctionusage.h src/tokenize.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/threadexecutor.o src/threadexecutor.cpp $(CXX) $(CXXFLAGS) -c -o src/threadexecutor.o src/threadexecutor.cpp
src/token.o: src/token.cpp src/token.h src/token.o: src/token.cpp src/token.h
$(COMPILER) $(CXXFLAGS) -c -o src/token.o src/token.cpp $(CXX) $(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 src/tokenize.o: src/tokenize.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/filelister.h
$(COMPILER) $(CXXFLAGS) -c -o src/tokenize.o src/tokenize.cpp $(CXX) $(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 test/testbufferoverrun.o: test/testbufferoverrun.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkbufferoverrun.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testbufferoverrun.o test/testbufferoverrun.cpp $(CXX) $(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 test/testcharvar.o: test/testcharvar.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testcharvar.o test/testcharvar.cpp $(CXX) $(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 test/testclass.o: test/testclass.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testclass.o test/testclass.cpp $(CXX) $(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 test/testconstructors.o: test/testconstructors.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testconstructors.o test/testconstructors.cpp $(CXX) $(CXXFLAGS) -c -o test/testconstructors.o test/testconstructors.cpp
test/testcppcheck.o: test/testcppcheck.cpp test/testsuite.h src/errorlogger.h src/settings.h src/cppcheck.h src/checkfunctionusage.h src/tokenize.h src/token.h test/testcppcheck.o: test/testcppcheck.cpp test/testsuite.h src/errorlogger.h src/settings.h src/cppcheck.h src/checkfunctionusage.h src/tokenize.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o test/testcppcheck.o test/testcppcheck.cpp $(CXX) $(CXXFLAGS) -c -o test/testcppcheck.o test/testcppcheck.cpp
test/testdangerousfunctions.o: test/testdangerousfunctions.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkdangerousfunctions.h test/testsuite.h test/testdangerousfunctions.o: test/testdangerousfunctions.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkdangerousfunctions.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testdangerousfunctions.o test/testdangerousfunctions.cpp $(CXX) $(CXXFLAGS) -c -o test/testdangerousfunctions.o test/testdangerousfunctions.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 test/testdivision.o: test/testdivision.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testdivision.o test/testdivision.cpp $(CXX) $(CXXFLAGS) -c -o test/testdivision.o test/testdivision.cpp
test/testfilelister.o: test/testfilelister.cpp test/testsuite.h src/errorlogger.h src/settings.h src/filelister.h test/testfilelister.o: test/testfilelister.cpp test/testsuite.h src/errorlogger.h src/settings.h src/filelister.h
$(COMPILER) $(CXXFLAGS) -c -o test/testfilelister.o test/testfilelister.cpp $(CXX) $(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 test/testfunctionusage.o: test/testfunctionusage.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h test/testsuite.h src/checkfunctionusage.h
$(COMPILER) $(CXXFLAGS) -c -o test/testfunctionusage.o test/testfunctionusage.cpp $(CXX) $(CXXFLAGS) -c -o test/testfunctionusage.o test/testfunctionusage.cpp
test/testincompletestatement.o: test/testincompletestatement.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h src/checkother.h test/testincompletestatement.o: test/testincompletestatement.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h src/checkother.h
$(COMPILER) $(CXXFLAGS) -c -o test/testincompletestatement.o test/testincompletestatement.cpp $(CXX) $(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 test/testmemleak.o: test/testmemleak.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testmemleak.o test/testmemleak.cpp $(CXX) $(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 test/testmemleakmp.o: test/testmemleakmp.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkmemoryleak.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testmemleakmp.o test/testmemleakmp.cpp $(CXX) $(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 test/testother.o: test/testother.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testother.o test/testother.cpp $(CXX) $(CXXFLAGS) -c -o test/testother.o test/testother.cpp
test/testpreprocessor.o: test/testpreprocessor.cpp test/testsuite.h src/errorlogger.h src/settings.h src/preprocessor.h test/testpreprocessor.o: test/testpreprocessor.cpp test/testsuite.h src/errorlogger.h src/settings.h src/preprocessor.h src/tokenize.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o test/testpreprocessor.o test/testpreprocessor.cpp $(CXX) $(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 test/testredundantif.o: test/testredundantif.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkother.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testredundantif.o test/testredundantif.cpp $(CXX) $(CXXFLAGS) -c -o test/testredundantif.o test/testredundantif.cpp
test/testrunner.o: test/testrunner.cpp test/testsuite.h src/errorlogger.h src/settings.h test/testrunner.o: test/testrunner.cpp test/testsuite.h src/errorlogger.h src/settings.h
$(COMPILER) $(CXXFLAGS) -c -o test/testrunner.o test/testrunner.cpp $(CXX) $(CXXFLAGS) -c -o test/testrunner.o test/testrunner.cpp
test/testsecurity.o: test/testsecurity.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checksecurity.h test/testsuite.h test/testsecurity.o: test/testsecurity.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checksecurity.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testsecurity.o test/testsecurity.cpp $(CXX) $(CXXFLAGS) -c -o test/testsecurity.o test/testsecurity.cpp
test/testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h test/testsimplifytokens.o: test/testsimplifytokens.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o test/testsimplifytokens.o test/testsimplifytokens.cpp $(CXX) $(CXXFLAGS) -c -o test/testsimplifytokens.o test/testsimplifytokens.cpp
test/teststl.o: test/teststl.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkstl.h test/testsuite.h test/teststl.o: test/teststl.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkstl.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/teststl.o test/teststl.cpp $(CXX) $(CXXFLAGS) -c -o test/teststl.o test/teststl.cpp
test/testsuite.o: test/testsuite.cpp test/testsuite.h src/errorlogger.h src/settings.h test/testsuite.o: test/testsuite.cpp test/testsuite.h src/errorlogger.h src/settings.h
$(COMPILER) $(CXXFLAGS) -c -o test/testsuite.o test/testsuite.cpp $(CXX) $(CXXFLAGS) -c -o test/testsuite.o test/testsuite.cpp
test/testtoken.o: test/testtoken.cpp test/testsuite.h src/errorlogger.h src/settings.h src/token.h test/testtoken.o: test/testtoken.cpp test/testsuite.h src/errorlogger.h src/settings.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o test/testtoken.o test/testtoken.cpp $(CXX) $(CXXFLAGS) -c -o test/testtoken.o test/testtoken.cpp
test/testtokenize.o: test/testtokenize.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h test/testtokenize.o: test/testtokenize.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h
$(COMPILER) $(CXXFLAGS) -c -o test/testtokenize.o test/testtokenize.cpp $(CXX) $(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 test/testunusedprivfunc.o: test/testunusedprivfunc.cpp src/tokenize.h src/settings.h src/errorlogger.h src/token.h src/checkclass.h test/testsuite.h
$(COMPILER) $(CXXFLAGS) -c -o test/testunusedprivfunc.o test/testunusedprivfunc.cpp $(CXX) $(CXXFLAGS) -c -o test/testunusedprivfunc.o test/testunusedprivfunc.cpp
test/testunusedvar.o: test/testunusedvar.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h src/checkother.h test/testunusedvar.o: test/testunusedvar.cpp test/testsuite.h src/errorlogger.h src/settings.h src/tokenize.h src/token.h src/checkother.h
$(COMPILER) $(CXXFLAGS) -c -o test/testunusedvar.o test/testunusedvar.cpp $(CXX) $(CXXFLAGS) -c -o test/testunusedvar.o test/testunusedvar.cpp
src/errorlogger.h: tools/errmsg src/errorlogger.h: tools/errmsg
tools/errmsg tools/errmsg

View File

@ -79,7 +79,7 @@ int main()
// more warnings.. -Wfloat-equal -Wcast-qual -Wsign-conversion -Wlogical-op // more warnings.. -Wfloat-equal -Wcast-qual -Wsign-conversion -Wlogical-op
fout << "CXXFLAGS=-Wall -Wextra -pedantic -g\n"; fout << "CXXFLAGS=-Wall -Wextra -pedantic -g\n";
fout << "COMPILER=g++\n"; fout << "CXX=g++\n";
fout << "BIN=${DESTDIR}/usr/bin\n\n"; fout << "BIN=${DESTDIR}/usr/bin\n\n";
fout << "\n###### Object Files\n\n"; fout << "\n###### Object Files\n\n";
@ -100,17 +100,17 @@ int main()
fout << "\n###### Targets\n\n"; fout << "\n###### Targets\n\n";
fout << "cppcheck:\t$(OBJECTS)\n"; fout << "cppcheck:\t$(OBJECTS)\n";
fout << "\t$(COMPILER) $(CXXFLAGS) -o cppcheck $(OBJECTS)\n\n"; fout << "\t$(CXX) $(CXXFLAGS) -o cppcheck $(OBJECTS) $(LDFLAGS)\n\n";
fout << "all:\tcppcheck\ttestrunner\ttools\n\n"; fout << "all:\tcppcheck\ttestrunner\ttools\n\n";
fout << "testrunner:\t$(TESTOBJ)\n"; fout << "testrunner:\t$(TESTOBJ)\n";
fout << "\t$(COMPILER) $(CXXFLAGS) -o testrunner $(TESTOBJ)\n\n"; fout << "\t$(CXX) $(CXXFLAGS) -o testrunner $(TESTOBJ) $(LDFLAGS)\n\n";
fout << "test:\tall\n"; fout << "test:\tall\n";
fout << "\t./testrunner\n\n"; fout << "\t./testrunner\n\n";
fout << "tools:\ttools/errmsg\ttools/dmake\n\n"; fout << "tools:\ttools/errmsg\ttools/dmake\n\n";
fout << "tools/errmsg:\ttools/errmsg.cpp\n"; fout << "tools/errmsg:\ttools/errmsg.cpp\n";
fout << "\t$(COMPILER) $(CXXFLAGS) -o tools/errmsg tools/errmsg.cpp\n\n"; fout << "\t$(CXX) $(CXXFLAGS) -o tools/errmsg tools/errmsg.cpp $(LDFLAGS)\n\n";
fout << "tools/dmake:\ttools/dmake.cpp\tsrc/filelister.cpp\tsrc/filelister.h\n"; fout << "tools/dmake:\ttools/dmake.cpp\tsrc/filelister.cpp\tsrc/filelister.h\n";
fout << "\t$(COMPILER) $(CXXFLAGS) -o tools/dmake tools/dmake.cpp src/filelister.cpp\n\n"; fout << "\t$(CXX) $(CXXFLAGS) -o tools/dmake tools/dmake.cpp src/filelister.cpp $(LDFLAGS)\n\n";
fout << "clean:\n"; fout << "clean:\n";
fout << "\trm -f src/*.o test/*.o testrunner cppcheck tools/dmake tools/errmsg\n\n"; fout << "\trm -f src/*.o test/*.o testrunner cppcheck tools/dmake tools/errmsg\n\n";
fout << "install:\tcppcheck\n"; fout << "install:\tcppcheck\n";
@ -126,7 +126,7 @@ int main()
getDeps(srcfiles[i], depfiles); getDeps(srcfiles[i], depfiles);
for (unsigned int dep = 0; dep < depfiles.size(); ++dep) for (unsigned int dep = 0; dep < depfiles.size(); ++dep)
fout << " " << depfiles[dep]; fout << " " << depfiles[dep];
fout << "\n\t$(COMPILER) $(CXXFLAGS) -c -o " << objfile(srcfiles[i]) << " " << srcfiles[i] << "\n\n"; fout << "\n\t$(CXX) $(CXXFLAGS) -c -o " << objfile(srcfiles[i]) << " " << srcfiles[i] << "\n\n";
} }
for (unsigned int i = 0; i < testfiles.size(); ++i) for (unsigned int i = 0; i < testfiles.size(); ++i)
@ -136,7 +136,7 @@ int main()
getDeps(testfiles[i], depfiles); getDeps(testfiles[i], depfiles);
for (unsigned int dep = 0; dep < depfiles.size(); ++dep) for (unsigned int dep = 0; dep < depfiles.size(); ++dep)
fout << " " << depfiles[dep]; fout << " " << depfiles[dep];
fout << "\n\t$(COMPILER) $(CXXFLAGS) -c -o " << objfile(testfiles[i]) << " " << testfiles[i] << "\n\n"; fout << "\n\t$(CXX) $(CXXFLAGS) -c -o " << objfile(testfiles[i]) << " " << testfiles[i] << "\n\n";
} }
fout << "src/errorlogger.h:\ttools/errmsg\n"; fout << "src/errorlogger.h:\ttools/errmsg\n";