Added 'make man' to Makefile

This commit is contained in:
Reijo Tomperi 2009-11-22 16:43:55 +02:00
parent 2ff6ac9768
commit 7596e76a79
2 changed files with 14 additions and 0 deletions

View File

@ -2,6 +2,11 @@ CXXFLAGS=-Wall -Wextra -pedantic -g
CXX=g++
BIN=${DESTDIR}/usr/bin
# For 'make man': sudo apt-get install xsltproc docbook-xsl docbook-xml
DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
XP=xsltproc -''-nonet -''-param man.charmap.use.subset "0"
MAN_SOURCE=man/cppcheck.1.xml
###### Object Files
@ -76,6 +81,9 @@ tools/dmake: tools/dmake.cpp lib/filelister.cpp lib/filelister.h
clean:
rm -f lib/*.o cli/*.o test/*.o testrunner cppcheck tools/dmake
man: $(MAN_SOURCE)
$(XP) $(DB2MAN) $(MAN_SOURCE)
install: cppcheck
install -d ${BIN}
install cppcheck ${BIN}

View File

@ -98,6 +98,10 @@ int main()
fout << "CXXFLAGS=-Wall -Wextra -pedantic -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";
fout << "DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl\n";
fout << "XP=xsltproc -''-nonet -''-param man.charmap.use.subset \"0\"\n";
fout << "MAN_SOURCE=man/cppcheck.1.xml\n\n";
fout << "\n###### Object Files\n\n";
fout << "LIBOBJ = " << objfile(libfiles[0]);
@ -127,6 +131,8 @@ int main()
fout << "\t$(CXX) $(CXXFLAGS) -o tools/dmake tools/dmake.cpp lib/filelister.cpp $(LDFLAGS)\n\n";
fout << "clean:\n";
fout << "\trm -f lib/*.o cli/*.o test/*.o testrunner cppcheck tools/dmake\n\n";
fout << "man:\t$(MAN_SOURCE)\n";
fout << "\t$(XP) $(DB2MAN) $(MAN_SOURCE)\n\n";
fout << "install:\tcppcheck\n";
fout << "\tinstall -d ${BIN}\n";
fout << "\tinstall cppcheck ${BIN}\n\n";