cc-haxe/Makefile

40 lines
815 B
Makefile
Raw Normal View History

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