dmake: debug/release mode, more gcc warnings
This commit is contained in:
parent
dbc235bd39
commit
cffe20a440
2
Makefile
2
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue