-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (36 loc) · 861 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
38
39
40
41
42
43
44
OS ?= $(shell uname)
RM ?= $(shell which rm)
CWD ?= $(shell pwd)
NPM ?= $(shell which npm)
BUILD ?= $(CWD)/build
PREFIX ?= /usr/local
TARGET ?= ass
.PHONY: default install uninstall clean
default: build
build: node_modules
./scripts/package.sh
node_modules: package.json
package.json:
$(NPM) install
ifeq (Linux, $(OS))
install: build
install $(BUILD)/linux/$(TARGET) $(PREFIX)/bin
else ifeq (Darwin, $(OS))
install: build
install $(BUILD)/macos/$(TARGET) $(PREFIX)/bin
else
install: build
$(error "Error: $(OS) is not supported")
endif
ifeq (Linux, $(OS))
uninstall:
if test -f $(PREFIX)/bin/$(TARGET); then $(RM) $(PREFIX)/bin/$(TARGET); fi
else ifeq (Darwin, $(OS))
uninstall:
if test -f $(PREFIX)/bin/$(TARGET); then $(RM) $(PREFIX)/bin/$(TARGET); fi
else
uninstall:
$(error "Error: $(OS) is not supported")
endif
clean:
$(RM) -rf $(BUILD)