forked from frc1418/de
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (28 loc) · 805 Bytes
/
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
PREFIX=/usr
DESTDIR=
INSTDIR=$(DESTDIR)$(PREFIX)
INSTBIN=$(INSTDIR)/local/bin
detected_OS := $(shell uname -s 2>/dev/null)
ifeq ($(detected_OS),Linux)
INSTMAN=$(INSTDIR)/share/man/man7
endif
ifeq ($(detected_OS),Darwin)
INSTMAN=$(INSTDIR)/local/share/man/man7
endif
SCRIPT=de
MANPAGE=$(SCRIPT).7
all:
@echo did nothing. try targets: install, or uninstall.
link:
ln -s $(shell pwd)/$(SCRIPT) $(INSTBIN)/$(SCRIPT)
ln -s $(shell pwd)/doc/$(MANPAGE) $(INSTMAN)/$(MANPAGE)
install:
test -d $(INSTDIR) || mkdir -p $(INSTDIR)
test -d $(INSTBIN) || mkdir -p $(INSTBIN)
test -d $(INSTMAN) || mkdir -p $(INSTMAN)
install -m 0755 $(SCRIPT) $(INSTBIN)
install -m 0644 doc/$(MANPAGE) $(INSTMAN)
uninstall:
rm -f $(INSTBIN)/$(SCRIPT)
rm -f $(INSTMAN)/$(MANPAGE)
.PHONY: all install uninstall