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.

51 lines
1.2 KiB

  1. .PHONY: symbiyosys ghdl-formal riscv-gcc gatemate 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 gatemate
  17. copy: copy-ghdl copy-riscv
  18. copy-ghdl: ghdl-formal_${TAG}.tar.gz
  19. copy-riscv: riscv-gcc_${TAG}.tar.gz
  20. packages/gatemate-toolchain.tar.gz:
  21. curl https://colognechip.com/downloads/cc-toolchain-linux.tar.gz --output $@
  22. gatemate: packages/gatemate-toolchain.tar.gz
  23. .SECONDEXPANSION:
  24. symbiyosys ghdl-formal riscv-gcc gatemate: $$@.Dockerfile
  25. docker build ${OPTIONS} -t $@:${TAG} -f $@.Dockerfile .
  26. %_${TAG}.tar.gz:
  27. mkdir -p artefacts
  28. docker run --rm -dit --name=$*-dummy $*:${TAG} > /dev/null
  29. docker cp $*-dummy:/opt/. artefacts
  30. docker rm -f $*-dummy > /dev/null
  31. tar -C artefacts -czf $@ .
  32. shasum --algorithm 256 --UNIVERSAL $@ > $@.sha256
  33. clean:
  34. rm -rf artefacts
  35. rm -f *.tar.*
  36. rm -f packages/gatemate-toolchain.tar.gz