2
0

Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. PROJECT = max80
  2. QU = quartus
  3. .SUFFIXES:
  4. .SECONDARY:
  5. .DELETE_ON_ERROR:
  6. # Common options for all Quartus tools
  7. QPRI = --lower_priority
  8. QCPF = $(QU)_cpf $(QPRI)
  9. QSH = $(QU)_sh $(QPRI)
  10. QSTA = $(QU)_sta $(QPRI)
  11. # Common options for Quartus in-flow tools
  12. QOPT = --write_settings_files=off $(QPRI)
  13. QMAP = $(QU)_map $(QOPT)
  14. QFIT = $(QU)_fit $(QOPT)
  15. QCDB = $(QU)_cdb $(QOPT)
  16. QASM = $(QU)_asm $(QOPT)
  17. QPOW = $(QU)_pow $(QOPT)
  18. PERL = perl
  19. SRCDIRS = . ip scripts
  20. outdir = output_files
  21. alltarg := sof jic pow.rpt sta.rpt
  22. allout = $(foreach p,$(1),$(foreach o,$(alltarg),$(outdir)/$(p).$(o)))
  23. all: $(call allout,$(PROJECT))
  24. $(outdir)/%.map.rpt: %.qsf
  25. $(QMAP) $*
  26. $(outdir)/%.fit.rpt: $(outdir)/%.map.rpt
  27. $(QFIT) $*
  28. $(outdir)/%.mif_update.rpt: $(outdir)/%.fit.rpt
  29. $(QCDB) --update_mif $*
  30. $(outdir)/%.sof: $(outdir)/%.mif_update.rpt
  31. $(QASM) $*
  32. $(outdir)/%.pow.rpt: $(outdir)/%.fit.rpt | $(outdir)/%.sof
  33. $(QPOW) $*
  34. $(outdir)/%.sta.rpt: $(outdir)/%.fit.rpt | $(outdir)/%.sof
  35. $(QSTA) $*
  36. # XXX: do all .sof -> conversions using quartus_cpf
  37. $(outdir)/%.jic: %jic.cof $(outdir)/%.sof
  38. $(QCPF) --convert $<
  39. %.deps: %.qsf scripts/qsfdeps.pl
  40. $(PERL) scripts/qsfdeps.pl $< $* > $@
  41. clean:
  42. rm -rf db incremental_db simulation \
  43. $(outdir)/*.rpt $(outdir)/*.rpt \
  44. $(outdir)/*.summary $(outdir)/*.smsg \
  45. $(outdir)/*.htm $(outdir)/*.htm_files \
  46. $(outdir)/*.map $(outdir)/*.eqn $(outdir)/*.sld \
  47. $(outdir)/*.done
  48. spotless:
  49. rm -rf $(outdir)
  50. -include $(PROJECT).deps