Ignore:
Timestamp:
Aug 3, 2011, 11:51:30 AM (14 years ago)
Author:
bird
Message:

tools/G*: debug splitting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/tools/GXX32.kmk

    r2534 r2541  
    101101
    102102
    103 
    104103## Compile C source.
    105104# @param    $(target)   Normalized main target name.
     
    233232        $(QUIET)$(APPEND) -n $(out).ar-script \
    234233                $(foreach o,$(objs), 'ADDMOD $(o)') \
    235                 $(foreach o,$(othersrc), 'ADDLIB $(o)')
     234                $(foreach o,$(filter-out %.def %.imp,$(othersrc)), 'ADDLIB $(o)')
     235        $(if $(filter %.def %.imp,$(othersrc))\
     236                ,$(TOOL_GXX3_AR_IMP) -o $(outbase).imp.a $(filter %.def %.imp,$(othersrc))\
     237                 $(NL)$(TAB)$(QUIET)$(APPEND) $(out).ar-script 'ADDLIB $(outbase).imp.a')
    236238        $(QUIET)$(APPEND) $(out).ar-script 'SAVE'
    237239        $(QUIET)$(APPEND) $(out).ar-script 'END'
     
    257259TOOL_GXX32_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
    258260TOOL_GXX32_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
    259 TOOL_GXX32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     261TOOL_GXX32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     262                $(filter %.def, $(othersrc))
    260263TOOL_GXX32_LINK_PROGRAM_DEPORD =
    261264define TOOL_GXX32_LINK_PROGRAM_CMDS
     
    267270        $(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
    268271        $(CHMOD) a-x $(outbase).debug
    269         $(TOOL_GXX32_OBJCOPY) --strip-debug $(out)
    270         $(TOOL_GXX32_OBJCOPY) --add-gnu-debuglink=$(outbase).debug $(out)
     272        $(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
    271273 endif
    272274endef
     
    288290TOOL_GXX32_LINK_DLL_OUTPUT =
    289291TOOL_GXX32_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
    290 TOOL_GXX32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     292TOOL_GXX32_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
     293TOOL_GXX32_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     294TOOL_GXX32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     295                $(filter %.def, $(othersrc))
    291296TOOL_GXX32_LINK_DLL_DEPORD =
    292297define TOOL_GXX32_LINK_DLL_CMDS
     
    297302                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    298303                $(call TOOL_GXX32_LD_MAP,$(outbase).map)
     304 ifeq ($(ld_debug),split)
     305        $(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     306        $(CHMOD) a-x $(outbase).debug
     307        $(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     308 endif
    299309endef
    300310
     
    315325TOOL_GXX32_LINK_SYSMOD_OUTPUT =
    316326TOOL_GXX32_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
    317 TOOL_GXX32_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
     327TOOL_GXX32_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
     328TOOL_GXX32_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
     329TOOL_GXX32_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
     330                $(filter %.def, $(othersrc))
    318331TOOL_GXX32_LINK_SYSMOD_DEPORD =
    319332define TOOL_GXX32_LINK_SYSMOD_CMDS
    320333        $(QUIET)$(TOOL_GXX32_LD_SYSMOD) $(TOOL_GXX32_LDFLAGS.sysmod) $(flags) -o $(out) $(objs)\
     334                $(filter %.def, $(othersrc))\
    321335                $(foreach p,$(libpath), -L$(p))\
    322336                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    323337                $(call TOOL_GXX32_LD_SYSMOD_MAP,$(outbase).map)
    324 endef
    325 
     338 ifeq ($(ld_debug),split)
     339        $(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     340        $(CHMOD) a-x $(outbase).debug
     341        $(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     342 endif
     343endef
     344
Note: See TracChangeset for help on using the changeset viewer.