cc-haxe/Makefile

43 lines
858 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-03-03 14:47:11 +00:00
HAXE_FLAGS =
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-03-03 14:47:11 +00:00
debug: HAXE_FLAGS += -D webconsole --debug
debug: build
2022-02-24 18:47:27 +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:
2022-03-03 14:47:11 +00:00
find src -name "*.hx" | entr make debug
2022-02-20 00:29:47 +00:00
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