2018-04-08 15:07:13 +00:00
|
|
|
GODOT?=godot3-server
|
|
|
|
EXPORT_TEMPLATE_SOURCE?=https://downloads.tuxfamily.org/godotengine/3.0.2/Godot_v3.0.2-stable_export_templates.tpz
|
2018-04-07 14:58:42 +00:00
|
|
|
BUILD_DIR?=build
|
|
|
|
GODOT_PROJECT_PATH?=game
|
|
|
|
PROJECT_NAME?=game
|
2018-04-08 15:28:25 +00:00
|
|
|
GODOT_TEMPLATE_DIR?=~/.local/share/godot/templates
|
|
|
|
GODOT_TEMPLATE_VERSION?=3.0.2.stable
|
2018-04-07 14:58:42 +00:00
|
|
|
TARGET_HTML5?=HTML5
|
|
|
|
TARGET_WINDOWS?=Windows Desktop
|
|
|
|
TARGET_MACOSX?=Mac OSX
|
|
|
|
TARGET_LINUX?=Linux/X11
|
2018-04-08 15:38:36 +00:00
|
|
|
WGET_ARGS?=-q
|
2018-04-07 14:58:42 +00:00
|
|
|
build-dir:
|
|
|
|
mkdir -p "$(BUILD_DIR)"
|
2017-12-30 23:42:13 +00:00
|
|
|
|
|
|
|
clean:
|
2018-04-07 14:58:42 +00:00
|
|
|
rm -rf "$(BUILD_DIR)"/
|
|
|
|
|
|
|
|
export-all: export-html5 export-windows export-osx export-linux
|
|
|
|
|
2018-04-07 15:24:19 +00:00
|
|
|
export-pack: build-dir
|
|
|
|
$(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "pack" "../$(BUILD_DIR)/$(PROJECT_NAME).pck"
|
|
|
|
|
2018-04-07 14:58:42 +00:00
|
|
|
export-html5: build-dir
|
|
|
|
mkdir -p "$(BUILD_DIR)/html"
|
|
|
|
$(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_HTML5)" "../$(BUILD_DIR)/html/$(PROJECT_NAME).html"
|
2018-04-07 15:17:46 +00:00
|
|
|
zip -j -r "$(BUILD_DIR)/$(PROJECT_NAME)-html5.zip" "$(BUILD_DIR)/html"
|
2018-04-07 15:30:13 +00:00
|
|
|
rm -rf "$(BUILD_DIR)/html"
|
2018-04-07 14:58:42 +00:00
|
|
|
|
|
|
|
export-windows: build-dir
|
|
|
|
$(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_WINDOWS)" "../$(BUILD_DIR)/$(PROJECT_NAME).exe"
|
|
|
|
|
|
|
|
export-osx: build-dir
|
|
|
|
$(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_MACOSX)" "../$(BUILD_DIR)/$(PROJECT_NAME)-osx"
|
|
|
|
|
|
|
|
export-linux: build-dir
|
|
|
|
$(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_LINUX)" "../$(BUILD_DIR)/$(PROJECT_NAME)-x11"
|
2018-04-08 15:28:25 +00:00
|
|
|
|
|
|
|
install-templates:
|
2018-04-08 16:30:27 +00:00
|
|
|
mkdir -p $(GODOT_TEMPLATE_DIR)
|
2018-04-08 15:38:36 +00:00
|
|
|
wget $(WGET_ARGS) $(EXPORT_TEMPLATE_SOURCE) -O templates.tpz
|
2018-04-08 15:28:25 +00:00
|
|
|
unzip templates.tpz
|
2018-04-08 16:30:27 +00:00
|
|
|
mv templates/ $(GODOT_TEMPLATE_DIR)/$(GODOT_TEMPLATE_VERSION)
|
2018-04-08 15:28:25 +00:00
|
|
|
rm templates.tpz
|
|
|
|
|