# This file is part of mpd-hits.
# Copyright (C) 2010 Dmitry Samoyloff.
#
# mpd-hits is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# mpd-hits is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with mpd-hits. If not, see <http://www.gnu.org/licenses/>.

VERSION=$(shell cat VERSION)
DESTDIR=
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/man

.PHONY: all clean install uninstall install-man

all: mpd-hits mpd-hits-report

mpd-hits: mpd-hits.in VERSION
	sed "s/@VERSION@/$(VERSION)/" $< > $@
	chmod 755 $@

mpd-hits-report: mpd-hits-report.in VERSION
	sed "s/@VERSION@/$(VERSION)/" $< > $@
	chmod 755 $@

clean:
	rm -f mpd-hits
	rm -f mpd-hits-report

install: 
	install -d -m 0755 $(DESTDIR)$(BINDIR)/
	install -m 0775 mpd-hits $(DESTDIR)$(BINDIR)/mpd-hits
	install -m 0775 mpd-hits-report $(DESTDIR)$(BINDIR)/mpd-hits-report

uninstall:
	rm -f $(DESTDIR)$(BINDIR)/mpd-hits
	rm -f $(DESTDIR)$(BINDIR)/mpd-hits-report

install-man:
