
all: release

debug:
	xbuild	/p:Configuration=Debug /p:TargetFrameworkVersion=v4.0 Ntp.Analyzer.sln

release:
	xbuild	/p:Configuration=Release /p:TargetFrameworkVersion=v4.0 Ntp.Analyzer.sln

install: release
	install -d ${DESTDIR}$(PREFIX)/sbin
	install -d ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Cli.exe ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Data.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Import.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Monitor.Client.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Monitor.Cli.exe ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Monitor.Server.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Objects.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Process.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Validate.Cli.exe ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Analyzer.Validate.Gui.exe ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Common.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Data.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install bin/Ntp.Data.Provider.dll ${DESTDIR}$(PREFIX)/libexec/ntpa
	install -d ${DESTDIR}$(PREFIX)/etc/ntpa/
	install examples/ntpa.conf ${DESTDIR}$(PREFIX)/etc/ntpa/ntpa.conf.sample

install-linux: install
	useradd -r ntpa
	mkdir /var/run/ntpa
	chown ntpa:ntpa /var/run/ntpa
	touch /var/log/ntpa.log
	chown ntpa:ntpa /var/log/ntpa.log

clean-debug:
	xbuild Ntp.Analyzer.sln /p:Configuration=Debug /t:clean

clean-release:
	xbuild Ntp.Analyzer.sln /p:Configuration=Release /t:clean

clean-all: clean-debug clean-release

clean: clean-release
