From 1c0b5ce56df6e6cd2d27179dc3e6b26bdb3061ef Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 5 Sep 2023 02:31:05 +0200 Subject: Makefile: Remove errors when APP_NAME has no spaces Add some conditionals to remove the targets that rename the bundle the application name has spaces in it. This fixes the warnings and circular dependency problems we had when building an application bundle with no spaces where `APP_NAME` and `APP_NAME_NOSPACE` are the same. The rules and organisation definitely need to be cleaned up, but the idea works. We should eliminate one of these conditions and put all the related rules together under a single `ifneq`. --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index ce49cc1..09bb98e 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ $(PRODUCT): $(OBJECTS) | build build: mkdir -p build +ifneq ($(APP_NAME),$(APP_NAME_NOSPACE)) # build/$(APP_NAME).app: build/$(APP_NAME_NOSPACE).app # cp -R $< "${@}" build/$(APP_NAME).app: $(NOSPACE_BUNDLE_FILES) @@ -47,6 +48,7 @@ build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE) # build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME): \ # build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE) # mv $< "${@}" +endif build/$(APP_NAME_NOSPACE).app: | build mkdir -p build/$(APP_NAME_NOSPACE).app @@ -88,6 +90,13 @@ Internationalization/%.lproj \ | build/$(APP_NAME_NOSPACE).app/Contents/Resources cp -R $< "${@}" +ifeq ($(APP_NAME),$(APP_NAME_NOSPACE)) +.PHONY: app +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)) +else .PHONY: app app: \ build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE) \ @@ -97,6 +106,7 @@ build/$(APP_NAME).app \ build/$(APP_NAME).app/Contents/MacOS/$(APP_NAME) # $(subst Internationalization/,build/$(APP_NAME_NOSPACE).app/Contents/Resources/,$(LOCALIZABLE_STRINGS)) +endif .PHONY: genstrings -- cgit v1.2.3