-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
106 lines (82 loc) · 2.05 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#
# Copyright (c) 2014 Opsmate, Inc.
#
# See COPYING file for license information.
#
PROJECT = mkcertchain
VERSION = 0.1.1
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DATADIR ?= $(PREFIX)/share/mkcertchain
DOCDIR ?= $(PREFIX)/share/doc/mkcertchain
MANDIR ?= $(PREFIX)/share/man
DISTDIR ?= $(PROJECT)-$(VERSION)
DISTFILE ?= $(DISTDIR).tar
all: build
#
# Build
#
build: build-bin build-man
build-bin:
build-man:
# $(MAKE) -C man all
#
# Clean
#
clean: clean-bin clean-man
clean-bin:
clean-man:
# $(MAKE) -C man clean
#
# Install
#
install: install-bin install-data install-doc install-man
install-bin:
mkdir -m 755 -p $(DESTDIR)$(BINDIR)
install -m 755 bin/mkcertchain $(DESTDIR)$(BINDIR)/
install-data:
mkdir -m 755 -p $(DESTDIR)$(DATADIR)
install -m 644 share/mkcertchain/browser_roots.pem $(DESTDIR)$(DATADIR)/
install-doc:
mkdir -m 755 -p $(DESTDIR)$(DOCDIR)
install -m 644 README NEWS $(DESTDIR)$(DOCDIR)/
install-man:
mkdir -m 755 -p $(DESTDIR)$(MANDIR)/man1
install -m 644 man/man1/mkcertchain.1 $(DESTDIR)$(MANDIR)/man1/
install-paths:
mkdir -m 755 -p $(DESTDIR)/etc/paths.d $(DESTDIR)/etc/manpaths.d
echo $(BINDIR) > $(DESTDIR)/etc/paths.d/mkcertchain
echo $(MANDIR) > $(DESTDIR)/etc/manpaths.d/mkcertchain
#
# Uninstall
#
uninstall: uninstall-bin uninstall-data uninstall-doc uninstall-man
uninstall-bin:
rm -f $(DESTDIR)$(BINDIR)/mkcertchain
uninstall-data:
rm -f $(DESTDIR)$(DATADIR)/browser_roots.pem
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(DATADIR)
uninstall-doc:
rm -f $(DESTDIR)$(DOCDIR)/README
rm -f $(DESTDIR)$(DOCDIR)/NEWS
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(DOCDIR)
uninstall-man:
rm -f $(DESTDIR)$(MANDIR)/man1/mkcertchain.1
uninstall-paths:
rm -f $(DESTDIR)/etc/paths.d/mkcertchain $(DESTDIR)/etc/manpaths.d/mkcertchain
#
# 'make dist'
#
dist:
git archive --prefix=$(DISTDIR)/ $(VERSION) | gzip -n9 > $(DISTFILE).gz
#
# Misc.
#
get-version:
@echo $(VERSION)
.PHONY: all \
build build-bin build-man \
clean clean-bin clean-man \
install install-bin install-man \
uninstall uninstall-bin uninstall-man \
dist get-version