Преглед изворни кода

app: cleanup Makefile targets and add MacOS build instructions to README

darkfi пре 3 недеља
родитељ
комит
fb3d9ed0ed
2 измењених фајлова са 23 додато и 17 уклоњено
  1. 6 17
      bin/app/Makefile
  2. 17 0
      bin/app/README.md

+ 6 - 17
bin/app/Makefile

@@ -35,34 +35,23 @@ DEV_FEATURES = --features=schema-app,enable-filelog,enable-netdebug,enable-plugi
 default: build-release
 default: build-release
 	./darkfi-app
 	./darkfi-app
 
 
-android: android-release
-
 # Platform release builds
 # Platform release builds
 
 
-macos-release: build-release
-	-mv darkfi-app darkfi-app.macos
-macos-debug: build-debug
-	-mv darkfi-app darkfi-app_debug.macos
-linux-release: build-release
+macos: $(SRC) $(PROOFS_BIN) fonts assets/forest_1920x1080.ivf
+	$(CARGO) zigbuild --no-default-features --release --target universal2-apple-darwin $(RELEASE_FEATURES)
+	-mv target/universal2-apple-darwin/release/darkfi-app darkfi-app.macos
+linux: build-release
 	-mv darkfi-app darkfi-app.linux
 	-mv darkfi-app darkfi-app.linux
-linux-debug: build-debug
-	-mv darkfi-app darkfi-app_debug.linux
-win64-msvc: $(SRC) $(PROOFS_BIN) fonts
+win64-msvc: $(SRC) $(PROOFS_BIN) fonts assets/forest_1920x1080.ivf
 	PATH="$(shell pwd)/release/win:$$PATH" $(CARGO) xwin build --no-default-features --release --target x86_64-pc-windows-msvc $(RELEASE_FEATURES)
 	PATH="$(shell pwd)/release/win:$$PATH" $(CARGO) xwin build --no-default-features --release --target x86_64-pc-windows-msvc $(RELEASE_FEATURES)
 	-mv target/x86_64-pc-windows-msvc/release/darkfi-app.exe .
 	-mv target/x86_64-pc-windows-msvc/release/darkfi-app.exe .
-android-release: $(SRC) $(PROOFS_BIN) fonts assets/forest_720x1280.mp4
+android: $(SRC) $(PROOFS_BIN) fonts assets/forest_720x1280.mp4
 	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build --no-default-features --release $(RELEASE_FEATURES)
 	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build --no-default-features --release $(RELEASE_FEATURES)
 	-mv $(RELEASE_APK) darkfi-app.apk
 	-mv $(RELEASE_APK) darkfi-app.apk
-android-debug: $(SRC) $(PROOFS_BIN) fonts assets/forest_720x1280.mp4
-	podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build --no-default-features $(DEBUG_FEATURES)
-	-mv $(DEBUG_APK) darkfi-app_debug.apk
 
 
 build-release: $(SRC) $(PROOFS_BIN) fonts assets/forest_1920x1080.ivf
 build-release: $(SRC) $(PROOFS_BIN) fonts assets/forest_1920x1080.ivf
 	$(CARGO) build --no-default-features --release $(RELEASE_FEATURES)
 	$(CARGO) build --no-default-features --release $(RELEASE_FEATURES)
 	-mv target/release/darkfi-app .
 	-mv target/release/darkfi-app .
-build-debug: $(SRC) $(PROOFS_BIN) fonts assets/forest_1920x1080.ivf
-	$(CARGO) build --no-default-features $(DEBUG_FEATURES)
-	-mv target/debug/darkfi-app .
 
 
 # Download font data
 # Download font data
 
 

+ 17 - 0
bin/app/README.md

@@ -49,6 +49,23 @@ install [Microsoft Visual C++ Redistributable][msvc++].
 [cargo-xwin]: https://github.com/rust-cross/cargo-xwin
 [cargo-xwin]: https://github.com/rust-cross/cargo-xwin
 [msvc++]: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022
 [msvc++]: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022
 
 
+# MacOS
+
+Building for MacOS is done on a Mac. The `macos` target builds a
+universal (aarch64 + x86_64) binary using [cargo-zigbuild].
+Also install [rustup](rustup.rs), then:
+
+```
+$ rustup target add aarch64-apple-darwin x86_64-apple-darwin
+$ cargo install cargo-zigbuild
+$ make macos
+```
+
+The resulting `darkfi-app.macos` is placed in `bin/app/`. It is ad-hoc
+signed and runs as-is.
+
+[cargo-zigbuild]: https://github.com/rust-cross/cargo-zigbuild
+
 # Android
 # Android
 
 
 Make sure you have podman installed. Then run:
 Make sure you have podman installed. Then run: