prefix=@prefix@
bindir=@prefix@/bin
mandir=@mandir@
confdir=@prefix@/etc/select/@name@
name=@name@
version=@version@

all:

install:
	install -m 755 -d $(DESTDIR)$(bindir)
	install -m 755 -d $(DESTDIR)$(mandir)/man8
	install -m 755 -d $(DESTDIR)$(confdir)
	cat select.8 | sed "s|__PREFIX__|$(prefix)|g" | sed "s|__NAME__|$(name)|g" | sed "s|__VERSION__|$(version)|g" > $(DESTDIR)$(mandir)/man8/$(name)_select.8
	chmod 444 $(DESTDIR)$(mandir)/man8/$(name)_select.8
	cat select.sh | sed "s|__PREFIX__|$(prefix)|g" | sed "s|__NAME__|$(name)|g" | sed "s|__VERSION__|$(version)|g" > $(DESTDIR)$(prefix)/bin/$(name)_select
	chmod 755 $(DESTDIR)$(bindir)/$(name)_select

dist:
	rm -rf select-$(version)
	mkdir select-$(version)
	cp configure Makefile.in select.sh select.8 select-$(version)
	tar -z -cf select-$(version).tar.gz select-$(version)

clean:
	rm -f Makefile

