#    #  ####    ##   #####
##   # #       #  #    #	Network Security Analysis Tool
# #  #  ####  #    #   #
#  # #      # ######   #	     (c) 1999 by Mixter
#   ## #    # #    #   #
#    #  ####  #    #   #

# Change me if you want...
INSTALL_PATH=/usr/local/bin
MAN_PATH=/usr/local/man

all:
	@cd src;make all
	@cd tools;make all
	@echo ""
	@echo " Compiling is done!"
	@echo " You can now 'make install' to put the files in place."
	@echo ""

install: nsat nsat.os doc/nsat.8
	install -d $(INSTALL_PATH)
	install -m 0755 -s nsat $(INSTALL_PATH)
	install -m 0755 -s smb-ns $(INSTALL_PATH)
	install -m 0755 tools/xnsat $(INSTALL_PATH)
	install -m 0644 nsat.os $(INSTALL_PATH)
	install -m 0644 doc/nsat.8 $(MAN_PATH)/man8
	@echo ""
	@echo " Installation complete."
	@echo " - Have fun"
	@echo ""

uninstall:
	rm -f $(INSTALL_PATH)/nsat
	rm -f $(INSTALL_PATH)/smb-ns
	rm -f $(INSTALL_PATH)/xnsat
	rm -f $(INSTALL_PATH)/nsat.os
	rm -f $(MAN_PATH)/man8/nsat.8
	@echo ""
	@echo " NSAT successfully deinstalled."
	@echo ""

clean:
	@cd src;make clean

tool:
	@cd tools;make all

distclean:
	rm -f core *~ *.log
	@cd src;make distclean
	@cd tools;make clean

nsat.os:
	@echo "Hmm, can't find fingerprint database (nsat.os)."
	@exit 0

doc/nsat.8:
	@echo "Hmm, can't find manpage -- skipping :/."

nsat:
	@make all
