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.

42 lines
897 B

  1. .PHONY: symbiyosys ghdl-formal 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
  17. copy: ghdl-formal_${TAG}.tar.gz
  18. .SECONDEXPANSION:
  19. symbiyosys ghdl-formal: $$@.Dockerfile
  20. docker build ${OPTIONS} -t $@:${TAG} -f $@.Dockerfile .
  21. ghdl-formal_${TAG}.tar.gz:
  22. mkdir -p artefacts
  23. docker run --rm -dit --name=ghdl-dummy ghdl-formal:${TAG} > /dev/null
  24. docker cp ghdl-dummy:/opt/. artefacts
  25. docker rm -f ghdl-dummy > /dev/null
  26. tar -C artefacts -czf ghdl-formal_${TAG}.tar.gz .
  27. clean:
  28. rm -rf artefacts
  29. rm -f ghdl-formal_*.tar.gz