Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .POSIX:
  2. # Cargo binary
  3. CARGO = cargo +nightly
  4. RELEASE_APK = target/android-artifacts/release/apk/darkfi-app.apk
  5. DEBUG_APK = target/android-artifacts/debug/apk/darkfi-app.apk
  6. SRC = \
  7. build.rs \
  8. Cargo.lock \
  9. Cargo.toml \
  10. Dockerfile \
  11. $(shell find assets -type f) \
  12. $(shell find src -type f)
  13. RELEASE_FEATURES = --features=enable-plugins
  14. DEBUG_FEATURES = --features=enable-filelog,enable-plugins
  15. #DEV_FEATURES = --features=enable-filelog,enable-netdebug,emulate-android
  16. #DEV_FEATURES = --features=enable-filelog,enable-netdebug,enable-plugins
  17. DEV_FEATURES = --features=enable-filelog,enable-netdebug
  18. default: build-release
  19. ./darkfi-app
  20. android: android-release
  21. # Platform release builds
  22. macos-release: build-release
  23. -mv darkfi-app darkfi-app.macos
  24. macos-debug: build-debug
  25. -mv darkfi-app darkfi-app_debug.macos
  26. linux-release: build-release
  27. -mv darkfi-app darkfi-app.linux
  28. linux-debug: build-debug
  29. -mv darkfi-app darkfi-app_debug.linux
  30. win-release: $(SRC) fonts
  31. $(CARGO) build --release $(RELEASE_FEATURES)
  32. -mv target/release/darkfi-app.exe .
  33. win-debug: $(SRC) fonts
  34. $(CARGO) build $(DEBUG_FEATURES)
  35. -mv target/debug/darkfi-app.exe .
  36. android-release: $(SRC) fonts
  37. podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build --release $(RELEASE_FEATURES)
  38. -mv $(RELEASE_APK) darkfi-app.apk
  39. android-debug: $(SRC) fonts
  40. podman run -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build $(DEBUG_FEATURES)
  41. -mv $(DEBUG_APK) darkfi-app_debug.apk
  42. build-release: $(SRC) fonts
  43. $(CARGO) build --release $(RELEASE_FEATURES)
  44. -mv target/release/darkfi-app .
  45. build-debug: $(SRC) fonts
  46. $(CARGO) build $(DEBUG_FEATURES)
  47. -mv target/debug/darkfi-app .
  48. # Download font data
  49. fonts: ibm-plex-mono-regular.otf NotoColorEmoji.ttf
  50. ibm-plex-mono-regular.otf:
  51. wget -c https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/ibm-plex-mono-regular.otf
  52. NotoColorEmoji.ttf:
  53. wget -c https://codeberg.org/darkrenaissance/darkfi/raw/branch/data/NotoColorEmoji.ttf
  54. # Developer targets
  55. dev: $(SRC) fonts
  56. $(CARGO) lbuild $(DEV_FEATURES)
  57. -mv target/debug/darkfi-app .
  58. ./darkfi-app
  59. apk: $(SRC) fonts
  60. podman run -v /home/narodnik/src/stuff/miniquad:/root/mq -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -t apk cargo quad-apk build $(DEV_FEATURES)
  61. -mv $(DEBUG_APK) .
  62. -adb uninstall darkfi.darkfi_app
  63. adb install -r darkfi-app.apk
  64. reset
  65. adb logcat -c
  66. adb logcat -v color -s darkfi -s SAPP -s libc -s DEBUG -s ActivityManager -s ActivityTaskManager -s WindowManager -s AndroidRuntime -s rkfi.darkfi_app
  67. # Useful for dev
  68. cli:
  69. podman run -v /home/narodnik/src/stuff/parley:/root/parley -v /home/narodnik/src/stuff/miniquad:/root/mq -v $(shell pwd)/../../:/root/darkfi -w /root/darkfi/bin/app/ -it apk bash
  70. clean:
  71. podman run -v $(shell pwd):/root/dw -w /root/dw -t apk rm -fr target/
  72. rm -f darkfi-app.apk
  73. .PHONY: all android cli clean