dmake: debug/release mode, more gcc warnings

This commit is contained in:
Daniel Marjamäki 2010-03-09 08:10:05 +01:00
parent dbc235bd39
commit cffe20a440
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
CXXFLAGS=-Wall -Wextra -pedantic -g
CXXFLAGS=-Wall -Wextra -pedantic -Wfloat-equal -Wcast-qual -Wsign-conversion -Wlogical-op -g
CXX=g++
BIN=${DESTDIR}/usr/bin

View File

@ -94,8 +94,10 @@ static void getCppFiles(std::vector<std::string> &files, const std::string &path
}
}
int main()
int main(int argc, char **argv)
{
const bool release(argc >= 2 && std::string(argv[1]) == "--release");
// Get files..
std::vector<std::string> libfiles;
getCppFiles(libfiles, "lib/");
@ -138,8 +140,9 @@ int main()
std::ofstream fout("Makefile");
// more warnings.. -Wfloat-equal -Wcast-qual -Wsign-conversion -Wlogical-op
fout << "CXXFLAGS=-Wall -Wextra -pedantic -g\n";
// Makefile settings..
fout << "CXXFLAGS=-Wall -Wextra -pedantic -Wfloat-equal -Wcast-qual -Wsign-conversion -Wlogical-op ";
fout << (release ? "-O2 -DNDEBUG" : "-g") << "\n";
fout << "CXX=g++\n";
fout << "BIN=${DESTDIR}/usr/bin\n\n";
fout << "# For 'make man': sudo apt-get install xsltproc docbook-xsl docbook-xml\n";