diff options
author | Jesús <heckyel@hyperbola.info> | 2021-12-05 19:06:19 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-12-05 19:06:19 -0500 |
commit | c11a10e0e6dab07edae2fb9512419f35fb498b8b (patch) | |
tree | 83170326bde2730fff4908415f43969fa67f841a | |
parent | d0c8d9447ddc599c623a2242ff12967c0bdbb2f7 (diff) | |
download | cl-theme-c11a10e0e6dab07edae2fb9512419f35fb498b8b.tar.lz cl-theme-c11a10e0e6dab07edae2fb9512419f35fb498b8b.tar.xz cl-theme-c11a10e0e6dab07edae2fb9512419f35fb498b8b.zip |
Makefile: add serve mode
-rw-r--r-- | Makefile | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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 |