From f25e41a5ab4c6ebe2dc0032d96582f3a2149346a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 4 Sep 2023 00:41:17 +0200 Subject: Makefile: Try to not recompile the executable when building .app Keep the temporary .app bundle with substituted spaces around and copy the bundle directory so we don't end up rebuilding the executable file when `make` is re-executed. This does fail on `make` re-execution because the space-substituted binary file was moved and no longer exists. Might have to think about how to make that cleaner later. The more pressing concern is that the final .app bundle with spaces in it reports an error when I try to open it: $ open build/Base\ Windowed\ Application.app The application cannot be opened because its executable is missing. Not sure what the problem is there yet. --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 881d785..5456bd7 100644 --- a/Makefile +++ b/Makefile @@ -34,11 +34,15 @@ build: mkdir -p build build/$(APP_NAME).app: build/$(APP_NAME_NOSPACE).app - mv $< "${@}" + cp -R $< "${@}" + +build/$(APP_NAME).app/Contents/MacOS/$(APP_NAME): \ +build/$(APP_NAME).app/Contents/MacOS/$(APP_NAME_NOSPACE) + mv "${<}" "${@}" -build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME): \ -build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE) - mv $< "${@}" +# build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME): \ +# build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE) +# mv $< "${@}" build/$(APP_NAME_NOSPACE).app: | build mkdir -p build/$(APP_NAME_NOSPACE).app @@ -85,8 +89,8 @@ app: \ build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE) \ build/$(APP_NAME_NOSPACE).app/Contents/Info.plist \ $(subst Internationalization/,build/$(APP_NAME_NOSPACE).app/Contents/Resources/,$(LPROJS)) \ -build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME) \ -build/$(APP_NAME).app +build/$(APP_NAME).app \ +build/$(APP_NAME).app/Contents/MacOS/$(APP_NAME) # $(subst Internationalization/,build/$(APP_NAME_NOSPACE).app/Contents/Resources/,$(LOCALIZABLE_STRINGS)) -- cgit v1.2.3