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