aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-12-05 19:06:19 -0500
committerJesús <heckyel@hyperbola.info>2021-12-05 19:06:19 -0500
commitc11a10e0e6dab07edae2fb9512419f35fb498b8b (patch)
tree83170326bde2730fff4908415f43969fa67f841a
parentd0c8d9447ddc599c623a2242ff12967c0bdbb2f7 (diff)
downloadcl-theme-c11a10e0e6dab07edae2fb9512419f35fb498b8b.tar.lz
cl-theme-c11a10e0e6dab07edae2fb9512419f35fb498b8b.tar.xz
cl-theme-c11a10e0e6dab07edae2fb9512419f35fb498b8b.zip
Makefile: add serve mode
-rw-r--r--Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ff9effc..bd14807 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,14 @@
+PY?=python3
+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 cl-theme '
@echo ' '
@@ -11,9 +22,12 @@ help:
@echo ' make aplaylist compile playlist styles '
@echo ' make fonts generate fonts '
@echo ' make js compile javascript files '
+ @echo ' make serve [PY=python] [PORT=8000] serve site at http://localhost:8000 '
@echo ' '
-all: clean bulma fonts icons js styles playlist aplaylist
+all: generate
+
+generate: clean bulma fonts icons js styles playlist aplaylist
clean:
@rm -rf dist/
@@ -37,3 +51,10 @@ fonts:
@bash scripts/fonts.sh
js:
@bash scripts/js.sh
+
+serve: generate
+ifdef PORT
+ $(PY) -m $(SERVERMODULE) $(PORT)
+else
+ $(PY) -m $(SERVERMODULE)
+endif