Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. PROJECT_NAME=gettoknow
  2. LOG_FILE=BUILD_$(shell date '+%d.%m.%y-%H_%M_%S').log
  3. PROJECT_DIR=$(shell pwd)
  4. OUTPUT_DIR=$(PROJECT_DIR)/$(PROJECT_NAME)
  5. SOPC_INFO_FILE=$(PROJECT_NAME).sopcinfo
  6. QSYS_FILE=$(PROJECT_NAME).qsys
  7. ifeq ($(shell quartus_sh --version | grep -c Lite),1)
  8. SOF_FILE=output_files/$(PROJECT_NAME)_time_limited.sof
  9. else
  10. SOF_FILE=output_files/$(PROJECT_NAME).sof
  11. endif
  12. RPA_SHELL=../rpa_shell.py
  13. NIOS2_CMD_SHELL=$$(dirname $$(which quartus))/../../nios2eds/nios2_command_shell.sh
  14. all: $(SOF_FILE)
  15. quartus: $(SOF_FILE)
  16. # starts the quartus GUI and loads the quartus project
  17. quartus_gui:
  18. quartus --64bit $(PROJECT_NAME).qpf &
  19. # starts the Platform Designer GUI and loads the qsys project
  20. qsys_gui:
  21. $(NIOS2_CMD_SHELL) qsys-edit $(PROJECT_NAME).qsys &
  22. $(SOF_FILE): $(QSYS_FILE) $(PROJECT_NAME).qsf $(PROJECT_NAME).qpf
  23. @echo ""
  24. @echo "---------------------------------------------" >> $(LOG_FILE)
  25. @echo "- QUARTUS -" >> $(LOG_FILE)
  26. @echo "---------------------------------------------" >> $(LOG_FILE)
  27. quartus_sh --flow compile $(PROJECT_NAME) 2>&1 | tee -a $(LOG_FILE) | (grep -E "^Warning|^Error|^Critical" || true)
  28. @echo "---------------------------------------------"
  29. @echo "-- Errors and Warnings Overview -"
  30. @echo "-- (for more details see build log) -"
  31. @echo "---------------------------------------------"
  32. @cat $(LOG_FILE) | grep -e "^Warning [\(][0-9]*[\)]:" || true
  33. @cat $(LOG_FILE) | grep -e "^Critical Warning [\(][0-9]*[\)]:" || true
  34. @cat $(LOG_FILE) | grep -e "^Error [\(][0-9]*[\)]:" || true
  35. download:
  36. quartus_pgm -m jtag -o"p;$(SOF_FILE)"
  37. remote_download:
  38. $(RPA_SHELL) -p $(SOF_FILE) --no-master -n
  39. clean:
  40. rm -f $(PROJECT_NAME).sopcinfo
  41. rm -f $(PROJECT_NAME).html
  42. rm -f $(PROJECT_NAME).cmp
  43. rm -f *.rpt
  44. rm -f *.qws
  45. rm -fr $(OUTPUT_DIR)
  46. rm -fr output_files
  47. rm -fr db
  48. rm -f *.bsf
  49. rm -f *.dpf
  50. rm -f *.srf
  51. rm -fr incremental_db
  52. rm -f *.jdi
  53. rm -f *.html
  54. rm -f *.smsg
  55. rm -f *.summary
  56. rm -f *.qdf
  57. .PHONY: qsys_gui
  58. .PHONY: quartus
  59. .PHONY: quartus_gui
  60. .PHONY: download
  61. .PHONY: clean