Merge pull request #4750 from iysheng/extern_lib
[tools] Optimization the EXTERN_LIB variable use
This commit is contained in:
commit
ed402ec25c
|
@ -51,6 +51,14 @@ def TargetMakefile(env):
|
||||||
if 'CXXFLAGS' in dir(rtconfig):
|
if 'CXXFLAGS' in dir(rtconfig):
|
||||||
make.write('CXXFLAGS :=%s' % (rtconfig.CXXFLAGS))
|
make.write('CXXFLAGS :=%s' % (rtconfig.CXXFLAGS))
|
||||||
make.write('\n')
|
make.write('\n')
|
||||||
|
if env.has_key('LIBS'):
|
||||||
|
make.write('EXTERN_LIB := ')
|
||||||
|
for tlib in env['LIBS']:
|
||||||
|
make.write('-l%s ' % (tlib))
|
||||||
|
if env.has_key('LIBPATH'):
|
||||||
|
for tlibpath in env['LIBPATH']:
|
||||||
|
make.write('-L%s ' % (tlibpath))
|
||||||
|
make.write('\n')
|
||||||
|
|
||||||
make.write('\n')
|
make.write('\n')
|
||||||
|
|
||||||
|
|
|
@ -122,10 +122,10 @@ $(TARGET): $(OBJS)
|
||||||
@echo ar $(TARGET)
|
@echo ar $(TARGET)
|
||||||
@$(CROSS_COMPILE)ar -rv $@ $(OBJS)
|
@$(CROSS_COMPILE)ar -rv $@ $(OBJS)
|
||||||
else
|
else
|
||||||
$(TARGET): $(OBJS) $(EXTERN_LIB)
|
$(TARGET): $(OBJS)
|
||||||
@echo ------------------------------------------------
|
@echo ------------------------------------------------
|
||||||
@echo link $(TARGET)
|
@echo link $(TARGET)
|
||||||
@$(CROSS_COMPILE)g++ -o $@ $(LFLAGS) $(OBJS) $(EXTERN_LIB) -lc -lm
|
@$(CROSS_COMPILE)g++ -o $@ $(LFLAGS) $(OBJS) $(EXTERN_LIB)
|
||||||
@echo ------------------------------------------------
|
@echo ------------------------------------------------
|
||||||
@$(CROSS_COMPILE)objcopy -O binary $@ rtthread.bin
|
@$(CROSS_COMPILE)objcopy -O binary $@ rtthread.bin
|
||||||
@$(CROSS_COMPILE)size $@
|
@$(CROSS_COMPILE)size $@
|
||||||
|
|
Loading…
Reference in New Issue