40 lines
823 B
Makefile
40 lines
823 B
Makefile
BUNDLE_NAME = bundle.lua
|
|
HAXE_NAME = haxe.lua
|
|
MINIFYD_NAME = bundle.min.lua
|
|
BUILD_DIR = build
|
|
HAXE_FLAGS = -D webconsole --debug
|
|
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)
|
|
|
|
$(HAXE_PATH): $(shell find src -name '*.hx')
|
|
haxe build.hxml $(HAXE_FLAGS)
|
|
|
|
$(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 build
|
|
|
|
emulator:
|
|
craftos --mount-ro /=build
|
|
|
|
webconsole:
|
|
node console.js
|