File: Makefile

package info (click to toggle)
hoichess 0.22.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,032 kB
  • sloc: cpp: 17,028; makefile: 272; sh: 221; perl: 67
file content (87 lines) | stat: -rw-r--r-- 1,863 bytes parent folder | download | duplicates (3)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
prefix = /usr
# Make these variables also available to sub-makes.
export bindir = $(prefix)/games
export docdir = $(prefix)/share/doc/hoichess
export mandir = $(prefix)/share/man
export datadir = $(prefix)/share/games/hoichess
export install_bindir = $(bindir)
export install_docdir = $(docdir)
export install_mandir = $(mandir)
export install_datadir = $(datadir)


VERSION := $(shell grep '^Version' ChangeLog | head -n 1 | awk '{ print $$2; }')
TARGET := $(shell $(CXX) -dumpmachine)
ifeq ($(TARGET),)
$(error Unable to determine compiler target)
endif


#
# Build
#

.PHONY: all
all: compile book doc cfg

.PHONY: compile
compile:
	$(MAKE) -C src all

.PHONY: book
book:
	$(MAKE) -C book

.PHONY: doc
doc: hoichess.6 hoichess.6.html

hoichess.6: hoichess.6.pod
	pod2man -n hoichess -s 6 -r "hoichess-$(VERSION)" -c Games $< $@

hoichess.6.html: hoichess.6.pod
	pod2html --title "HoiChess" $< > $@

.PHONY: cfg
cfg: hoichess.rc hoixiangqi.rc

hoichess.rc hoixiangqi.rc: %: %.m4
	m4 -D DATADIR=$(datadir) $< > $@


#
# Install
#

.PHONY: install
install: install-bin

INSTALL_BIN_DOCS = AUTHORS BUGS README
INSTALL_BIN_DATA = hoichess.rc hoixiangqi.rc

.PHONY: install-bin 
install-bin: all
	$(MAKE) -C src install DESTDIR="$(DESTDIR)"
	install -m 644 -D hoichess.6 $(DESTDIR)$(install_mandir)/man6/hoichess.6
	install -m 755 -d $(DESTDIR)$(install_docdir)
	install -m 644 $(INSTALL_BIN_DOCS) $(DESTDIR)$(install_docdir)
	install -m 755 -d $(DESTDIR)$(install_datadir)
	install -m 644 $(INSTALL_BIN_DATA) $(DESTDIR)$(install_datadir)
	$(MAKE) -C book install DESTDIR="$(DESTDIR)"


#
# Clean
#

.PHONY: clean
clean:
	$(MAKE) -C src clean
	rm -f hoichess.6 hoichess.6.html pod2htmd.tmp pod2htmi.tmp
	rm -f hoichess.rc hoixiangqi.rc
	$(MAKE) -C book clean
	rm -rf $(DIST_OUTDIR)

.PHONY: maintainer-clean
maintainer-clean: clean
	$(MAKE) -C src maintainer-clean