# "@config_args@".

# Written by Peter Ekberg, peda@lysator.liu.se

SHELL        = /bin/sh
INSTALL      = @INSTALL@

prefix       = @prefix@
exec_prefix  = @exec_prefix@
BINDIR       = @bindir@
MANDIR       = @mandir@
STATEDIR     = @sharedstatedir@

MAN          = thrust.man
HIGHSCORE    = thrust.highscore
FULLHISCORE  = $(STATEDIR)/$(HIGHSCORE)


#######################
#
# Targets.
#
#######################

.PHONY: all install uninstall install-man uninstall-man

all: install

install:
	@if test ! -d $(BINDIR) ; then \
	  echo $(INSTALL) -d $(BINDIR); \
	  $(INSTALL) -d $(BINDIR); \
	fi
	$(INSTALL) -m 6755 thrust $(BINDIR)/thrust
	$(INSTALL) -m 2755 xthrust $(BINDIR)/xthrust
	@if test ! -d $(STATEDIR) ; then \
	  echo $(INSTALL) -d $(STATEDIR); \
	  $(INSTALL) -d $(STATEDIR); \
	fi
	@if test ! -f $(FULLHISCORE) ; then \
	  echo $(INSTALL) -m 660 $(HIGHSCORE) $(FULLHISCORE);\
	  $(INSTALL) -m 660 $(HIGHSCORE) $(FULLHISCORE); \
	fi

uninstall:
	rm $(BINDIR)/thrust
	rm $(BINDIR)/xthrust
	rm $(FULLHISCORE)

install-man:
	cp $(MAN) $(MANDIR)/man6/$(addsuffix .6,$(basename $(MAN)))

uninstall-man:
	rm $(MANDIR)/man6/$(addsuffix .6,$(basename $(MAN)))
