aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-12-01 22:45:05 -0500
committerJesús <heckyel@hyperbola.info>2021-12-01 22:45:05 -0500
commit0ef5a8fe632e568c1b80572ae23e46c61f2da185 (patch)
tree352d7273796b975227eca82f34857be71abf9052 /Makefile
downloadcountries-0ef5a8fe632e568c1b80572ae23e46c61f2da185.tar.lz
countries-0ef5a8fe632e568c1b80572ae23e46c61f2da185.tar.xz
countries-0ef5a8fe632e568c1b80572ae23e46c61f2da185.zip
initial public
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile77
1 files changed, 77 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f894240
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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