Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # The toolchain we use.
  2. # You can get it by running DragonOS' `tools/bootstrap.sh`
  3. # TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu"
  4. # RUSTFLAGS+="-C target-feature=+crt-static -C link-arg=-no-pie"
  5. # 如果是在dadk中编译,那么安装到dadk的安装目录中
  6. INSTALL_DIR?=$(DADK_CURRENT_BUILD_DIR)
  7. # 如果是在本地编译,那么安装到当前目录下的install目录中
  8. INSTALL_DIR?=./install
  9. run:
  10. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run
  11. build:
  12. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build
  13. check:
  14. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) check --all-features
  15. clean:
  16. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean
  17. test:
  18. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test
  19. doc:
  20. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) doc
  21. fmt:
  22. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt
  23. fmt-check:
  24. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt --check
  25. run-release:
  26. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run --release
  27. build-release:
  28. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build --release
  29. clean-release:
  30. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean --release
  31. test-release:
  32. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test --release
  33. .PHONY: install
  34. install:
  35. RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) install --path . --no-track --root $(INSTALL_DIR) --force