Makefile 2.6 KB

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