added makefile
This commit is contained in:
parent
fe600cbf6b
commit
0812b43bb8
20
Makefile
Normal file
20
Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
BIN_NAME := Haxe.lua
|
||||||
|
MINIFYD_NAME := Haxe.min.lua
|
||||||
|
BUILD_DIR := build
|
||||||
|
|
||||||
|
BIN_PATH := $(BUILD_DIR)/$(BIN_NAME)
|
||||||
|
MIN_PATH := $(BUILD_DIR)/$(MINIFYD_NAME)
|
||||||
|
|
||||||
|
all: clean $(MIN_PATH)
|
||||||
|
|
||||||
|
$(BIN_PATH): $(shell find src -name '*.hx')
|
||||||
|
haxe build.hxml --lua $@
|
||||||
|
|
||||||
|
$(MIN_PATH): $(BIN_PATH)
|
||||||
|
node minify.js $@
|
||||||
|
|
||||||
|
deps: package.json build.hxml
|
||||||
|
haxelib install all --always && yarn install
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(BUILD_DIR)
|
@ -5,5 +5,5 @@
|
|||||||
|
|
||||||
--dce full
|
--dce full
|
||||||
|
|
||||||
--lua build/Haxe.lua
|
# --lua build/Haxe.lua
|
||||||
-D lua-vanilla
|
-D lua-vanilla
|
||||||
|
@ -5,6 +5,6 @@ const haxeOutput = fs.readFileSync("build/Haxe.lua",{encoding:"utf8"});
|
|||||||
|
|
||||||
const minified = luamin.minify(haxeOutput);
|
const minified = luamin.minify(haxeOutput);
|
||||||
|
|
||||||
fs.writeFileSync("build/Haxe.min.lua",minified);
|
fs.writeFileSync(process.argv[2] ?? "build/Haxe.min.lua",minified);
|
||||||
|
|
||||||
console.log("minified lua");
|
console.log("minified lua");
|
||||||
|
Loading…
Reference in New Issue
Block a user