winavr包含库文件时编译

其实也可这样干:
假如有个库文件是libtest.a
可以在这个地方跟加
MATH_LIB = -lm \
           libtest.a

大约在Makefile240多行 

MATH_LIB = -lm 
TW2835_LIB_PATH = TW2835/lib 
TW2835_LIB = -ltw2835


# List any extra directories to look for libraries here. 
#     Each directory must be seperated by a space. 
#     Use forward slashes for directory separators. 
#     For a directory that has spaces, enclose it in quotes. 
EXTRALIBDIRS = 

#---------------- External Memory Options ---------------- 
# 64 KB of external RAM, starting after internal RAM (ATmega128!), 
# used for variables (.data/.bss) and heap (malloc()). 
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff 
# 64 KB of external RAM, starting after internal RAM (ATmega128!), 
# only used for heap (malloc()). 
#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff 
EXTMEMOPTS = 

#---------------- Linker Options ---------------- 
#  -Wl,...:     tell GCC to pass this to linker. 
#    -Map:      create map file 
#    --cref:    add cross reference to  map file 
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref 
LDFLAGS += $(EXTMEMOPTS) 
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) 
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) 
#LDFLAGS += -T linker_script.x 
LDFLAGS += -L$(TW2835_LIB_PATH) 
LDFLAGS += $(TW2835_LIB)



生成库文件时只需在Tool里添加 make lib就行了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值