[tools] Optimization the EXTERN_LIB variable use
This commit is contained in:
parent
2884700817
commit
9776fa5021
|
@ -51,6 +51,14 @@ def TargetMakefile(env):
|
|||
if 'CXXFLAGS' in dir(rtconfig):
|
||||
make.write('CXXFLAGS :=%s' % (rtconfig.CXXFLAGS))
|
||||
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')
|
||||
|
||||
|
|
|
@ -122,10 +122,10 @@ $(TARGET): $(OBJS)
|
|||
@echo ar $(TARGET)
|
||||
@$(CROSS_COMPILE)ar -rv $@ $(OBJS)
|
||||
else
|
||||
$(TARGET): $(OBJS) $(EXTERN_LIB)
|
||||
$(TARGET): $(OBJS)
|
||||
@echo ------------------------------------------------
|
||||
@echo link $(TARGET)
|
||||
@$(CROSS_COMPILE)g++ -o $@ $(LFLAGS) $(OBJS) $(EXTERN_LIB) -lc -lm
|
||||
@$(CROSS_COMPILE)g++ -o $@ $(LFLAGS) $(OBJS) $(EXTERN_LIB)
|
||||
@echo ------------------------------------------------
|
||||
@$(CROSS_COMPILE)objcopy -O binary $@ rtthread.bin
|
||||
@$(CROSS_COMPILE)size $@
|
||||
|
|
Loading…
Reference in New Issue