2022-02-20 20:29:04 +01:00
|
|
|
BUNDLE_NAME = bundle.lua
|
|
|
|
HAXE_NAME = haxe.lua
|
2022-02-21 02:44:38 +01:00
|
|
|
MINIFYD_NAME = bundle.min.lua
|
|
|
|
BUILD_DIR = build
|
2022-03-01 13:20:23 +01:00
|
|
|
HAXE_FLAGS =
|
2022-02-20 20:29:04 +01:00
|
|
|
POLYFILLED_NAME = bundle.polyfill.lua
|
|
|
|
POLYFILL_SRC = src/polyfill.lua
|
2022-02-19 21:48:34 +01:00
|
|
|
|
2022-02-20 20:29:04 +01:00
|
|
|
HAXE_PATH := $(BUILD_DIR)/$(HAXE_NAME)
|
2022-02-19 21:48:34 +01:00
|
|
|
MIN_PATH := $(BUILD_DIR)/$(MINIFYD_NAME)
|
2022-02-20 20:29:04 +01:00
|
|
|
POLYFILL_PATH := $(BUILD_DIR)/$(POLYFILLED_NAME)
|
2022-02-19 21:48:34 +01:00
|
|
|
|
2022-02-21 02:44:38 +01:00
|
|
|
all: clean build
|
2022-02-19 21:48:34 +01:00
|
|
|
|
2022-02-20 01:29:28 +01:00
|
|
|
build: $(MIN_PATH)
|
|
|
|
|
2022-02-24 19:47:27 +01:00
|
|
|
$(HAXE_PATH): $(shell find src -name '*.hx')
|
2022-02-20 01:29:28 +01:00
|
|
|
haxe build.hxml $(HAXE_FLAGS)
|
2022-02-19 21:48:34 +01:00
|
|
|
|
2022-02-20 20:29:04 +01:00
|
|
|
$(MIN_PATH): $(POLYFILL_PATH)
|
|
|
|
node minify.js $(POLYFILL_PATH) $@
|
|
|
|
|
|
|
|
$(POLYFILL_PATH): $(POLYFILL_SRC) $(HAXE_PATH)
|
|
|
|
cat $(POLYFILL_SRC) $(HAXE_PATH) > $@
|
2022-02-19 21:48:34 +01:00
|
|
|
|
|
|
|
deps: package.json build.hxml
|
|
|
|
haxelib install all --always && yarn install
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BUILD_DIR)
|
2022-02-20 01:29:47 +01:00
|
|
|
|
|
|
|
watch:
|
|
|
|
find src -name "*.hx" | entr make build
|
|
|
|
|
2022-02-21 02:44:38 +01:00
|
|
|
emulator:
|
2022-02-20 01:29:47 +01:00
|
|
|
craftos --mount-ro /=build
|
2022-02-20 01:30:32 +01:00
|
|
|
|
|
|
|
webconsole:
|
|
|
|
node console.js
|