本文共 696 字,大约阅读时间需要 2 分钟。
OBJS := start.o main.o dev/dev.o lib/lib.o net/net.oCFLAGS := -fno-builtin -I$(shell pwd)/includeexport CFLAGSgboot.bin : gboot.elf arm-linux-objcopy -O binary gboot.elf gboot.bingboot.elf : $(OBJS) arm-linux-ld -Tgboot.lds -o gboot.elf $^%.o : %.S arm-linux-gcc -g -c $^%.o : %.c arm-linux-gcc $(CFLAGS) -c $^lib/lib.o : make -C lib alldev/dev.o : make -C dev allnet/net.o : make -C net all.PHONY: cleanclean: make -C lib clean make -C dev clean make -C net clean rm -f *.o *.elf *.bin *.bak
在C语言标准中,有些通用函数被定义为built-in function(内建函数),像printf,strchr,memset等等,这些函数不需要包含头文件中的声明,就可以编译连接该函数的。但有时候你想自己实现,就会出现冲突的提示。解决办法:在编译时加上-fno-builtin或者-fno-builtin-FUNCTION 选项
转载地址:http://eeigi.baihongyu.com/