2018-03-22 16:15:58 +00:00
|
|
|
####################################################################################
|
|
|
|
## Copyright 2018(c) Analog Devices, Inc.
|
|
|
|
####################################################################################
|
|
|
|
|
|
|
|
# Assumes this file is in prpojects/scripts/project-xilinx.mk
|
|
|
|
HDL_PROJECT_PATH := $(subst scripts/project-xilinx.mk,,$(lastword $(MAKEFILE_LIST)))
|
|
|
|
HDL_LIBRARY_PATH := $(HDL_PROJECT_PATH)../library/
|
|
|
|
|
2018-03-25 07:21:37 +00:00
|
|
|
include $(HDL_PROJECT_PATH)../quiet.mk
|
|
|
|
|
2018-03-22 16:15:58 +00:00
|
|
|
VIVADO := vivado -mode batch -source
|
|
|
|
|
|
|
|
CLEAN_TARGET := *.cache
|
|
|
|
CLEAN_TARGET += *.data
|
|
|
|
CLEAN_TARGET += *.xpr
|
|
|
|
CLEAN_TARGET += *.log
|
|
|
|
CLEAN_TARGET += *.jou
|
|
|
|
CLEAN_TARGET += xgui
|
|
|
|
CLEAN_TARGET += *.runs
|
|
|
|
CLEAN_TARGET += *.srcs
|
|
|
|
CLEAN_TARGET += *.sdk
|
|
|
|
CLEAN_TARGET += *.hw
|
|
|
|
CLEAN_TARGET += *.sim
|
|
|
|
CLEAN_TARGET += .Xil
|
|
|
|
CLEAN_TARGET += *.ip_user_files
|
2018-03-28 09:44:21 +00:00
|
|
|
CLEAN_TARGET += *.str
|
2019-09-25 07:49:51 +00:00
|
|
|
CLEAN_TARGET += mem_init_sys.txt
|
2018-03-22 16:15:58 +00:00
|
|
|
|
|
|
|
# Common dependencies that all projects have
|
|
|
|
M_DEPS += system_project.tcl
|
|
|
|
M_DEPS += system_bd.tcl
|
|
|
|
M_DEPS += $(wildcard system_top*.v)
|
|
|
|
M_DEPS += $(wildcard system_constr.xdc) # Not all projects have this file
|
2018-08-14 08:43:32 +00:00
|
|
|
M_DEPS += $(HDL_PROJECT_PATH)scripts/adi_project_xilinx.tcl
|
2018-03-22 16:15:58 +00:00
|
|
|
M_DEPS += $(HDL_PROJECT_PATH)scripts/adi_env.tcl
|
|
|
|
M_DEPS += $(HDL_PROJECT_PATH)scripts/adi_board.tcl
|
|
|
|
|
2018-03-26 08:57:03 +00:00
|
|
|
M_DEPS += $(foreach dep,$(LIB_DEPS),$(HDL_LIBRARY_PATH)$(dep)/component.xml)
|
2018-03-22 16:15:58 +00:00
|
|
|
|
2019-09-11 08:01:30 +00:00
|
|
|
.PHONY: all lib clean clean-all
|
2018-03-22 16:15:58 +00:00
|
|
|
all: lib $(PROJECT_NAME).sdk/system_top.hdf
|
|
|
|
|
|
|
|
clean:
|
2019-04-17 10:33:17 +00:00
|
|
|
-rm -f reference.dcp
|
2018-03-25 07:21:37 +00:00
|
|
|
$(call clean, \
|
|
|
|
$(CLEAN_TARGET), \
|
|
|
|
$(HL)$(PROJECT_NAME)$(NC) project)
|
2018-03-22 16:15:58 +00:00
|
|
|
|
|
|
|
clean-all: clean
|
|
|
|
@for lib in $(LIB_DEPS); do \
|
|
|
|
$(MAKE) -C $(HDL_LIBRARY_PATH)$${lib} clean; \
|
|
|
|
done
|
|
|
|
|
2019-04-17 10:33:17 +00:00
|
|
|
MODE ?= "default"
|
|
|
|
|
2019-09-11 08:01:30 +00:00
|
|
|
$(PROJECT_NAME).sdk/system_top.hdf: $(M_DEPS)
|
2019-04-17 10:33:17 +00:00
|
|
|
@if [ $(MODE) = incr ]; then \
|
|
|
|
if [ -f */impl_1/system_top_routed.dcp ]; then \
|
|
|
|
echo Found previous run result at `ls */impl_1/system_top_routed.dcp`; \
|
|
|
|
cp -u */impl_1/system_top_routed.dcp ./reference.dcp ; \
|
|
|
|
fi; \
|
|
|
|
if [ -f ./reference.dcp ]; then \
|
|
|
|
echo Using reference checkpoint for incremental compilation; \
|
|
|
|
fi; \
|
2019-04-22 15:15:44 +00:00
|
|
|
else \
|
|
|
|
rm -f reference.dcp; \
|
|
|
|
fi;
|
2018-03-22 16:15:58 +00:00
|
|
|
-rm -rf $(CLEAN_TARGET)
|
2018-03-25 07:21:37 +00:00
|
|
|
$(call build, \
|
|
|
|
$(VIVADO) system_project.tcl, \
|
|
|
|
$(PROJECT_NAME)_vivado.log, \
|
|
|
|
$(HL)$(PROJECT_NAME)$(NC) project)
|
2018-03-22 16:15:58 +00:00
|
|
|
|
|
|
|
lib:
|
|
|
|
@for lib in $(LIB_DEPS); do \
|
2018-03-27 09:21:09 +00:00
|
|
|
$(MAKE) -C $(HDL_LIBRARY_PATH)$${lib} xilinx || exit $$?; \
|
2018-03-22 16:15:58 +00:00
|
|
|
done
|