Changeset 130 for trunk/kBuild


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

DLL

Location:
trunk/kBuild
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r127 r130  
    658658$(eval publib := $(PATH_LIB)/$(notdir $(lib)))
    659659$(publib) : $(lib) $(dir $(publib)).dir_created
    660         $(CP) $(lib) $(publib) 
     660        $(CP) $(lib) $(publib)
    661661       
    662662_LIBS += $(publib)
     
    778778$(eval deps        := )
    779779#
    780 $(eval deffile    := $(strip $(firstword
    781         $($(target)_DEFFILE.$(BUILD_TARGET).$(BUILD_TYPE))\
    782         $($(target)_DEFFILE.$(BUILD_TARGET))\
    783         $($(target)_DEFFILE.$(BUILD_TYPE))\
    784         $($(target)_DEFFILE)\
    785         $(DEFFILE.$(BUILD_TARGET).$(BUILD_TYPE))\
    786         $(DEFFILE.$(BUILD_TARGET))\
    787         $(DEFFILE.$(BUILD_TYPE))\
    788         $(DEFFILE)\
    789 )))
    790780$(eval custom_pre    := $(strip $(firstword
    791781        $($(target)_CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
     
    811801
    812802$(eval $(TOOL_$(tool)_LINK_PROGRAM))
    813 
     803# publish rule (still need work)
     804ifndef $(target)_noinst
     805$(eval pubexe := $(PATH_LIB)/$(notdir $(exe)))
     806$(pubexe) : $(exe) $(dir $(pubexe)).dir_created
     807        $(CP) $(exe) $(pubexe)
     808       
     809_DLLS += $(pubexe)
     810_OUT_FILES += $(exe) $(pubexe)
     811else
     812_DLLS += $(exe)
     813_OUT_FILES += $(exe)
     814endif
    814815_OBJS += $(_OBJS_$(target))
    815 _EXES += $(exe)
    816 _OUT_FILES += $(exe)
    817816endef
    818817
     
    826825#
    827826
     827## DLL (one).
     828# @param    $(target)   Normalized target (program) name.
     829define def_dll
     830# source -> object
     831$(eval $(def_target_sources))
     832
     833# dllmod
     834$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     835$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     836$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
     837$(eval dllsuff     := $(firstword $($(target)_DLLSUFF) $($(target)_DLLSUFF) $(TOOL_$(tool)_LDDLLSUFF) $(SUFF_DLL)))
     838$(eval dll         := $(outbase)$(dllsuff))
     839$(eval objs         = $(_OBJS_$(target)))
     840$(eval flags       :=\
     841        $(TOOL_$(tool)_LDFLAGS)\
     842        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TYPE))\
     843        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET))\
     844        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_ARCH))\
     845        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_CPU))\
     846        $(LDFLAGS)\
     847        $(LDFLAGS.$(BUILD_TYPE))\
     848        $(LDFLAGS.$(BUILD_TARGET))\
     849        $(LDFLAGS.$(BUILD_TARGET_ARCH))\
     850        $(LDFLAGS.$(BUILD_TARGET_CPU))\
     851        $($(target)_LDFLAGS)\
     852        $($(target)_LDFLAGS.$(BUILD_TYPE))\
     853        $($(target)_LDFLAGS.$(BUILD_TARGET))\
     854        $($(target)_LDFLAGS.$(BUILD_TARGET_ARCH))\
     855        $($(target)_LDFLAGS.$(BUILD_TARGET_CPU))\
     856)
     857$(eval libs        :=\
     858        $($(target)_LIBS.$(BUILD_TARGET_CPU))\
     859        $($(target)_LIBS.$(BUILD_TARGET_ARCH))\
     860        $($(target)_LIBS.$(BUILD_TARGET))\
     861        $($(target)_LIBS.$(BUILD_TYPE))\
     862        $($(target)_LIBS)\
     863        $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
     864                                   $($(target)_SDKS.$(BUILD_TYPE)) \
     865                                   $($(target)_SDKS),\
     866        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
     867        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
     868        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
     869        $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
     870        $(SDK_$(sdk)_LIBS))\
     871        $(LIBS.$(BUILD_TARGET_CPU))\
     872        $(LIBS.$(BUILD_TARGET_ARCH))\
     873        $(LIBS.$(BUILD_TARGET))\
     874        $(LIBS.$(BUILD_TYPE))\
     875        $(LIBS)\
     876        $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
     877                                   $(SDKS.$(BUILD_TYPE)) \
     878                                   $(SDKS),\
     879        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
     880        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
     881        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
     882        $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
     883        $(SDK_$(sdk)_LIBS))\
     884        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_CPU))\
     885        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_ARCH))\
     886        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET))\
     887        $(TOOL_$(tool)_LIBS.$(BUILD_TYPE))\
     888        $(TOOL_$(tool)_LIBS)\
     889)
     890$(eval libpath    :=\
     891        $($(target)_LIBPATH.$(BUILD_TARGET_CPU))\
     892        $($(target)_LIBPATH.$(BUILD_TARGET_ARCH))\
     893        $($(target)_LIBPATH.$(BUILD_TARGET))\
     894        $($(target)_LIBPATH.$(BUILD_TYPE))\
     895        $($(target)_LIBPATH)\
     896        $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
     897                                   $($(target)_SDKS.$(BUILD_TYPE)) \
     898                                   $($(target)_SDKS),\
     899        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
     900        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
     901        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
     902        $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
     903        $(SDK_$(sdk)_LIBPATH))\
     904        $(LIBPATH.$(BUILD_TARGET_CPU))\
     905        $(LIBPATH.$(BUILD_TARGET_ARCH))\
     906        $(LIBPATH.$(BUILD_TARGET))\
     907        $(LIBPATH.$(BUILD_TYPE))\
     908        $(LIBPATH)\
     909        $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
     910                                   $(SDKS.$(BUILD_TYPE)) \
     911                                   $(SDKS),\
     912        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
     913        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
     914        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
     915        $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
     916        $(SDK_$(sdk)_LIBPATH))\
     917        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_CPU))\
     918        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_ARCH))\
     919        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET))\
     920        $(TOOL_$(tool)_LIBPATH.$(BUILD_TYPE))\
     921        $(TOOL_$(tool)_LIBPATH)\
     922)
     923$(eval dirdep      := $(dir $(dll)).dir_created)
     924## @todo fix dependencies
     925$(eval deps        := )
     926#
     927$(eval custom_pre    := $(strip $(firstword
     928        $($(target)_CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
     929        $($(target)_CUSTOM_PRE.$(BUILD_TARGET))\
     930        $($(target)_CUSTOM_PRE.$(BUILD_TYPE))\
     931        $($(target)_CUSTOM_PRE)\
     932        $(CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
     933        $(CUSTOM_PRE.$(BUILD_TARGET))\
     934        $(CUSTOM_PRE.$(BUILD_TYPE))\
     935        $(CUSTOM_PRE)\
     936)))
     937$(eval custom_post    := $(strip $(firstword
     938        $($(target)_CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
     939        $($(target)_CUSTOM_POST.$(BUILD_TARGET))\
     940        $($(target)_CUSTOM_POST.$(BUILD_TYPE))\
     941        $($(target)_CUSTOM_POST)\
     942        $(CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
     943        $(CUSTOM_POST.$(BUILD_TARGET))\
     944        $(CUSTOM_POST.$(BUILD_TYPE))\
     945        $(CUSTOM_POST)\
     946)))
     947$(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))))
     948
     949ifndef TOOL_$(tool)_LINK_DLL
     950$$(warning kBuild: TOOL_$(tool)_LINK_DLL is not defined. target=$(target) )
     951$$(warning kBuild: tools: \
     952        1 $($(target)_$(source)TOOL.$(BUILD_TARGET)) \
     953        2 $($(target)_$(source)TOOL) \
     954        3 $($(target)_TOOL.$(BUILD_TARGET)) \
     955        4 $($(target)_TOOL) \
     956        5 $($(source)TOOL) \
     957        6 $($(source)TOOL.$(BUILD_TARGET)) \
     958        7 $(TOOL.$(BUILD_TARGET)) \
     959        8 $(TOOL) )
     960endif   
     961
     962$(eval $(TOOL_$(tool)_LINK_DLL))
     963
     964                                       
     965# publish rule (still need work)
     966ifndef $(target)_noinst
     967$(eval pubdll := $(PATH_LIB)/$(notdir $(dll)))
     968$(pubdll) : $(dll) $(dir $(pubdll)).dir_created
     969        $(CP) $(dll) $(pubdll)
     970       
     971_DLLS += $(pubdll)
     972_OUT_FILES += $(dll) $(pubdll)
     973else
     974_DLLS += $(dll)
     975_OUT_FILES += $(dll)
     976endif
     977_OBJS += $(_OBJS_$(target))
     978endef
     979
     980# Process dlls
     981$(foreach target, $(DLLS), $(eval $(def_dll)))
    828982
    829983
     
    832986#
    833987
    834 ## System moduler (one).
     988## System module (one).
    835989# @param    $(target)   Normalized target (program) name.
    836990define def_sysmod
     
    9321086$(eval deps        := )
    9331087#
    934 $(eval deffile    := $(strip $(firstword
    935         $($(target)_DEFFILE.$(BUILD_TARGET).$(BUILD_TYPE))\
    936         $($(target)_DEFFILE.$(BUILD_TARGET))\
    937         $($(target)_DEFFILE.$(BUILD_TYPE))\
    938         $($(target)_DEFFILE)\
    939         $(DEFFILE.$(BUILD_TARGET).$(BUILD_TYPE))\
    940         $(DEFFILE.$(BUILD_TARGET))\
    941         $(DEFFILE.$(BUILD_TYPE))\
    942         $(DEFFILE)\
    943 )))
    9441088$(eval custom_pre    := $(strip $(firstword
    9451089        $($(target)_CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
     
    9791123$(eval $(TOOL_$(tool)_LINK_SYSMOD))
    9801124
    981 _OBJS += $(_OBJS_$(target))
     1125# publish rule (still need work)
     1126ifndef $(target)_noinst
     1127$(eval pubsys := $(PATH_LIB)/$(notdir $(sys)))
     1128$(pubsys) : $(sys) $(dir $(pubsys)).dir_created
     1129        $(CP) $(sys) $(pubsys)
     1130       
     1131_SYSMODS += $(pubsys)
     1132_OUT_FILES += $(sys) $(pubsys)
     1133else
    9821134_SYSMODS += $(sys)
    9831135_OUT_FILES += $(sys)
    984 endef
    985 
    986 # Process libraries
     1136endif
     1137_OBJS += $(_OBJS_$(target))
     1138endef
     1139
     1140# Process sysmods
    9871141$(foreach target, $(SYSMODS), $(eval $(def_sysmod)))
    9881142
     
    10031157# Directories.
    10041158#
    1005 _DIRFILES := $(sort $(addsuffix /.dir_created,$(_DIRS)) $(addsuffix .dir_created,$(dir $(_OUT_FILES) $(_OBJS))))
     1159_DIRFILES := $(sort $(addsuffix /.dir_created,$(_DIRS)) $(addsuffix .dir_created,$(sort $(dir $(_OUT_FILES) $(_OBJS)))))
    10061160
    10071161define def_createdir
     
    11551309all_recursive: $(foreach pass,$(PASSES),pass_$(pass))
    11561310
    1157 rebuild: clean 
     1311rebuild: clean
    11581312        $(MAKE) -f $(firstword $(MAKEFILE_LIST)) all_recursive
    11591313
  • trunk/kBuild/header.kmk

    r129 r130  
    285285endif
    286286
    287 ## ABSPATH - makes a path absolute.
     287## ABSPATH - make paths absolute.
    288288# This implementation is clumsy and doesn't resolve '..' and '.' components.
    289289#
     
    293293                      $(if $(patsubst %:,,$(firstword $(subst :,: ,$(path)))),$(PATH_CURRENT)/$(path),$(path)),\
    294294                      $(path))))
     295## DIRDEP - make create directory dependencies.
     296#
     297# @param        $1      The paths to the directories which must be created.
     298DIRDEP = $(foreach path,$(1),$(path)/.dir_created)
     299               
    295300
    296301## Cygwin kludge.
  • trunk/kBuild/tools/GCC.kmk

    r129 r130  
    5858TOOL_GCC_LDFLAGS.debug      := -g
    5959TOOL_GCC_LDFLAGS.release    := -s
     60TOOL_GCC_LDFLAGS.dll.os2    := -Zdll
     61ifndef TOOL_GCC_LDFLAGS.$(BUILD_TARGET)
     62TOOL_GCC_LDFLAGS.dll        := -shared
     63else
     64TOOL_GCC_LDFLAGS.dll        := $(TOOL_GCC_LDFLAGS.$(BUILD_TARGET))
     65endif
    6066
    6167
     
    138144# @param        $(dirdep)   Directory creation dependency.
    139145# @param        $(deps)         Other dependencies.
    140 # @param        $(deffile)  Definition file. (optional, PC only)
     146# @param        $(othersrc) Unhandled sources.
    141147# @param        $(custom_pre)   Custom step invoked before linking.
    142148# @param        $(custom_post)  Custom step invoked after linking.
     
    158164endef
    159165
     166
     167## Link program
     168# @param    $(target)   Normalized main target name.
     169# @param    $(exe)              Program name.
     170# @param    $(objs)     Object files to link together.
     171# @param    $(libs)     Libraries to search.
     172# @param    $(libpath)  Library search paths.
     173# @param    $(flags)    Flags.
     174# @param        $(dirdep)   Directory creation dependency.
     175# @param        $(deps)         Other dependencies.
     176# @param        $(othersrc) Unhandled sources.
     177# @param        $(custom_pre)   Custom step invoked before linking.
     178# @param        $(custom_post)  Custom step invoked after linking.
     179#
     180# @param    $(outbase)  Output basename (full). Use this for list files and such.
     181define TOOL_GCC_LINK_DLL
     182#$ (warning dbg: TOOL_GCC_LINK_DLL: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
     183$(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
     184        $(call MSG_L1,Creating Program $$@)
     185ifneq ($(custom_pre),)
     186        $(eval $(custom_pre))
     187endif   
     188        $(TOOL_GCC_LD) $(TOOL_GCC_LDFLAGS.dll) $(flags) -o $$@ $(objs) \
     189        $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
     190ifneq ($(custom_post),)
     191        $(eval $(custom_post))
     192endif   
     193       
     194endef
     195
  • trunk/kBuild/tools/GCC3.kmk

    r129 r130  
    5757TOOL_GCC3_LDFLAGS.debug      := -g
    5858TOOL_GCC3_LDFLAGS.release    := -s
     59ifndef TOOL_GCC3_LDFLAGS.$(BUILD_TARGET)
     60TOOL_GCC3_LDFLAGS.dll        := -shared
     61else
     62TOOL_GCC3_LDFLAGS.dll        := $(TOOL_GCC3_LDFLAGS.$(BUILD_TARGET))
     63endif
    5964
    6065
     
    137142# @param        $(dirdep)   Directory creation dependency.
    138143# @param        $(deps)         Other dependencies.
    139 # @param        $(deffile)  Definition file. (optional, PC only)
     144# @param        $(othersrc) Unhandled sources.
    140145# @param        $(custom_pre)   Custom step invoked before linking.
    141146# @param        $(custom_post)  Custom step invoked after linking.
     
    155160        $(eval $(custom_post))
    156161endif   
    157         $(MKDIR) -p $(PATH_BIN)
    158         $(CP) $$@ $(PATH_BIN)/
    159162       
    160163endef
    161164
     165
     166## Link DLL
     167# @param    $(target)   Normalized main target name.
     168# @param    $(dll)              Program name.
     169# @param    $(objs)     Object files to link together.
     170# @param    $(libs)     Libraries to search.
     171# @param    $(libpath)  Library search paths.
     172# @param    $(flags)    Flags.
     173# @param        $(dirdep)   Directory creation dependency.
     174# @param        $(deps)         Other dependencies.
     175# @param        $(othersrc) Unhandled sources.
     176# @param        $(custom_pre)   Custom step invoked before linking.
     177# @param        $(custom_post)  Custom step invoked after linking.
     178#
     179# @param    $(outbase)  Output basename (full). Use this for list files and such.
     180define TOOL_GCC3_LINK_DLL
     181#$ (warning dbg: TOOL_GCC3_LINK_PROGRAM: target=$(target) dll=$(dll) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
     182$(dll): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
     183        $(call MSG_L1,Creating Program $$@)
     184ifneq ($(custom_pre),)
     185        $(eval $(custom_pre))
     186endif   
     187        $(TOOL_GCC3_LD) $(TOOL_GCC3_LDFLAGS.dll) $(flags) -o $$@ $(objs) \
     188        $(foreach p,$(libpath), -L$(p)) \
     189        $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
     190ifneq ($(custom_post),)
     191        $(eval $(custom_post))
     192endif   
     193       
     194endef
     195
  • trunk/kBuild/tools/MINGW32.kmk

    r129 r130  
    171171# @param        $(dirdep)   Directory creation dependency.
    172172# @param        $(deps)         Other dependencies.
    173 # @param        $(deffile)  Definition file. (optional, PC only)
     173# @param        $(othersrc) Unhandled sources.
    174174# @param        $(custom_pre)   Custom step invoked before linking.
    175175# @param        $(custom_post)  Custom step invoked after linking.
     
    189189        $(eval $(custom_post))
    190190endif   
    191         $(MKDIR) -p $(PATH_BIN)
    192         $(CP) $$@ $(PATH_BIN)/
    193191       
    194192endef
  • 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.