Ignore:
Timestamp:
May 31, 2004, 3:11:52 AM (21 years ago)
Author:
bird
Message:

...

File:
1 edited

Legend:

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

    r72 r73  
    2727
    2828TOOL_GCC                := Generic GCC
     29
    2930TOOL_GCC_CC             := gcc$(HOSTSUFF_EXE)
     31TOOL_GCC_COBJSUFF       := .o
    3032TOOL_GCC_CFLAGS         := -g
    3133TOOL_GCC_CFLAGS.debug   := -O0
     
    3335TOOL_GCC_CFLAGS.profile := -pg
    3436TOOL_GCC_CINCS          :=
     37TOOL_GCC_CDEFS          :=
     38
     39TOOL_GCC_CC             := gcc$(HOSTSUFF_EXE)
     40TOOL_GCC_CXXOBJSUFF     := .o
     41
     42TOOL_GCC_AS             := as$(HOSTSUFF_EXE)
     43TOOL_GCC_ASOBJSUFF      := .o
     44
     45TOOL_GCC_AR             := ar$(HOSTSUFF_EXE)
     46TOOL_GCC_ARFLAGS        := cr
     47TOOL_GCC_ARLIBSUFF      := .a
    3548
    3649
    3750## Compile C source.
    38 # @param    $1  Output basename (full).
    39 # @param    $2  Source filename (relative).
    40 # @param    $3  Normalized main target name.
     51# @param    $(target)   Normalized main target name.
     52# @param    $(source)   Source filename (relative).
     53# @param        $(obj)      Object file name. This shall be (re)created by the compilation.
     54# @param    $(dep)          Dependcy file. This shall be (re)created by the compilation.
     55# @param    $(flags)    Flags.
     56# @param    $(defs)     Definitions. No -D or something.
     57# @param    $(incs)     Includes. No -I or something.
     58# @param        $(dirdep)   Directory creation dependency.
     59#
     60# @param    $(outbase)  Output basename (full). Use this for list files and such.
     61# @param        $(objsuff)  Object suffix.
    4162define TOOL_GCC_COMPILE_C
    42 #$ (warning dbg GCC: 1=$1 2=$2 3=$3 4=$4 5=$5)
    43 $1.o: $(PATH_CURRENT)/$2 $(dir $1).dir_created
    44         $(TOOL_GCC_CC) -c \
    45                 $($3_$2_CFLAGS) $($3_$2_CFLAGS.$(BUILD_TYPE)) \
    46                 $($2_CFLAGS) $($2_CFLAGS.$(BUILD_TYPE)) \
    47                 $($3_CFLAGS) $($3_CFLAGS.$(BUILD_TYPE)) \
    48                 $(TOOL_GCC_CFLAGS) $(TOOL_GCC_CFLAGS.$(BUILD_TYPE)) \
    49                 $(addprefix -I, $($3_$2_CINCS) $($3_$2_INCS) $($2_CINCS) $($2_INCS) $($3_CINCS) $($3_INCS) $(INCS) \
    50                                                 $(TOOL_GCC_CINCS)) \
    51                 $(addprefix -D, $($3_$2_CDEFS) $($3_$2_DEFS) $($2_CDEFS) $($2_DEFS) $($3_CDEFS) $($3_DEFS) $(DEFS) $(TOOL_GCC_CDEFS)) \
    52                 -o $$@ -Wp,-MT,$1$(SUFF_DEP) -Wp,-MD,$$@ \
    53         $(PATH_CURRENT)/$2             
    54 _OBJS_$(3) += $1.o
    55 _DEPFILES += $1$(SUFF_DEP)
     63#$ (warning dbg: GCC: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
     64$(obj): $(dirdep) $(PATH_CURRENT)/$(source)
     65        $(call MSG_L2,Compiling $$@ using GCC)
     66        $(TOOL_GCC_CC) -c\
     67                $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
     68                -Wp,-MT,$(dep) -Wp,-MD,$$@\
     69                -o $$@\
     70        $(PATH_CURRENT)/$(source)               
     71               
    5672endef
    5773
     74
     75## Link library
     76# @param    $(target)   Normalized main target name.
     77# @param    $(lib)              Library name.
     78# @param    $(objs)     Object files to put in the library.
     79# @param    $(flags)    Flags.
     80# @param        $(dirdep)   Directory creation dependency.
     81# @param        $(deps)         Other dependencies.
     82#
     83# @param    $(outbase)  Output basename (full). Use this for list files and such.
     84define TOOL_GCC_LINK_LIBRARY
     85#$ (warning dbg: GCC: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
     86$(lib): $(dirdep) $(objs) $(deps)
     87        $(call MSG_L1,Creating Library $$@)
     88        $(RM) -f $$@
     89        $(TOOL_GCC_AR) $(flags) $$@ $(objs)
     90       
     91endef
     92
Note: See TracChangeset for help on using the changeset viewer.