我已经在makefile中定义了以下函数。
# check debug xdc
define check_debug_xdc
if [ -f ${DEBUG_XDC} ]; then \
...
fi
endef
如果直接调用,make运行正常。
# Optimize
${OUTPUTS1}: ${INPUTS1}
@echo ""
@echo "Optimization"
@date '+%Y_%m%d_%H%M'
@$(call check_debug_xdc)
但是如果我注释掉DEBUG_XDC并将$(call check_debug_xdc)
放在if-fi内以检查DEBUG_XDC是否已定义,请停止响应,没有输出任何内容,甚至日期也没有。
# DEBUG_XDC = ./fpga_ila/fpga_ila.srcs/constrs_1/new/${TOP}.xdc
...
# Optimize
${OUTPUTS1}: ${INPUTS1}
@echo ""
@echo "Optimization"
@date '+%Y_%m%d_%H%M'
@if [ ! -z "${DEBUG_XDC}" ]; then $(call check_debug_xdc); fi
尝试使用-dn,它将在消息下方显示,然后停止响应。
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i686-pc-linux-gnu
Reading makefiles...
Reading makefile `makefile'...
Updating makefiles....
Considering target file `makefile'.
...
Finished prerequisites of target file `fpga/fpga_opt.dcp'.
Must remake target `fpga/fpga_opt.dcp'.
如何解决?