BUNDLE_NAME = bundle.lua HAXE_NAME = haxe.lua MINIFYD_NAME = bundle.min.lua BUILD_DIR = build HAXE_FLAGS = POLYFILLED_NAME = bundle.polyfill.lua POLYFILL_SRC = src/polyfill.lua HAXE_PATH := $(BUILD_DIR)/$(HAXE_NAME) MIN_PATH := $(BUILD_DIR)/$(MINIFYD_NAME) POLYFILL_PATH := $(BUILD_DIR)/$(POLYFILLED_NAME) all: clean build build: $(MIN_PATH) debug: HAXE_FLAGS += -D webconsole --debug debug: build $(HAXE_PATH): $(shell find src -name '*.hx') haxe build.hxml $(HAXE_FLAGS) --cmd "cp build/haxe.lua $(HAXE_PATH)" $(MIN_PATH): $(POLYFILL_PATH) node minify.js $(POLYFILL_PATH) $@ $(POLYFILL_PATH): $(POLYFILL_SRC) $(HAXE_PATH) cat $(POLYFILL_SRC) $(HAXE_PATH) > $@ deps: package.json build.hxml haxelib install all --always && yarn install clean: rm -rf $(BUILD_DIR) watch: find src -name "*.hx" | entr make debug emulator: craftos --mount-ro /=build webconsole: node console.js