Makefile 746 B

12345678910111213141516171819202122232425262728
  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_NOVA_SHELL_0_1_0)
  4. TMP_INSTALL_DIR=$(OUTPUT_DIR)/tmp_install
  5. all: build
  6. build:
  7. RUSTFLAGS='-C target-feature=+crt-static -C link-arg=-no-pie' cargo build --target=x86_64-unknown-linux-musl --release
  8. install:
  9. mkdir -p $(TMP_INSTALL_DIR)
  10. mkdir -p $(OUTPUT_DIR)
  11. RUSTFLAGS='-C target-feature=+crt-static -C link-arg=-no-pie' cargo install --target=x86_64-unknown-linux-musl --path . --root $(TMP_INSTALL_DIR)
  12. mv $(TMP_INSTALL_DIR)/bin/NovaShell $(OUTPUT_DIR)/NovaShell
  13. rm -rf $(TMP_INSTALL_DIR)
  14. clean:
  15. cargo clean
  16. fmt:
  17. cargo fmt
  18. fmt-check:
  19. cargo fmt --check