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 -t brfs --debug LESS_FLAGS=--include-path=../node_modules/picnic CSS_FILE=main.css LESS_FILE=main.less PY_FILE=main.py HTML_FILE=main.html XML_FILE=vsms1.xml 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) .PHONY: all transcrypt copy $(RES_LESS_FILE) $(RES_PY_FILE) $(RES_HTML_FILE) $(RES_XML_FILE) 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 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) $(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 $(HTML_FILE) $(XML_FILE) bundle.js index.html main.css