Ignore:
Timestamp:
Jun 29, 2004, 7:30:14 PM (21 years ago)
Author:
bird
Message:

DLL

File:
1 edited

Legend:

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

    r129 r130  
    143143# @param        $(dirdep)   Directory creation dependency.
    144144# @param        $(deps)         Other dependencies.
    145 # @param        $(deffile)  Definition file. (optional, PC only)
     145# @param        $(othersrc) Unhandled sources.
    146146# @param        $(custom_pre)   Custom step invoked before linking.
    147147# @param        $(custom_post)  Custom step invoked after linking.
     
    149149# @param    $(outbase)  Output basename (full). Use this for list files and such.
    150150define TOOL_VCC70_LINK_PROGRAM
    151 #$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
     151#$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    152152$(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
    153153        $(call MSG_L1,Creating Program $$@)
     
    159159                /MAPINFO:EXPORTS /MAPINFO:LINES \
    160160                /MAP:$(outbase).map \
     161                $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
     162                $(filter %.exp %.res,$(othersrc)) \
     163                $(foreach p,$(libpath), /LIBPATH:$(p)) \
    161164                $(subst /,\\,$(objs)) \
    162165                $(subst /,\\,$(libs))
    163         $(MKDIR) -p $(PATH_BIN)
    164         $(CP) $$@ $(PATH_BIN)/
    165166ifneq ($(custom_post),)
    166167        $(eval $(custom_post))
     
    180181# @param        $(dirdep)   Directory creation dependency.
    181182# @param        $(deps)         Other dependencies.
    182 # @param        $(deffile)  Definition file. (optional, PC only)
     183# @param        $(othersrc) Unhandled sources.
    183184# @param        $(custom_pre)   Custom step invoked before linking.
    184185# @param        $(custom_post)  Custom step invoked after linking.
     
    186187# @param    $(outbase)  Output basename (full). Use this for list files and such.
    187188define TOOL_VCC70_LINK_SYSMOD
    188 #$ (warning dbg: TOOL_VCC70_LINK_SYSMOD: target=$(target) sys=$(sys) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
     189#$ (warning dbg: TOOL_VCC70_LINK_SYSMOD: target=$(target) sys=$(sys) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
    189190$(sys): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
    190191        $(call MSG_L1,Creating Program $$@)
     
    196197                /MAPINFO:EXPORTS /MAPINFO:LINES \
    197198                /MAP:$(outbase).map \
     199                $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
     200                $(filter %.exp %.res,$(othersrc)) \
     201                $(foreach p,$(libpath), /LIBPATH:$(p)) \
    198202                $(subst /,\\,$(objs)) \
    199203                $(subst /,\\,$(libs))
    200         $(MKDIR) -p $(PATH_BIN)
    201         $(CP) $$@ $(PATH_BIN)/
    202204ifneq ($(custom_post),)
    203205        $(eval $(custom_post))
     
    207209endef
    208210
     211
     212## Link system module (windows aka driver, linux aka kernel module)
     213# @param    $(target)   Normalized main target name.
     214# @param    $(dll)              System module name.
     215# @param    $(objs)     Object files to link together.
     216# @param    $(libs)     Libraries to search.
     217# @param    $(libpath)  Library search paths.
     218# @param    $(flags)    Flags.
     219# @param        $(dirdep)   Directory creation dependency.
     220# @param        $(deps)         Other dependencies.
     221# @param        $(othersrc) Unhandled sources.
     222# @param        $(custom_pre)   Custom step invoked before linking.
     223# @param        $(custom_post)  Custom step invoked after linking.
     224#
     225# @param    $(outbase)  Output basename (full). Use this for list files and such.
     226define TOOL_VCC70_LINK_DLL
     227#$ (warning dbg: TOOL_VCC70_LINK_DLL: target=$(target) dll=$(dll) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
     228$(dll): $(dirdep) $(call DIRDEP,$(PATH_LIB)) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
     229        $(call MSG_L1,Creating Program $$@)
     230ifneq ($(custom_pre),)
     231        $(eval $(custom_pre))
     232endif   
     233        $(TOOL_VCC70_LD) $(flags) \
     234                /OUT:$(dll) \
     235                /IMPLIB:$(outbase).lib \
     236                /MAPINFO:EXPORTS /MAPINFO:LINES \
     237                /MAP:$(outbase).map \
     238                /DLL \
     239                $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
     240                $(filter %.exp %.res,$(othersrc)) \
     241                $(foreach p,$(libpath), /LIBPATH:$(p)) \
     242                $(subst /,\\,$(objs)) \
     243                $(subst /,\\,$(libs))
     244ifeq ($(filter %.exp .def,$(othersrc)),)
     245        $(CP) $(outbase).exp $(outbase).lib $(PATH_LIB)/
     246endif
     247ifneq ($(custom_post),)
     248        $(eval $(custom_post))
     249endif   
     250_OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp
     251
     252endef
     253
Note: See TracChangeset for help on using the changeset viewer.