You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
985 B

  1. .PHONY: symbiyosys ghdl-formal riscv-gcc all NOCACHE clean copy
  2. # Support for make environment variable NOCACHE
  3. ifeq (NOCACHE,$(lastword $(MAKECMDGOALS)))
  4. OPTIONS := --no-cache
  5. $(info INFO: build without cache)
  6. $(eval $(lastword$(MAKECMDGOALS)):dummy;@:)
  7. endif
  8. NOCACHE:
  9. @#
  10. ifndef TAG
  11. TAG := latest
  12. $(info INFO: Using predefined tag 'latest')
  13. else
  14. $(info INFO: Using user given tag '${TAG}')
  15. endif
  16. all: symbiyosys ghdl-formal riscv-gcc
  17. copy: copy-ghdl copy-riscv
  18. copy-ghdl: ghdl-formal_${TAG}.tar.gz
  19. copy-riscv: riscv-gcc_${TAG}.tar.gz
  20. .SECONDEXPANSION:
  21. symbiyosys ghdl-formal riscv-gcc: $$@.Dockerfile
  22. docker build ${OPTIONS} -t $@:${TAG} -f $@.Dockerfile .
  23. %_${TAG}.tar.gz:
  24. mkdir -p artefacts
  25. docker run --rm -dit --name=$*-dummy $*:${TAG} > /dev/null
  26. docker cp $*-dummy:/opt/. artefacts
  27. docker rm -f $*-dummy > /dev/null
  28. tar -C artefacts -czf $@ .
  29. shasum --algorithm 256 --UNIVERSAL $@ > $@.sha256
  30. clean:
  31. rm -rf artefacts
  32. rm -f *.tar.*