Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
  2. export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
  3. OUTPUT_DIR = $(DADK_BUILD_CACHE_DIR_DRAGONREACH_0_1_0)
  4. REACH_ETC_DIR=$(OUTPUT_DIR)/etc/reach
  5. REACH_BIN_DIR=$(OUTPUT_DIR)/bin/
  6. TMP_INSTALL_DIR=$(OUTPUT_DIR)/tmp_install
  7. all: build
  8. build:
  9. @$(MAKE) -C ./systemctl build
  10. cargo +nightly-2023-08-15 -Z build-std=core,alloc,compiler_builtins build --target ./x86_64-unknown-dragonos.json --release
  11. install:
  12. mkdir -p $(TMP_INSTALL_DIR)
  13. mkdir -p $(REACH_ETC_DIR)
  14. mkdir -p $(REACH_ETC_DIR)/system/
  15. mkdir -p $(REACH_BIN_DIR)
  16. mkdir -p $(REACH_ETC_DIR)/ipc/
  17. cp ./parse_test/shell.service $(REACH_ETC_DIR)/system/shell.service
  18. cargo +nightly-2023-08-15 -Z build-std=core,alloc,compiler_builtins install --target $(TARGET) --path . --root $(TMP_INSTALL_DIR)
  19. mv $(TMP_INSTALL_DIR)/bin/DragonReach $(REACH_BIN_DIR)/DragonReach
  20. cargo -Z build-std=core,alloc,compiler_builtins install --target $(TARGET) --path ./systemctl --root $(TMP_INSTALL_DIR)
  21. mv $(TMP_INSTALL_DIR)/bin/systemctl $(REACH_BIN_DIR)/systemctl
  22. rm -rf $(TMP_INSTALL_DIR)
  23. build-linux:
  24. @$(MAKE) -C ./systemctl build-linux
  25. cargo -Z build-std=core,alloc,compiler_builtins build --target x86_64-unknown-linux-gnu
  26. clean:
  27. cargo clean
  28. @$(MAKE) -C ./systemctl clean
  29. fmt:
  30. cargo fmt
  31. @$(MAKE) -C ./systemctl fmt
  32. fmt-check:
  33. cargo fmt --check
  34. @$(MAKE) -C ./systemctl fmt-check
  35. check:
  36. cargo -Z build-std=core,alloc,compiler_builtins check --workspace --message-format=json --target ./x86_64-unknown-dragonos.json
  37. @$(MAKE) -C ./systemctl check