-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
48 lines (34 loc) · 1.01 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
INSTALL_DIR=/usr/local/bin
# List of files that contain the version
VERSIONED_FILES=strapped src/helpers.sh _static/_stay/index.html
VERSION="0.3.0"
VERSION_REPLACE_EXP="s/^VERSION=\".+\"/VERSION=\"${VERSION}\"/g"
.PHONY: all exec install uninstall test strap straps docs
all: exec straps binary docs test
exec:
@chmod u+x build/*.sh
test:
@shellcheck ./strapped
@shellcheck ./straps/**/**/*.sh
@shellcheck ./build/*.sh
docs:
@./build/docs.sh
strap: update-version
@./build/compiler.sh ${yml}
straps: update-version
@./build/straps.sh
binary: update-version
@./build/binary.sh
install: strapped
@echo "📦 Installing strapped"
@mkdir -p $(INSTALL_DIR)
@cp strapped $(INSTALL_DIR)/strapped
@chmod u+x $(INSTALL_DIR)/strapped
uninstall:
@echo "🗑️ Uninstalling strapped"
@rm $(INSTALL_DIR)/strapped
$(VERSIONED_FILES): Makefile
@echo "Updateing version in " $@ " to "$(VERSION)
@sed -i .old -E $(VERSION_REPLACE_EXP) $@ && rm "[email protected]"
.PHONY: update-version
update-version: $(VERSIONED_FILES)