forked from samhh/bukubrow-webext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
39 lines (31 loc) · 756 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
# The use of `${MAKE} target` is to allow the reuse of targets and also ensure
# explicit ordering
SHELL := /usr/bin/env bash
# Vars
TEMP_BUILD_DIR = .build
RELEASE_DIR = release
# Prepare build and release dirs
.PHONY: prepare
prepare:
mkdir -p $(TEMP_BUILD_DIR) $(RELEASE_DIR)
# Remove build dir
.PHONY: clean
clean:
rm -rf $(TEMP_BUILD_DIR)
# Remove build and release dirs
.PHONY: wipe
wipe:
${MAKE} clean
rm -rf $(RELEASE_DIR)
# Wipe, and also remove node_modules/ and any cache directories
.PHONY: nuke
nuke:
${MAKE} wipe
rm -rf node_modules/ .cache/ dist/
# Build WebExtension via Yarn and zip into release dir
.PHONY: webext
webext:
${MAKE} prepare
yarn && yarn build
cd dist && zip -r '../$(RELEASE_DIR)/webext' ./*
${MAKE} clean