File: Makefile

package info (click to toggle)
play.it 2.11.0-1
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye, buster, sid
  • size: 2,740 kB
  • sloc: sh: 35,147; makefile: 52
file content (56 lines) | stat: -rw-r--r-- 1,455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.PHONY: all

UID := $(shell id --user)

ifeq ($(UID),0)
    prefix = /usr/local
    bindir = $(prefix)/games
    datadir = $(prefix)/share/games
    mandir = $(prefix)/share/man
else
    ifeq ($(XDG_DATA_HOME),)
        XDG_DATA_HOME := $(HOME)/.local/share
    endif
    prefix = $(XDG_DATA_HOME)
    bindir = $(HOME)/bin
    datadir = $(prefix)
    mandir = $(prefix)/man
endif

PANDOC := $(shell command -v pandoc 2> /dev/null)

all: libplayit2.sh play.it.6

libplayit2.sh: play.it-2/src/*
	mkdir --parents play.it-2/lib
	cat play.it-2/src/* > play.it-2/lib/libplayit2.sh

%.6: %.6.md
ifneq ($(PANDOC),)
	$(PANDOC) --standalone $< --to man --output $@
else
	@echo "pandoc not installed; skipping $@"
endif

clean:
	rm -f play.it-2/lib/libplayit2.sh
	rm -f *.6

install:
	mkdir -p $(DESTDIR)$(bindir)
	cp -a play.it $(DESTDIR)$(bindir)
	mkdir -p $(DESTDIR)$(datadir)/play.it
	cp -a play.it-2/lib/libplayit2.sh play.it-2/games/* $(DESTDIR)$(datadir)/play.it
ifneq ($(PANDOC),)
	mkdir -p $(DESTDIR)$(mandir)/man6
	gzip -c play.it.6 > $(DESTDIR)$(mandir)/man6/play.it.6.gz
endif

uninstall:
	rm $(DESTDIR)$(bindir)/play.it
	rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(bindir) || true
	rm $(DESTDIR)$(datadir)/play.it/libplayit2.sh
	rm $(DESTDIR)$(datadir)/play.it/play-*.sh
	rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(datadir)/play.it
	rm --force $(DESTDIR)$(mandir)/man6/play.it.6.gz
	rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(mandir)/man6