From 8679d090407c57bc75ec3355251b3eea22796755 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 9 Feb 2025 08:13:13 -0500 Subject: [PATCH] build: Build a fat macos binary. --- GNUmakefile | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 32ee6156..6233dbbf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -158,6 +158,13 @@ MACOS_TARGETS := \ out/macosrelease-arm/tildefriends \ out/macosdebug-x86_64/tildefriends \ out/macosrelease-x86_64/tildefriends +BUILD_TYPES += \ + macosdebug-arm \ + macosrelease-arm \ + macosdebug-x86_64 \ + macosrelease-x86_64 +all: out/macosdebug/tildefriends.standalone +all: out/macosrelease/tildefriends.standalone else MACOS_TARGETS := endif @@ -309,6 +316,10 @@ $(filter $(BUILD_DIR)/macosdebug-x86_64/%,$(ALL_TARGETS)): CFLAGS += -Iout/opens $(filter $(BUILD_DIR)/macosdebug-arm/%,$(ALL_TARGETS)): CFLAGS += -Iout/openssl/$(UNAME_S)/macos-arm/usr/local/include $(filter $(BUILD_DIR)/macosdebug-x86_64/%,$(ALL_TARGETS)): LDFLAGS += -Lout/openssl/$(UNAME_S)/macos-x86_64/usr/local/lib $(filter $(BUILD_DIR)/macosdebug-arm/%,$(ALL_TARGETS)): LDFLAGS += -Lout/openssl/$(UNAME_S)/macos-arm/usr/local/lib +$(filter $(BUILD_DIR)/macosrelease-x86_64/%,$(ALL_TARGETS)): CFLAGS += -Iout/openssl/$(UNAME_S)/macos-x86_64/usr/local/include +$(filter $(BUILD_DIR)/macosrelease-arm/%,$(ALL_TARGETS)): CFLAGS += -Iout/openssl/$(UNAME_S)/macos-arm/usr/local/include +$(filter $(BUILD_DIR)/macosrelease-x86_64/%,$(ALL_TARGETS)): LDFLAGS += -Lout/openssl/$(UNAME_S)/macos-x86_64/usr/local/lib +$(filter $(BUILD_DIR)/macosrelease-arm/%,$(ALL_TARGETS)): LDFLAGS += -Lout/openssl/$(UNAME_S)/macos-arm/usr/local/lib endif $(IOSSIM_TARGETS): CFLAGS += -Iout/openssl/ios/iossimulator-xcrun/usr/local/include $(IOSSIM_TARGETS): LDFLAGS += -Lout/openssl/ios/iossimulator-xcrun/usr/local/lib @@ -1260,6 +1271,10 @@ $(IOS_DEPS): $(filter $(BUILD_DIR)/ios%,$(APP_OBJS)): | $(IOS_DEPS) endif +out/macos%/tildefriends: out/macos%-arm/tildefriends out/macos%-x86_64/tildefriends + @echo [lipo] $@ + @deps/macos_toolchain/bin/lipo -create -output $@ $^ + ## ## Linux package targets: ## @@ -1338,7 +1353,20 @@ tarball: ## Build an all-inclusive source tarball (.tar.xz). .PHONY: tarball dist: ## Build versions of all distributables for release. -dist: release-apk $(if $(HAVE_LINUX_IOS), iosrelease-ipa) aab $(if $(HAVE_WIN), out/winrelease/tildefriends.standalone.exe) out/TildeFriends-release.fdroid.apk appimage tarball out/release/tildefriends.standalone $(if $(HAVE_CROSS_AARCH64), out/armrelease/tildefriends.standalone) +dist: release-apk aab out/TildeFriends-release.fdroid.apk appimage tarball out/release/tildefriends.standalone +ifeq ($(HAVE_LINUX_IOS),1) +dist: iosrelease-ipa +endif +ifeq ($(HAVE_LINUX_MACOS),1) +dist: out/macosrelease/tildefriends.standalone +endif +ifeq ($(HAVE_WIN),1) +dist: out/winrelease/tildefriends.standalone.exe +endif +ifeq ($(HAVE_CROSS_AARCH64),1) +dist: out/armrelease/tildefriends.standalone +endif +dist: @mkdir -p dist/ @echo "[cp] tildefriends-$(VERSION_NUMBER).tar.xz" @cp out/tildefriends-$(VERSION_NUMBER).tar.xz dist/tildefriends-$(VERSION_NUMBER).tar.xz @@ -1348,6 +1376,8 @@ dist: release-apk $(if $(HAVE_LINUX_IOS), iosrelease-ipa) aab $(if $(HAVE_WIN), @cp out/TildeFriends-arm-release.zopfli.apk dist/TildeFriends-arm-$(VERSION_NUMBER).apk @test $(HAVE_LINUX_IOS) && echo "[cp] TildeFriends-$(VERSION_NUMBER).ipa" @test $(HAVE_LINUX_IOS) && cp out/tildefriends-release.ipa dist/TildeFriends-$(VERSION_NUMBER).ipa + @test $(HAVE_LINUX_MACOS) && echo "[cp] tildefriends-macos-$(VERSION_NUMBER)" + @test $(HAVE_LINUX_MACOS) && cp out/macosrelease/tildefriends.standalone dist/tildefriends-macos-$(VERSION_NUMBER) @test $(HAVE_WIN) && echo "[cp] tildefriends-$(VERSION_NUMBER).exe" @test $(HAVE_WIN) && cp out/winrelease/tildefriends.standalone.exe dist/tildefriends-$(VERSION_NUMBER).exe @echo "[cp] TildeFriends-$(VERSION_NUMBER).aab"