静态库编译makefile ,更换工具链即可
【摘要】
CC = ckcore-elf-gcc
AR = ckcore-elf-a**加粗样式**r
TARGET := libca.a
CPPFLAGS=
CFLAGS = $(CPPFLAG...
CC = ckcore-elf-gcc
AR = ckcore-elf-a**加粗样式**r
TARGET := libca.a
CPPFLAGS=
CFLAGS = $(CPPFLAGS) -mbig-endian -Wpointer-arith -Wundef -c -Wall -Wstrict-prototypes -g -pipe -fno-strict-aliasing
#CFLAGS = $(CPPFLAGS) -mbig-endian -Wpointer-arith -Wundef -c -Wall -Wstrict-prototypes -pipe
COBJECT = $(patsubst %c,%o,$(wildcard *.c))
$(TARGET) : $(AOBJECT) $(COBJECT)
@echo [AR] $@
@$(AR) -rcs $@ $^
%.o : %.c
@echo [CC] $@
@$(CC) $(CFLAGS) $< -o $@
-include $(subst .o,.d,$(COBJECT))
%.d : %.c
@$(CC) -M $(CFLAGS) $< > $@.12345;\
sed 's,\($*\).o[:],\1.o $@ : ,g' < $@.12345 >$@;\
rm -f $@.12345
.PHONY : clean
clean:
@rm -f *.o *.d *.a
文章来源: blog.csdn.net,作者:悟空胆好小,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/xushx_bigbear/article/details/122716976
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)