Skip to content

Commit

Permalink
makefiles: More fixes to the makefile.
Browse files Browse the repository at this point in the history
 * Init submodules before anything else.
 * Reduce some duplication.
  • Loading branch information
mithro committed Jan 27, 2016
1 parent 3cdf6b4 commit c3a2051
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Expand Up @@ -78,15 +78,19 @@ third_party/%/.git: .gitmodules

# Gateware
MODULES=migen misoc liteeth litescope
gateware-generate: $(addprefix gateware-generate-,$(TARGETS)) $(addsuffix /.git,$(addprefix third_party/,$(MODULES)))
gateware-submodules: $(addsuffix /.git,$(addprefix third_party/,$(MODULES)))
@true

gateware-generate: gateware-submodules $(addprefix gateware-generate-,$(TARGETS))
@echo 'Building target: $@. First dep: $<'
ifneq ($(OS),Windows_NT)
cd $(MSCDIR) && $(CMD) -Ob run False --csr_csv $(HDMI2USBDIR)/test/csr.csv build-csr-csv build-bitstream \
| $(FILTER) $(PWD)/build/output.$(DATE).log; (exit $${PIPESTATUS[0]})
else
cd $(MSCDIR) && $(CMD) -Ob run False --csr_csv $(HDMI2USBDIR)/test/csr.csv build-csr-csv build-bitstream
endif

gateware-build: $(addprefix gateware-build-,$(TARGETS)) $(addsuffix /.git,$(addprefix third_party/,$(MODULES)))
gateware-build: gateware-submodules $(addprefix gateware-build-,$(TARGETS))
ifneq ($(OS),Windows_NT)
cd $(MSCDIR) && $(CMD) --csr_csv $(HDMI2USBDIR)/test/csr.csv build-csr-csv build-bitstream \
| $(FILTER) $(PWD)/build/output.$(DATE).log; (exit $${PIPESTATUS[0]})
Expand Down Expand Up @@ -135,4 +139,4 @@ clean:
rm -f firmware/fx2/hdmi2usb.hex

.DEFAULT_GOAL := help
.PHONY: all load-gateware load flash gateware firmware download-prebuilt third_party/*
.PHONY: all load-gateware load flash gateware gateware-submodules gateware-generate gateware-build firmware download-prebuilt third_party/*

0 comments on commit c3a2051

Please sign in to comment.