在跑vitis工程文件时出现fatal error: xxx.h: No such file or directory.的错误,出现这种情况的主要是出现在大家用了自定义IP。
记住如果时出现Makefile出现错误,并不是你的代码问题而是软件bug,我们需要更改一些文件才能正常跑。
讲解一下怎么改(以创建自定义IP之后开始)
一、找到自定义IP的Makefile文件所在位置
一般位置ip_repo\pl_ram_1_0\drivers\pl_ram_v1_0\src
二、修改
1.LIBSOURCES=*.c更改为LIBSOURCES=$(wildcard *.c)
2.去除OUTS = *.o(或者将用#注释起来)
3.增加两句代码
OBJECTS = $(addsuffix .o, $(basename $(wildcard *.c)))
ASSEMBLY_OBJECTS = $(addsuffix .o, $(basename $(wildcard *.S)))
4.替换两处代码,${OUTS}更换成 ${OBJECTS} ${ASSEMBLY_OBJECTS}
整体正确代码如下
COMPILER=
ARCHIVER=
CP=cp
COMPILER_FLAGS=
EXTRA_COMPILER_FLAGS=
LIB=libxil.a
RELEASEDIR=../../../lib
INCLUDEDIR=../../../include
INCLUDES=-I./. -I${INCLUDEDIR}
INCLUDEFILES=*.h
#LIBSOURCES=*.c
LIBSOURCES=$(wildcard *.c)
# OUTS = *.o
OBJECTS = $(addsuffix .o, $(basename $(wildcard *.c)))
ASSEMBLY_OBJECTS = $(addsuffix .o, $(basename $(wildcard *.S)))
libs:
echo "Compiling pl_ram..."
$(COMPILER) $(COMPILER_FLAGS) $(EXTRA_COMPILER_FLAGS) $(INCLUDES) $(LIBSOURCES)
# $(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OUTS}
$(ARCHIVER) -r ${RELEASEDIR}/${LIB} ${OBJECTS} ${ASSEMBLY_OBJECTS}
make clean
include:
${CP} $(INCLUDEFILES) $(INCLUDEDIR)
clean:
# rm -rf ${OUTS}
rm -rf ${OBJECTS} ${ASSEMBLY_OBJECTS}