ifdef DEBUG
CXXFLAGS=-DDEBUG $(OPTFLAGS)
else
CXXFLAGS=-DNDEBUG $(OPTFLAGS)
endif

all: nss-gui nss-gui.1

nss-gui: nss-gui.cpp
	g++ nss-gui.cpp -o nss-gui -lboost_program_options -lboost_system $(CXXFLAGS)

nss-gui.1.xml: nss-gui.1.txt
	asciidoc.py -d manpage -b docbook nss-gui.1.txt

nss-gui.1: nss-gui.1.xml
	xsltproc --nonet /usr/share/asciidoc/docbook-xsl/manpage.xsl nss-gui.1.xml

clean:
	rm nss-gui
	rm nss-gui.1.xml
	rm nss-gui.1
