-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
50 lines (32 loc) · 1.27 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
BIN ?= cryptmount
MANPAGES := crypttab.5 cryptmount.8
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib
DATADIR ?= $(PREFIX)/share
MANDIR ?= $(DATADIR)/man
DOCDIRS := $(addprefix $(DESTDIR)$(MANDIR)/man, 5 8) $(DESTDIR)$(DATADIR)/$(BIN)
HOOKDIRS := $(addprefix $(DESTDIR)$(LIBDIR)/initcpio/, install hooks)
all: $(BIN) $(MANPAGES)
$(BIN): $(BIN).sh
cp $< $@
man: $(MANPAGES)
%.5: %.5.txt
a2x -d manpage -f manpage $<
%.8: %.8.txt
a2x -d manpage -f manpage $<
install: install_bin install_doc
install_bin: $(BIN) $(DESTDIR)$(BINDIR)
install -m755 -t $(DESTDIR)$(BINDIR) $(BIN)
install_doc: $(MANPAGES) crypttab.example $(DOCDIRS)
install -m644 -t $(DESTDIR)$(MANDIR)/man5 $(filter %.5, $(MANPAGES))
install -m644 -t $(DESTDIR)$(MANDIR)/man8 $(filter %.8, $(MANPAGES))
install -m644 -t $(DESTDIR)$(DATADIR)/$(BIN) crypttab.example
install_hook: archlinux/encrypt_hook archlinux/encrypt_install $(HOOKDIRS)
install -m644 archlinux/encrypt_install $(DESTDIR)$(LIBDIR)/initcpio/install/encrypt2
install -m644 archlinux/encrypt_hook $(DESTDIR)$(LIBDIR)/initcpio/hooks/encrypt2
$(DESTDIR)$(BINDIR) $(HOOKDIRS) $(DOCDIRS):
install -m755 -d $@
clean:
$(RM) $(BIN) $(MANPAGES)
.PHONY: all man clean install install_bin install_doc install_hook