Vitis IDE custom IP Makefile error (arm-xilinx-eabi-gcc.exe: error: *.c: Invalid argument) solution

The content has been transferred to the personal homepage
https://lgyserver.top/index.php/2022/03/26/vitis-ide%e8%87%aa%e5%ae%9a%e4%b9%89ip-makefile%e9% 94%99%e8%af%af%ef%bc%88arm-xilinx-eabi-gcc-exe-error-c-invalid-argument%ef%bc%89%e8%a7%a3%e5%86%b3% e6%96%b9%e6%b3%95/
Please jump to view, thank you!

The world has suffered from Vitis for a long time. When doing development, I sometimes encounter problems with the Makefile generated after the custom IP, which leads to the situation that the compilation of hello world fails. The Xilinx official forum only gives some solutions to the makefile. Write It is not very clear, it is hereby recorded.

The errors to resolve are similar to:

"Compiling my_ip..."
arm-xilinx-eabi-gcc.exe: error: *.c: Invalid argument
arm-xilinx-eabi-gcc.exe: fatal error: no input files
compilation terminated.

First find this path

${hardwareplatform的名字}/zynq_fsbl/zynq_fsbl_bsp/${ps7_cortexa9_0(核心名字)}/libsrc/${(ip名字)}/src/Makefile

Find the Makefile and replace it with

COMPILER=
ARCHIVER=
CP=cp
COMPILER_FLAGS=
EXTRA_COMPILER_FLAGS=
LIB=libxil.a
RELEASEDIR=../../../lib
INCLUDEDIR=../../../include
INCLUDES=-I./. -I${INCLUDEDIR}
INCLUDEFILES=$(wildcard *.h)
LIBSOURCES=$(wildcard *.c *.cpp)
OUTS =*.o
OBJECTS = $(addsuffix .o, $(basename $(wildcard *.c *.cpp)))
ASSEMBLY_OBJECTS = $(addsuffix .o, $(basename $(wildcard *.S)))
libs:
	echo "Compiling myip"
	$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES)
	$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS} ${ASSEMBLY_OBJECTS}
	make clean
include:
	${CP} $(INCLUDEFILES) $(INCLUDEDIR)
clean:
	rm -rf ${OBJECTS} ${ASSEMBLY_OBJECTS}

Guess you like

Origin blog.csdn.net/weixin_43192572/article/details/123752881