#Auto generated by Edalize

TARGET   := {{ name }}
LPF_FILE := {{ lpf_file }}
NEXTPNR_OPTIONS     := {{ nextpnr_options|join(' ') }}

all: $(TARGET).bit

%.json: %.mk
	$(MAKE) -f $<
%.config: %.json
	$(EDALIZE_LAUNCHER) nextpnr-ecp5 -l next.log $(NEXTPNR_OPTIONS) --lpf $(LPF_FILE) --json $? --textcfg $@
%.bit: %.config
	$(EDALIZE_LAUNCHER) ecppack --svf $(patsubst %.bit,%.svf, $@) $< $@

build-gui: $(TARGET).json
	$(EDALIZE_LAUNCHER) nextpnr-ecp5 $(NEXTPNR_OPTIONS) --json $? --textcfg $@ --gui

clean:
	$(EDALIZE_LAUNCHER) rm -f  $(TARGET).json $(TARGET).config $(TARGET).bit
