-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (45 loc) · 1.62 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
SCRIPT = shrender
VERSION = 0.0.1
MKDIR = mkdir -p
CP = cp -rvfa
RM = rm -rfv
GIT = git
WGET = wget
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
SHAREDIR=$(PREFIX)/share/$(SCRIPT)
.PHONY: test deps all
all: deps
#------------------------------------------------------------------------------
# Dependencies
#------------------------------------------------------------------------------
deps: deps/bin/shlog
deps/bin/shlog:
$(MKDIR) "$(dir $@)" && $(WGET) -O "$@" "https://rawgit.com/kba/shlog/master/shlog" && chmod a+x "$@"
#------------------------------------------------------------------------------
# Clean
#------------------------------------------------------------------------------
clean:
$(RM) deps
#------------------------------------------------------------------------------
# Install
#------------------------------------------------------------------------------
install:
$(MKDIR) $(BINDIR)
sed 's,SHRENDERSHARE=.*,SHRENDERSHARE="$(SHAREDIR)",' $(SCRIPT) > $(BINDIR)/$(SCRIPT)
chmod a+x $(BINDIR)/$(SCRIPT)
$(MKDIR) $(SHAREDIR)
$(CP) -t $(SHAREDIR) LICENSE deps
#------------------------------------------------------------------------------
# Uninstall
#------------------------------------------------------------------------------
uninstall:
$(RM) $(BINDIR)/$(SCRIPT)
$(RM) $(SHAREDIR)
#------------------------------------------------------------------------------
# Test
#------------------------------------------------------------------------------
test: test/tsht
SHLOG_TERM=debug SHLOG_FORMAT=" #%level %module %msg" ./test/tsht
test/tsht:
$(MKDIR) "$@" && $(WGET) -O "$@" "https://rawgit.com/kba/tsht/master/tsht"