Files
streaming_world/Makefile
2025-03-17 19:40:50 +03:00

90 lines
3.9 KiB
Makefile

BLENDER = ../../blender-3.6.20-linux-x64/blender
SERVER = src/godot/bin/godot_server.x11.opt.tools.64
.PHONY: all godot-editor-main export export-models export-clothes \
export-clean export-linux-demo export-windows-demo \
export-binaries patch tests import-vrm export-buildings
all: godot-editor-main godot-main
ARCH=$(patsubst aarch64,arm64,$(shell uname -m))
godot-main: patch
cd src/godot; \
scons platform=x11 arch=$(ARCH) target=release tools=no custom_modules=../modules -j16; \
scons platform=x11 arch=$(ARCH) target=release_debug tools=no custom_modules=../modules -j16;
cd src/godot; \
scons platform=x11 arch=$(ARCH) target=release tools=no custom_modules=../modules -j16; \
scons platform=server target=release_debug tools=yes custom_modules=../modules -j16
godot-editor-main: patch
cd src/godot; \
scons platform=x11 arch=$(ARCH) verbose=yes target=release_debug tools=yes custom_modules=../modules -j24;
patch: ./src/godot/scene/animation/skeleton_ik.cpp
cd ./src/godot && git reset --hard HEAD && for p in ../patches/*.patch; do git apply $$p; done
sed -e 's/ERR_FAIL_COND_V(-1 == p_task->root_bone, false);//g' -i ./src/godot/scene/animation/skeleton_ik.cpp
cd ./src/modules/voxel && git reset --hard HEAD && for p in ../../patches/voxel/*.patch; do git apply $$p; done
export: export-models export-clothes
rm -Rf godot/.import
export-clean:
rm -Rf godot/character-data/*
rm -f assets/blender/scripts/tmp-*.blend
install-addons:
$(BLENDER) -b -Y -P assets/blender/scripts/install_addons.py
import-vrm: install-addons export-clean
mkdir -p assets/blender/scripts/shapes/male assets/blender/scripts/shapes/female
$(BLENDER) -b -Y -P assets/blender/scripts/import_vrm.py
export2edit: import-vrm
$(BLENDER) -b -Y -P assets/blender/scripts/export_for_modelling.py
BLENDDIR_BUILDINGS=assets/blender/buildings
GLTFDIR_BUILDINGS=godot/astream/terrain/details
BUILDINGS_BUSINNESS=business-bar1 business-cafe1 business-office1 buisness-store1
BUILDINGS_RESIDENTAL=residental-house1 residental-house2 residental-house3 \
residental-house4 residental-house5 residental-house6 \
residental-house7 residental-house8 residental-house9 \
residental-house10 residental-house11 residental-house13 \
residental-hut1 residental-hut1-lod residental-garage-door \
residental-garage-enterance residental-garage \
residental-parking residental-wall1 residental-wall-corner
BUILDINGS_MAIN=gym-exterior home-exterior \
logistics-center-exterior office-exterior townhall-exterior
BUILDINGS=bus-stop power-in-box power-pole power-pole-wire $(BUILDINGS_BUSINESS) \
$(BUILDINGS_RESIDENTAL) $(BUILDINGS_MAIN) \
zebra
define export_building
$(GLTFDIR_BUILDINGS)/$(1).gltf: $(BLENDDIR_BUILDINGS)/$(1).blend assets/blender/scripts/export_buildings.py
$(BLENDER) -b $(BLENDDIR_BUILDINGS)/$(1).blend -P /home/slapin/godot-projects/streaming_world/assets/blender/scripts/export_buildings.py -- $(GLTFDIR_BUILDINGS)/$(1).gltf
ALL_BUILDINGS += $(GLTFDIR_BUILDINGS)/$(1).gltf
CLEAN_BUILDINGS += $(GLTFDIR_BUILDINGS)/$(1).gltf \
$(GLTFDIR_BUILDINGS)/$(1).bin
endef
$(foreach prog,$(BUILDINGS),$(eval $(call export_building,$(prog))))
export-buildings: $(ALL_BUILDINGS)
@echo $(ALL_BUILDINGS)
clean-buildings:
rm -f $(CLEAN_BUILDINGS) $(GLTFDIR_BUILDINGS)/material_atlas*.material
export-models: export-clean import-vrm
$(BLENDER) -b -Y -P assets/blender/scripts/export_models.py
export-clothes: export-clean
$(BLENDER) -b -Y -P assets/blender/scripts/export_clothes.py
export-binaries:
mkdir -p export
$(SERVER) --path godot --export linux_demo ../export/office-demo-linux.x86_64
$(SERVER) --path godot --export-debug linux_demo ../export/office-demo-debug-linux.x86_64
$(SERVER) --path godot --export windows_demo ../export/office-demo-windows.x86_64.exe
$(SERVER) --path godot --export-debug windows_demo ../export/office-demo-debug-windows.x86_64.exe
tests:
make -C tests all