Small makefile cleanup

This commit is contained in:
abejgonzalez
2020-09-04 19:03:26 -07:00
parent 8eb807a2fd
commit 1fa1b6d57f

View File

@@ -31,6 +31,9 @@ TOP := E300ArtyDevKitPlatform
# setup the board to use # setup the board to use
BOARD ?= arty BOARD ?= arty
.PHONY: default
default: $(mcs)
######################################################################################### #########################################################################################
# misc. directories # misc. directories
######################################################################################### #########################################################################################
@@ -53,44 +56,33 @@ all_vsrcs := \
######################################################################################### #########################################################################################
# vivado rules # vivado rules
######################################################################################### #########################################################################################
# combine all sources into single .F # combine all sources into single .f
f := $(build_dir)/$(long_name).vsrcs.F synth_list_f := $(build_dir)/$(long_name).vsrcs.f
$(f): $(sim_common_files) $(all_vsrcs) $(synth_list_f): $(sim_common_files) $(all_vsrcs)
$(foreach file,$(all_vsrcs),echo "$(file)" >> $@;) $(foreach file,$(all_vsrcs),echo "$(file)" >> $@;)
cat $(sim_common_files) >> $@ cat $(sim_common_files) >> $@
bit := $(build_dir)/obj/$(MODEL).bit BIT_FILE := $(build_dir)/obj/$(MODEL).bit
$(bit): $(romgen) $(f) $(BIT_FILE): $(synth_list_f)
cd $(build_dir); vivado \ cd $(build_dir); vivado \
-nojournal -mode batch \ -nojournal -mode batch \
-source $(fpga_common_script_dir)/vivado.tcl \ -source $(fpga_common_script_dir)/vivado.tcl \
-tclargs \ -tclargs \
-top-module "$(MODEL)" \ -top-module "$(MODEL)" \
-F "$(f)" \ -F "$(synth_list_f)" \
-ip-vivado-tcls "$(shell find '$(build_dir)' -name '*.vivado.tcl')" \ -ip-vivado-tcls "$(shell find '$(build_dir)' -name '*.vivado.tcl')" \
-board "$(BOARD)" -board "$(BOARD)"
.PHONY: bit .PHONY: bit
bit: $(bit) bit: $(BIT_FILE)
# Build .mcs # Build .mcs
mcs := $(build_dir)/obj/$(MODEL).mcs MCS_FILE := $(build_dir)/obj/$(MODEL).mcs
$(mcs): $(bit) $(MCS_FILE): $(BIT_FILE)
cd $(build_dir); vivado -nojournal -mode batch -source $(fpga_common_script_dir)/write_cfgmem.tcl -tclargs $(BOARD) $@ $< cd $(build_dir); vivado -nojournal -mode batch -source $(fpga_common_script_dir)/write_cfgmem.tcl -tclargs $(BOARD) $@ $<
.PHONY: mcs .PHONY: mcs
mcs: $(mcs) mcs: $(MCS_FILE)
#########################################################################################
# mircosemi rules
#########################################################################################
# Build Libero project
prjx := $(build_dir)/libero/$(MODEL).prjx
$(prjx): $(verilog)
cd $(build_dir); libero SCRIPT:$(fpga_common_script_dir)/libero.tcl SCRIPT_ARGS:"$(build_dir) $(MODEL) $(PROJECT) $(CONFIG) $(BOARD)"
.PHONY: prjx
prjx: $(prjx)
######################################################################################### #########################################################################################
# general cleanup rules # general cleanup rules