blob: f89424009688e4c32a7d2fb67b0b58c66175197e (
plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
include .env
export $(shell sed 's/=.*//' .env)
BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)
OUTPUTDIR=$(BASEDIR)/output
SSH_HOST=$(ENV_HOST)
SSH_PORT=$(ENV_PORT)
SSH_USER=$(ENV_USER)
SSH_TARGET_DIR=$(ENV_TARGET_DIR)
PY?=python
SERVERMODULE=http.server
ifeq ($(PY), tauthon)
SERVERMODULE = SimpleHTTPServer
else ifeq ($(PY), python2)
SERVERMODULE = SimpleHTTPServer
else ifeq ($(PY), python3)
SERVERMODULE = http.server
endif
help:
@echo 'Makefile for generate styles, fonts, icons, js to Contries '
@echo ' '
@echo 'Usage: '
@echo ' make all compile all frontend '
@echo ' make clean delete all fonts, icons, styles, js '
@echo ' make icons compile icons '
@echo ' make styles compile custom styles '
@echo ' make fonts generate fonts '
@echo ' make js compile javascript files '
@echo ' make publish Publish APP '
@echo ' make serve [PY=python] [PORT=8000] serve site at http://localhost:8000 '
@echo ' '
all: generate
generate: clean fonts icons styles js
clean:
@rm -rfv dist/ || true
@rm -rfv output/ || true
fonts:
@bash scripts/fonts.bash
icons:
@bash scripts/icons.bash
styles:
@bash scripts/noscript.bash
@bash scripts/normalize.bash
@bash scripts/home.bash
@bash scripts/post.bash
@bash scripts/license.bash
js:
@bash scripts/js.bash
output:
@mkdir -p output/dist
@cp -rv dist/* output/dist/
@cp -v index.html output/
@cp -v licenses.html output/
@cp -v opensearch.xml output/
publish: generate output
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)/
serve: generate
ifdef PORT
$(PY) -m $(SERVERMODULE) $(PORT)
else
$(PY) -m $(SERVERMODULE)
endif
|