Skip to content

Commit

Permalink
dmake: debug/release mode, more gcc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Marjamäki committed Mar 9, 2010
1 parent dbc235b commit cffe20a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 6 additions & 3 deletions tools/dmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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/");
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit cffe20a

Please sign in to comment.