Skip to content

Commit

Permalink
app: improve Makefile for platform builds
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfi committed Jan 21, 2025
1 parent b547cd6 commit 2f973f3
Showing 1 changed file with 43 additions and 11 deletions.
54 changes: 43 additions & 11 deletions bin/app/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.POSIX:

APK = target/android-artifacts/release/apk/darkfi-app.apk
RELEASE_APK = target/android-artifacts/release/apk/darkfi-app.apk
DEBUG_APK = target/android-artifacts/debug/apk/darkfi-app.apk

SRC = \
build.rs \
Expand All @@ -11,32 +12,63 @@ SRC = \
$(shell find src -type f)

RELEASE_FEATURES = --features=enable-plugins
DEBUG_FEATURES = --features=enable-filelog,enable-plugins

#FEATURES = --features=enable-filelog,enable-netdebug,emulate-android
#FEATURES = --features=enable-filelog,enable-netdebug,enable-plugins
DEV_FEATURES = --features=enable-filelog,enable-netdebug

all: $(SRC) fonts
cargo build --release $(RELEASE_FEATURES)
-mv target/release/darkfi-app .
default: build-release
./darkfi-app

dev: $(SRC) fonts
cargo lbuild $(DEV_FEATURES)
-mv target/debug/darkfi-app .
./darkfi-app
android: android-release

android: $(SRC) fonts
# Platform release builds

macos-release: release-build
-mv darkfi-app darkfi-app.macos
macos-debug: debug-build
-mv darkfi-app darkfi-app_debug.macos
linux-release: release-build
-mv darkfi-app darkfi-app.linux
linux-debug: debug-build
-mv darkfi-app darkfi-app_debug.linux
win-release: $(SRC) fonts
cargo build --release $(RELEASE_FEATURES)
-mv target/release/darkfi-app.exe .
win-debug: $(SRC) fonts
cargo build $(DEBUG_FEATURES)
-mv target/debug/darkfi-app.exe .
android-release: $(SRC) fonts
podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build --release $(RELEASE_FEATURES)
-mv $(APK) .
-mv $(RELEASE_APK) .
android-debug: $(SRC) fonts
podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build $(DEBUG_FEATURES)
-mv $(DEBUG_APK) .

build-release: $(SRC) fonts
cargo build --release $(RELEASE_FEATURES)
-mv target/release/darkfi-app .
build-debug: $(SRC) fonts
cargo build $(DEBUG_FEATURES)
-mv target/debug/darkfi-app .

# Download font data

fonts: ibm-plex-mono-regular.otf NotoColorEmoji.ttf

ibm-plex-mono-regular.otf:
wget -c https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/ibm-plex-mono-regular.otf

NotoColorEmoji.ttf:
wget -c https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/NotoColorEmoji.ttf

fonts: ibm-plex-mono-regular.otf NotoColorEmoji.ttf
# Developer targets

dev: $(SRC) fonts
cargo lbuild $(DEV_FEATURES)
-mv target/debug/darkfi-app .
./darkfi-app

apk: darkfi-app.apk
podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build $(DEV_FEATURES)
Expand Down

0 comments on commit 2f973f3

Please sign in to comment.