-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (43 loc) · 1.47 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
55
56
57
58
59
60
61
62
63
HTML_FILE_NAME := index.html
CSS_FILE_NAME := nol_tsukumo.css
JS_FILE_NAME := nol_tsukumo.js
SRC_DIR := .
SRC_HTML := $(SRC_DIR)/$(HTML_FILE_NAME)
SRC_CSS := $(SRC_DIR)/$(CSS_FILE_NAME)
SRC_JS := $(SRC_DIR)/$(JS_FILE_NAME)
OUT_ROOT_DIR := out
SITE_OUT_DIR := $(OUT_ROOT_DIR)/site
SITE_OUT_HTML := $(SITE_OUT_DIR)/$(HTML_FILE_NAME)
SITE_OUT_CSS := $(SITE_OUT_DIR)/$(CSS_FILE_NAME)
SITE_OUT_JS := $(SITE_OUT_DIR)/$(JS_FILE_NAME)
SITE_OUT_JSDOC_DIR := $(SITE_OUT_DIR)/jsdoc
SITE_OUT_JSDOC_HTML := $(SITE_OUT_JSDOC_DIR)/index.html
VERSION := $(shell git log -n 1 --pretty=format:"%h")
DATETIME := $(shell git log -n 1 --pretty=format:"%ad")
all: site
clean: clean-out
clean-out: clean-site
rm -rf $(OUT_ROOT_DIR)
clean-site:
rm -rf $(SITE_OUT_DIR)
site: site-calculator site-jsdoc
site-calculator: $(SITE_OUT_HTML) $(SITE_OUT_JS) $(SITE_OUT_CSS)
$(SITE_OUT_DIR):
mkdir -p $@
$(SITE_OUT_HTML): $(SITE_OUT_DIR) $(SRC_HTML)
sed -e 's/NolTsukumoVersion/$(VERSION)/g' -e 's/NolTsukumoDateTime/$(DATETIME)/g' $(SRC_HTML) > $(SITE_OUT_HTML)
$(SITE_OUT_CSS): $(SITE_OUT_DIR) $(SRC_CSS)
cp $(SRC_CSS) $(SITE_OUT_CSS)
$(SITE_OUT_JS): $(SITE_OUT_DIR) $(SRC_JS)
cp $(SRC_JS) $(SITE_OUT_JS)
$(SITE_OUT_JSDOC_DIR): $(SITE_OUT_DIR)
mkdir -p $@
$(SITE_OUT_JSDOC_HTML): $(SITE_OUT_JSDOC_DIR) $(SRC_JS)
npm run doc
site-jsdoc: $(SITE_OUT_JSDOC_HTML)
lint: eslint stylelint
eslint:
npm run eslint
stylelint:
npm run stylelint
.PHONY: all clean clean-out clean-site site site-jsdoc lint eslint stylelint