- 论坛徽章:
- 0
|
# This is the Makefile for the client side device for npu-term.
include Defs.mk
export TOP_DIR
TARGET = npu-xscale.o
SRC = clientmain.c clientdma.c clientterm.c clientpci.c
all : .depend $(TARGET)
clean :
rm -f $(TARGET) *.o *.c~ .depend ../common/header.h
#这是一个make Target,执行make clean时执行这一行指令。
$(TARGET): $(SRC:.c=.o)
$(LD) -r $^ -o $@
# Special case for clientdma.c because it includes Grunt headers.
clientdma.o : clientdma.c
$(CC) $(CFLAGS) -c -o $@ $<
../common/header.h : create_header.py
./create_header.py
#当header.h不存在或比create_header.py脚本的
#时间更靠前,则执行该脚本。
# Clean up the code indenting before doing cvs commit.
# Unfortunately, the local .indent.pro uses --preserve-mtime which preserves
# the mtime for all files. The following hack runs indent on each file and
# touches the files which have changed.
indent:
@for file in *.[ch] ;do \
if [ -w "$$file" ]; then \
indent $$file ; \
x=`cmp $$file $$file~` ; \
if [ -n "$$x" ]; then \
echo "Indenting $$file" ; \
touch $$file ; \
fi ; \
fi ; \
done
@rm -f *~
# 这个循环明显是对所有.c 和 .h 文件进行 indent 操作。
# indent 我的理解是让c源文件更规范,比如缩进。
# man indent 可以获得详细解释
depend .depend dep : ../common/header.h
$(CC) $(CFLAGS) -M *.c > $@
ifeq (.depend,$(wildcard .depend))
include .depend
endif
文中加颜色的几行请大家帮我解释一下,谢谢! |
|