fpga: Add option to specify build output directory
Original-commit: 58fb72a82da8bb638dbdfe44d3be84e8382c10a2
This commit is contained in:
+33
-31
@@ -11,9 +11,9 @@
|
||||
## make <Targets> <Options>
|
||||
##
|
||||
##Output:
|
||||
## build/usrp_<product>_fpga_<image_type>.bit: Configuration bitstream with header
|
||||
## build/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
||||
## build/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
||||
## $(BUILD_OUTPUT_DIR)/usrp_<product>_fpga_<image_type>.bit: Configuration bitstream with header
|
||||
## $(BUILD_OUTPUT_DIR)/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
||||
## $(BUILD_OUTPUT_DIR)/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
||||
|
||||
# Debug Options
|
||||
# Uncomment this line or add to make arg to omit radio_clk (sourced from db) and use bus_clk as radio_clk
|
||||
@@ -23,8 +23,10 @@
|
||||
# Uncomment this line to add four example Aurora loopback lanes on the QSFP NPIO bus.
|
||||
# OPTIONS += QSFP_LANES=4
|
||||
|
||||
# Base output directory for all builds
|
||||
# Base output directory for all builds.
|
||||
BUILD_BASE_DIR ?= .
|
||||
# Base directory for the build outputs.
|
||||
BUILD_OUTPUT_DIR ?= $(BUILD_BASE_DIR)/build
|
||||
|
||||
# Initialize a build seed. This can be changed to randomly affect build results.
|
||||
BUILD_SEED ?= 0
|
||||
@@ -71,11 +73,11 @@ vivado_ip = make -f Makefile.n3xx.inc viv_ip NAME=$@ ARCH=$(XIL_ARCH_$1) P
|
||||
# post_build($1=Device, $2=Option)
|
||||
ifeq ($(TARGET),bin)
|
||||
post_build = @\
|
||||
mkdir -p build; \
|
||||
mkdir -p $(BUILD_OUTPUT_DIR); \
|
||||
echo "Exporting bitstream file..."; \
|
||||
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/n3xx.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
||||
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/n3xx.bit $(BUILD_OUTPUT_DIR)/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
||||
echo "Exporting build report..."; \
|
||||
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
||||
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/build.rpt $(BUILD_OUTPUT_DIR)/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
||||
echo "Build DONE ... $(1)_$(2)";
|
||||
else
|
||||
post_build = @echo "Skipping bitfile export."
|
||||
@@ -98,109 +100,109 @@ N3X0_IP:
|
||||
+$(call vivado_ip,N310,$(HG_DEFS) N310=1,$(N310_DEFAULTS))
|
||||
|
||||
##N310_WX: 1GigE White Rabbit on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N310_WX: N3X0_IP build/usrp_n310_fpga_WX.dts
|
||||
N310_WX: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n310_fpga_WX.dts
|
||||
$(call vivado_build,N310,$(WX_DEFS) N310=1,$(N310_DEFAULTS))
|
||||
$(call post_build,N310,WX)
|
||||
|
||||
##N310_HG: 1GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N310_HG: N3X0_IP build/usrp_n310_fpga_HG.dts
|
||||
N310_HG: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n310_fpga_HG.dts
|
||||
$(call vivado_build,N310,$(HG_DEFS) N310=1,$(N310_DEFAULTS))
|
||||
$(call post_build,N310,HG)
|
||||
|
||||
##N310_XG: 10GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N310_XG: N3X0_IP build/usrp_n310_fpga_XG.dts
|
||||
N310_XG: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n310_fpga_XG.dts
|
||||
$(call vivado_build,N310,$(XG_DEFS) N310=1,$(N310_DEFAULTS))
|
||||
$(call post_build,N310,XG)
|
||||
|
||||
##N310_HA: 1Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
||||
N310_HA: N3X0_IP build/usrp_n310_fpga_HA.dts
|
||||
N310_HA: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n310_fpga_HA.dts
|
||||
$(call vivado_build,N310,$(HA_DEFS) N310=1,$(N310_DEFAULTS))
|
||||
$(call post_build,N310,HA)
|
||||
|
||||
##N310_XA: 10Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
||||
N310_XA: N3X0_IP build/usrp_n310_fpga_XA.dts
|
||||
N310_XA: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n310_fpga_XA.dts
|
||||
$(call vivado_build,N310,$(XA_DEFS) N310=1,$(N310_DEFAULTS))
|
||||
$(call post_build,N310,XA)
|
||||
|
||||
##N310_AA: Aurora on SFP+ Port0, Aurora on SFP+ Port1.
|
||||
N310_AA: N3X0_IP build/usrp_n310_fpga_AA.dts
|
||||
N310_AA: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n310_fpga_AA.dts
|
||||
$(call vivado_build,N310,$(AA_DEFS) N310=1,$(N310AA_DEFAULTS))
|
||||
$(call post_build,N310,AA)
|
||||
|
||||
##N300_WX: 1GigE White Rabbit on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N300_WX: N300_IP build/usrp_n300_fpga_WX.dts
|
||||
N300_WX: N300_IP $(BUILD_OUTPUT_DIR)/usrp_n300_fpga_WX.dts
|
||||
$(call vivado_build,N300,$(WX_DEFS) N300=1,$(N300_DEFAULTS))
|
||||
$(call post_build,N300,WX)
|
||||
|
||||
##N300_HG: 1GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N300_HG: N300_IP build/usrp_n300_fpga_HG.dts
|
||||
N300_HG: N300_IP $(BUILD_OUTPUT_DIR)/usrp_n300_fpga_HG.dts
|
||||
$(call vivado_build,N300,$(HG_DEFS) N300=1,$(N300_DEFAULTS))
|
||||
$(call post_build,N300,HG)
|
||||
|
||||
##N300_XG: 10GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N300_XG: N300_IP build/usrp_n300_fpga_XG.dts
|
||||
N300_XG: N300_IP $(BUILD_OUTPUT_DIR)/usrp_n300_fpga_XG.dts
|
||||
$(call vivado_build,N300,$(XG_DEFS) N300=1,$(N300_DEFAULTS))
|
||||
$(call post_build,N300,XG)
|
||||
|
||||
##N300_HA: 1Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
||||
N300_HA: N300_IP build/usrp_n300_fpga_HA.dts
|
||||
N300_HA: N300_IP $(BUILD_OUTPUT_DIR)/usrp_n300_fpga_HA.dts
|
||||
$(call vivado_build,N300,$(HA_DEFS) N300=1,$(N300_DEFAULTS))
|
||||
$(call post_build,N300,HA)
|
||||
|
||||
##N300_XA: 10Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
||||
N300_XA: N300_IP build/usrp_n300_fpga_XA.dts
|
||||
N300_XA: N300_IP $(BUILD_OUTPUT_DIR)/usrp_n300_fpga_XA.dts
|
||||
$(call vivado_build,N300,$(XA_DEFS) N300=1,$(N300_DEFAULTS))
|
||||
$(call post_build,N300,XA)
|
||||
|
||||
##N300_AA: Aurora on SFP+ Port0, Aurora on SFP+ Port1.
|
||||
N300_AA: N300_IP build/usrp_n300_fpga_AA.dts
|
||||
N300_AA: N300_IP $(BUILD_OUTPUT_DIR)/usrp_n300_fpga_AA.dts
|
||||
$(call vivado_build,N300,$(AA_DEFS) N300=1,$(N300AA_DEFAULTS))
|
||||
$(call post_build,N300,AA)
|
||||
|
||||
##N320_WX: 1GigE White Rabbit on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N320_WX: N3X0_IP build/usrp_n320_fpga_WX.dts
|
||||
N320_WX: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n320_fpga_WX.dts
|
||||
$(call vivado_build,N320,$(WX_DEFS) N320=1,$(N320_DEFAULTS))
|
||||
$(call post_build,N320,WX)
|
||||
|
||||
##N320_HG: 1GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N320_HG: N3X0_IP build/usrp_n320_fpga_HG.dts
|
||||
N320_HG: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n320_fpga_HG.dts
|
||||
$(call vivado_build,N320,$(HG_DEFS) N320=1,$(N320_DEFAULTS))
|
||||
$(call post_build,N320,HG)
|
||||
|
||||
##N320_XG: 10GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
||||
N320_XG: N3X0_IP build/usrp_n320_fpga_XG.dts
|
||||
N320_XG: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n320_fpga_XG.dts
|
||||
$(call vivado_build,N320,$(XG_DEFS) N320=1,$(N320_DEFAULTS))
|
||||
$(call post_build,N320,XG)
|
||||
|
||||
##N320_XQ: WR on SFP+ Port0, 10Gig on QSFP+ Port0,1.
|
||||
N320_XQ: N3X0_IP build/usrp_n320_fpga_XQ.dts
|
||||
N320_XQ: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n320_fpga_XQ.dts
|
||||
$(call vivado_build,N320,$(XQ_DEFS) N320=1,$(N320_DEFAULTS))
|
||||
$(call post_build,N320,XQ)
|
||||
|
||||
##N320_AQ: 10Gig on SFP+ Port0,1 Aurora on QSFP+ Port0,1,2,3.
|
||||
N320_AQ: N3X0_IP build/usrp_n320_fpga_AQ.dts
|
||||
N320_AQ: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n320_fpga_AQ.dts
|
||||
$(call vivado_build,N320,$(AQ_DEFS) N320=1,$(N320_DEFAULTS))
|
||||
$(call post_build,N320,AQ)
|
||||
|
||||
##N320_AA: Aurora on SFP+ Port0, Aurora on SFP+ Port1.
|
||||
N320_AA: N3X0_IP build/usrp_n320_fpga_AA.dts
|
||||
N320_AA: N3X0_IP $(BUILD_OUTPUT_DIR)/usrp_n320_fpga_AA.dts
|
||||
$(call vivado_build,N320,$(AA_DEFS) N320=1,$(N320AA_DEFAULTS))
|
||||
$(call post_build,N320,AA)
|
||||
|
||||
build/%.dts: dts/%.dts dts/*.dtsi
|
||||
-mkdir -p build
|
||||
$(BUILD_OUTPUT_DIR)/%.dts: dts/%.dts dts/*.dtsi
|
||||
-mkdir -p $(BUILD_OUTPUT_DIR)
|
||||
${CC} -o $@ -E -I dts -nostdinc -undef -x assembler-with-cpp -D__DTS__ $<
|
||||
|
||||
clean: ##Clean up all target build outputs.
|
||||
@echo "Cleaning targets..."
|
||||
@rm -rf build-N3*_*
|
||||
@rm -rf build
|
||||
@rm -rf $(BUILD_BASE_DIR)/build-N3*_*
|
||||
@rm -rf $(BUILD_OUTPUT_DIR)
|
||||
|
||||
cleanall: ##Clean up all target and ip build outputs.
|
||||
@echo "Cleaning targets and IP..."
|
||||
@rm -rf build-ip
|
||||
@rm -rf build-N3*_*
|
||||
@rm -rf build
|
||||
@rm -rf $(BUILD_BASE_DIR)/build-N3*_*
|
||||
@rm -rf $(BUILD_OUTPUT_DIR)
|
||||
|
||||
help: ##Show this help message.
|
||||
@grep -h "##" Makefile | grep -v "\"##\"" | sed -e 's/\\$$//' | sed -e 's/##//'
|
||||
|
||||
Reference in New Issue
Block a user