Makefile 738 B

1234567891011121314151617181920212223242526
  1. SOURCE_FILES=$(shell find . -name "*.rs" -or -name "*.lock" -or -name "*.toml" | grep -v target)
  2. PACKAGES=$(shell find . -name "Cargo.toml" | grep -E 'packages|contracts' | xargs cat | grep "name *=" | cut -d' ' -f3 | sed s/\"//g | sed s/-/_/g)
  3. WASMS=$(patsubst %, artifacts/%.wasm, $(PACKAGES))
  4. -include ../Makefile.help
  5. .PHONY: artifacts
  6. ## Build contracts.
  7. artifacts: artifacts/checksums.txt
  8. $(WASMS) artifacts/checksums.txt: $(SOURCE_FILES)
  9. DOCKER_BUILDKIT=1 docker build --target artifacts -o artifacts -f ./Dockerfile ../
  10. tools/node_modules: tools/package-lock.json
  11. cd tools && npm ci
  12. .PHONY: test
  13. ## Run unit tests
  14. test:
  15. cargo test --workspace --locked
  16. .PHONY: clean
  17. clean:
  18. rm -f $(WASMS)
  19. rm -f artifacts/checksums.txt