PROJECT = max80 QU = quartus .SUFFIXES: .SECONDARY: .DELETE_ON_ERROR: # Common options for all Quartus tools QPRI = --lower_priority QCPF = $(QU)_cpf $(QPRI) QSH = $(QU)_sh $(QPRI) QSTA = $(QU)_sta $(QPRI) # Common options for Quartus in-flow tools QOPT = --write_settings_files=off $(QPRI) QMAP = $(QU)_map $(QOPT) QFIT = $(QU)_fit $(QOPT) QCDB = $(QU)_cdb $(QOPT) QASM = $(QU)_asm $(QOPT) QPOW = $(QU)_pow $(QOPT) PERL = perl SRCDIRS = . ip scripts outdir = output_files alltarg := sof jic pow.rpt sta.rpt allout = $(foreach p,$(1),$(foreach o,$(alltarg),$(outdir)/$(p).$(o))) all: $(call allout,$(PROJECT)) $(outdir)/%.map.rpt: %.qsf $(QMAP) $* $(outdir)/%.fit.rpt: $(outdir)/%.map.rpt $(QFIT) $* $(outdir)/%.mif_update.rpt: $(outdir)/%.fit.rpt $(QCDB) --update_mif $* $(outdir)/%.sof: $(outdir)/%.mif_update.rpt $(QASM) $* $(outdir)/%.pow.rpt: $(outdir)/%.fit.rpt | $(outdir)/%.sof $(QPOW) $* $(outdir)/%.sta.rpt: $(outdir)/%.fit.rpt | $(outdir)/%.sof $(QSTA) $* # XXX: do all .sof -> conversions using quartus_cpf $(outdir)/%.jic: %jic.cof $(outdir)/%.sof $(QCPF) --convert $< %.deps: %.qsf scripts/qsfdeps.pl $(PERL) scripts/qsfdeps.pl $< $* > $@ clean: rm -rf db incremental_db simulation \ $(outdir)/*.rpt $(outdir)/*.rpt \ $(outdir)/*.summary $(outdir)/*.smsg \ $(outdir)/*.htm $(outdir)/*.htm_files \ $(outdir)/*.map $(outdir)/*.eqn $(outdir)/*.sld \ $(outdir)/*.done spotless: rm -rf $(outdir) -include $(PROJECT).deps