- 论坛徽章:
- 0
|
先看代码:- app : create_directories $(BDIR)$(LIB_PREFIX)app$(LIB_SUFFIX)
- $(BDIR)$(LIB_PREFIX)app$(LIB_SUFFIX) : build_trace test.lib $(STAPP_OBJECTS)
- @$(BUILD_APP_LIBRARY)
复制代码 其中:$(BUILD_APP_LIBRARY)是这样定义的- ifeq "$(ARCHITECTURE)" "ST40"
- define BUILD_STAPP_LIBRARY
- $(if $(wildcard $@),@$(RM) $@)
- $(if $(wildcard ar.mac),@$(RM) ar.mac)
- $(if $(filter %.o,$^),@$(AR) 2>$(NULL) -q $@ $(filter %.o,$^))
- $(if $(filter %.a,$^),@echo OPEN $@ > ar.mac
- $(foreach LIB,$(filter %.a,$^),
- @echo ADDLIB $(LIB) >> ar.mac
- )
- @echo SAVE >> ar.mac
- @echo END >> ar.mac
- @$(AR) 2>$(NULL) -M <ar.mac
- @$(RM) ar.mac
- )
- @$(AR) 2>$(NULL) -s $@
- endef
- endif
复制代码 整个编译没有问题,但是最后链接的时候,在APP中要用到test中的函数,却总是提示undefined reference to,
test.lib是另一个目标:- test.lib :
- @$(MAKE) -C test
复制代码 |
|