-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
79 lines (60 loc) · 1.83 KB
/
Makefile
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
# root for installation
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
datarootdir = ${prefix}/share
sysconfdir = ${prefix}/etc
mandir = ${datarootdir}/man
man1dir = $(mandir)/man1
INSTALL = /usr/bin/install -c -D
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
PACKAGE = i3b
PROG = i3b
#VERSION = 0.0.0
BUGREPORT = https://github.com/DMBuce/i3b/issues
URL = https://github.com/DMBuce/i3b
BINFILES = $(wildcard bin/*)
#ETCFILES = $(shell find config/ -type f)
#MAN1FILES = doc/i3move.1
MAN1SRC = $(wildcard doc/*.1.txt)
MAN1FILES = $(sort $(BINFILES:bin/%=doc/%.1) $(MAN1SRC:%.txt=%))
MANFILES = $(MAN1FILES)
HTMLSRC = $(wildcard doc/*.txt)
HTMLFILES = $(HTMLSRC:%.txt=%.html)
DOCFILES = $(MANFILES) $(HTMLFILES)
BINFILES_INSTALL = $(BINFILES:bin/%=$(DESTDIR)$(bindir)/%)
MANFILES_INSTALL = $(MANFILES:doc/%=$(DESTDIR)$(man1dir)/%)
#ETCFILES_INSTALL = $(ETCFILES:config/%=$(DESTDIR)$(sysconfdir)/%)
INSTALL_FILES = $(BINFILES_INSTALL) $(ETCFILES_INSTALL) $(MANFILES_INSTALL)
INSTALL_DIRS = $(sort $(dir $(INSTALL_FILES)))
.PHONY: all
all: doc
.PHONY: html
html: $(HTMLFILES)
.PHONY: doc
doc: $(DOCFILES)
%.1: %.1.txt
asciidoctor -b manpage $<
@# TODO: remove this when everything is converted to asciidoc
rm -f [email protected]
%.html: %.txt
asciidoc $<
dos2unix $@
%.asciidoc: %.asciidoc.sempl
sempl $< $@
doc/index.txt: README.asciidoc
cp $< $@
.PHONY: install
install: all installdirs $(INSTALL_FILES)
.PHONY: installdirs
installdirs: $(INSTALL_DIRS)
$(INSTALL_DIRS):
$(INSTALL) -d $@
$(DESTDIR)$(bindir)/%: bin/%
$(INSTALL_PROGRAM) $< $@
$(DESTDIR)$(man1dir)/%: doc/%
$(INSTALL_DATA) $< $@
$(DESTDIR)$(sysconfdir)/%: config/%
$(INSTALL_DATA) $< $@
# vim: set ft=make: