Moving xml to outer file and now html simple and xml direct from Cyprian

Also, cleaned makefile, less magic strings
This commit is contained in:
2020-01-14 00:03:42 +01:00
parent b2d1441e9a
commit 38fe7a5740
4 changed files with 138 additions and 80 deletions

View File

@@ -4,39 +4,50 @@ RES_FOLDER=$(CURDIR)/../res
TS_BUILD=tsbuild
TS_FLAGS=-da -n -m -od ../build/$(TS_BUILD) # has to be relative for some reason
BR_FLAGS=-p esmify --debug
BR_FLAGS=-p esmify -t brfs --debug
LESS_FLAGS=--include-path=../node_modules/picnic
LESS_FILE=$(RES_FOLDER)/main.less
PY_FILE=$(SRC_FOLDER)/main.py
HTML_FILE=$(RES_FOLDER)/main.html
CSS_FILE=main.css
LESS_FILE=main.less
PY_FILE=main.py
HTML_FILE=main.html
XML_FILE=vsms1.xml
.PHONY: all transcrypt $(LESS_FILE) $(PY_FILE) $(HTML_FILE)
RES_LESS_FILE=$(RES_FOLDER)/$(LESS_FILE)
RES_PY_FILE=$(SRC_FOLDER)/$(PY_FILE)
RES_HTML_FILE=$(RES_FOLDER)/$(HTML_FILE)
RES_XML_FILE=$(RES_FOLDER)/$(XML_FILE)
# mypy:
# mypy src/main.py
.PHONY: all transcrypt copy $(RES_LESS_FILE) $(RES_PY_FILE) $(RES_HTML_FILE) $(RES_XML_FILE)
all: main.css bundle.js index.html
transcrypt: $(PY_FILE) $(TS_BUILD)
all: copy $(CSS_FILE) bundle.js local.js
transcrypt: $(RES_PY_FILE) $(TS_BUILD)
transcrypt $(TS_FLAGS) $<
bundle.js: transcrypt
cd ..; browserify $(BR_FLAGS) build/$(TS_BUILD)/main.js -o build/bundle.js
main.css: $(LESS_FILE)
local.js:
browserify $(BR_FLAGS) ../src/local.js -o ./local.js
$(CSS_FILE): $(RES_LESS_FILE)
lessc $(LESS_FLAGS) $< > $@
$(TS_BUILD):
mkdir -p $(TS_BUILD)
index.html: $(HTML_FILE)
cp $(RES_FOLDER)/main.html $@
$(HTML_FILE): $(RES_HTML_FILE)
cp $(RES_HTML_FILE) $@
$(XML_FILE): $(RES_XML_FILE)
cp $(RES_XML_FILE) $@
copy: $(XML_FILE) $(HTML_FILE)
clean:
rm -fr $(TS_BUILD)
rm -f bundle.js index.html main.css
rm -f $(HTML_FILE) $(XML_FILE) bundle.js index.html main.css