2020-01-25 20:43:21 +00:00
|
|
|
.PHONY: all release build transcrypt copy $(RES_LESS_FILE) $(RES_PY_FILE) $(RES_HTML_FILE) $(RES_XML_FILE)
|
|
|
|
|
2019-11-05 21:18:20 +00:00
|
|
|
SRC_FOLDER=$(CURDIR)/../src
|
|
|
|
RES_FOLDER=$(CURDIR)/../res
|
|
|
|
|
|
|
|
TS_BUILD=tsbuild
|
|
|
|
TS_FLAGS=-da -n -m -od ../build/$(TS_BUILD) # has to be relative for some reason
|
2019-11-11 21:59:53 +00:00
|
|
|
LESS_FLAGS=--include-path=../node_modules/picnic
|
2020-01-25 20:43:21 +00:00
|
|
|
BR_FLAGS=-p esmify -t brfs
|
2019-11-11 21:59:53 +00:00
|
|
|
|
2020-01-13 23:03:42 +00:00
|
|
|
CSS_FILE=main.css
|
|
|
|
LESS_FILE=main.less
|
|
|
|
PY_FILE=main.py
|
|
|
|
HTML_FILE=main.html
|
|
|
|
XML_FILE=vsms1.xml
|
2020-04-22 12:22:02 +00:00
|
|
|
CONV_FILE=conversions.csv
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-13 23:03:42 +00:00
|
|
|
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)
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-25 20:43:21 +00:00
|
|
|
.DEFAULT_GOAL := all
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-25 20:43:21 +00:00
|
|
|
all: BR_FLAGS := $(BR_FLAGS) --debug
|
|
|
|
release: BR_FLAGS := $(BR_FLAGS) -p tinyify
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-25 20:43:21 +00:00
|
|
|
release: build
|
|
|
|
all: build
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-25 20:43:21 +00:00
|
|
|
build: copy $(CSS_FILE) bundle.js local.js
|
2020-01-13 23:03:42 +00:00
|
|
|
|
|
|
|
transcrypt: $(RES_PY_FILE) $(TS_BUILD)
|
2019-11-05 21:18:20 +00:00
|
|
|
transcrypt $(TS_FLAGS) $<
|
|
|
|
|
2020-04-22 12:22:02 +00:00
|
|
|
bundle.js: transcrypt $(CONV_FILE)
|
2019-11-11 21:59:53 +00:00
|
|
|
cd ..; browserify $(BR_FLAGS) build/$(TS_BUILD)/main.js -o build/bundle.js
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-13 23:03:42 +00:00
|
|
|
local.js:
|
|
|
|
browserify $(BR_FLAGS) ../src/local.js -o ./local.js
|
|
|
|
|
|
|
|
$(CSS_FILE): $(RES_LESS_FILE)
|
2019-11-11 21:59:53 +00:00
|
|
|
lessc $(LESS_FLAGS) $< > $@
|
2019-11-05 21:18:20 +00:00
|
|
|
|
|
|
|
$(TS_BUILD):
|
|
|
|
mkdir -p $(TS_BUILD)
|
|
|
|
|
2020-01-13 23:03:42 +00:00
|
|
|
$(HTML_FILE): $(RES_HTML_FILE)
|
|
|
|
cp $(RES_HTML_FILE) $@
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-13 23:03:42 +00:00
|
|
|
$(XML_FILE): $(RES_XML_FILE)
|
|
|
|
cp $(RES_XML_FILE) $@
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-04-22 12:22:02 +00:00
|
|
|
$(CONV_FILE): $(TS_BUILD)
|
|
|
|
./download_structure_conversions.sh
|
|
|
|
|
2020-01-13 23:03:42 +00:00
|
|
|
copy: $(XML_FILE) $(HTML_FILE)
|
2019-11-05 21:18:20 +00:00
|
|
|
|
2020-01-13 23:03:42 +00:00
|
|
|
clean:
|
|
|
|
rm -fr $(TS_BUILD)
|
2020-04-22 12:22:02 +00:00
|
|
|
rm -f $(HTML_FILE) $(XML_FILE) bundle.js index.html main.css local.js $(CONV_FILE)
|
2019-11-05 21:18:20 +00:00
|
|
|
|