From 6fe436a5cc970ab3e7a1ed5c927114b023092719 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Sat, 20 Apr 2024 13:48:07 +0800 Subject: [PATCH] update makefile --- Makefile | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 6b6f095c..64f6b95d 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,21 @@ -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -current_dir := $(dir $(mkfile_path)) -parent_dir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..) - -filament_build_out := $(parent_dir)/filament/out/cmake-release - # building on MacOS, we currently just delete the macos/include # and macos/src directories and copy from iOS - sync-macos: FORCE rm -rf ${current_dir}macos/include ${current_dir}macos/src cp -R ${current_dir}ios/include ${current_dir}macos cp -R ${current_dir}ios/src ${current_dir}macos +# We compile a small set of custom materials for various helpers (background image, gizmo, etc) +# You must specify the `FILAMENT_PATH` environment variable, either the path /out/release +# eg: FILAMENT_PATH=/path/to/filament/out/release/bin make materials +# +materials: FORCE + @echo "Using Filament build from ${FILAMENT_PATH}" + ${FILAMENT_PATH}/matc -a opengl -a metal -o materials/image.filamat materials/image.mat + $(FILAMENT_PATH)/resgen -c -p image -x ios/include/material/ materials/image.filamat + $(FILAMENT_PATH)/matc -a opengl -a metal -o materials/gizmo.filamat materials/gizmo.mat + $(FILAMENT_PATH)/resgen -c -p gizmo -x ios/include/material/ materials/gizmo.filamat + #rm materials/*.filamat + FORCE: ; -# We use a single material (no lighting and no transparency) for background images -# -# by default this assumes you have built filament in a sibling folder -# you may customize the out folder by speicifying `filament_build_out` -# -# eg: make generate-background-material filament_build_out=/filament/out/release -# -generate-background-material: - ${filament_build_out}/tools/matc/matc -a opengl -a metal -o materials/image.filamat materials/image.mat - ${filament_build_out}/tools/resgen/resgen -c -p image -x ios/include/material/ materials/image.filamat - rm materials/image.filamat