Skip to content

Commit

Permalink
Support BINDIR in make invocation
Browse files Browse the repository at this point in the history
This is useful for package creators to be able to run `make install`
without having to move files around afterwards.

Author: Dan Church <amphetamachine@gmail.com>
Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
  • Loading branch information
h3xx authored and smcameron committed Feb 4, 2017
1 parent 94acf95 commit e2fd650
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PREFIX?=/usr
BINDIR=${PREFIX}/games
DATADIR=${PREFIX}/share/wordwarvi
MANDIR?=${PREFIX}/share/man
MANPAGEDIR=${MANDIR}/man6
Expand Down Expand Up @@ -116,15 +117,15 @@ wordwarvi.6.gz: wordwarvi.6
gzip -c wordwarvi.6 > wordwarvi.6.gz

install: wordwarvi wordwarvi.6.gz
mkdir -p $(DESTDIR)$(PREFIX)/games
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(DATADIR)/sounds
mkdir -p $(DESTDIR)$(MANPAGEDIR)
install -p -m 755 wordwarvi $(DESTDIR)$(PREFIX)/games
install -p -m 755 wordwarvi $(DESTDIR)$(BINDIR)
install -p -m 644 sounds/*.ogg $(DESTDIR)$(DATADIR)/sounds
install -p -m 644 wordwarvi.6.gz $(DESTDIR)$(MANPAGEDIR)

uninstall:
/bin/rm -f $(DESTDIR)${PREFIX}/games/wordwarvi
/bin/rm -f $(DESTDIR)$(BINDIR)/wordwarvi
/bin/rm -fr $(DESTDIR)${DATADIR}
/bin/rm -f $(DESTDIR)${MANPAGEDIR}/wordwarvi.6.gz

Expand Down

0 comments on commit e2fd650

Please sign in to comment.