lexonomy_custom_editor/build/Makefile

43 lines
835 B
Makefile
Raw Normal View History

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
BR_FLAGS=-p esmify --debug
LESS_FLAGS=--include-path=../node_modules/picnic
2019-11-05 21:18:20 +00:00
LESS_FILE=$(RES_FOLDER)/main.less
PY_FILE=$(SRC_FOLDER)/main.py
HTML_FILE=$(RES_FOLDER)/main.html
.PHONY: all transcrypt $(LESS_FILE) $(PY_FILE) $(HTML_FILE)
# mypy:
# mypy src/main.py
all: main.css bundle.js index.html
2019-11-05 21:18:20 +00:00
transcrypt: $(PY_FILE) $(TS_BUILD)
2019-11-05 21:18:20 +00:00
transcrypt $(TS_FLAGS) $<
bundle.js: transcrypt
cd ..; browserify $(BR_FLAGS) build/$(TS_BUILD)/main.js -o build/bundle.js
2019-11-05 21:18:20 +00:00
main.css: $(LESS_FILE)
lessc $(LESS_FLAGS) $< > $@
2019-11-05 21:18:20 +00:00
$(TS_BUILD):
mkdir -p $(TS_BUILD)
index.html: $(HTML_FILE)
cp $(RES_FOLDER)/main.html $@
2019-11-05 21:18:20 +00:00
clean:
rm -fr $(TS_BUILD)
rm -f bundle.js index.html main.css
2019-11-05 21:18:20 +00:00