Changeset 141 for trunk/kBuild


Ignore:
Timestamp:
Aug 17, 2004, 8:26:34 PM (21 years ago)
Author:
bird
Message:

mingw dlls.

File:
1 edited

Legend:

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

    r130 r141  
    9191TOOL_MINGW32_LDFLAGS.debug      := -g
    9292TOOL_MINGW32_LDFLAGS.release    := -s
     93
     94TOOL_MINGW32_DLLWRAP            := $(_TOOL_MINGW32_PREFIX)dllwrap$(_TOOL_MINGW32_SUFF_EXE)
     95TOOL_MINGW32_DLLTOOL            := $(_TOOL_MINGW32_PREFIX)dlltool$(_TOOL_MINGW32_SUFF_EXE)
    9396
    9497
     
    192195endef
    193196
     197
     198## Link system module (windows aka driver, linux aka kernel module)
     199# @param    $(target)   Normalized main target name.
     200# @param    $(dll)              System module name.
     201# @param    $(objs)     Object files to link together.
     202# @param    $(libs)     Libraries to search.
     203# @param    $(libpath)  Library search paths.
     204# @param    $(flags)    Flags.
     205# @param        $(dirdep)   Directory creation dependency.
     206# @param        $(deps)         Other dependencies.
     207# @param        $(othersrc) Unhandled sources.
     208# @param        $(custom_pre)   Custom step invoked before linking.
     209# @param        $(custom_post)  Custom step invoked after linking.
     210#
     211# @param    $(outbase)  Output basename (full). Use this for list files and such.
     212define TOOL_MINGW32_LINK_DLL
     213#$ (warning dbg: TOOL_MINGW32_LINK_DLL: target=$(target) dll=$(dll) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
     214$(dll): $(dirdep) $(call DIRDEP,$(PATH_LIB)) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
     215        $(call MSG_L1,Creating Program $$@)
     216ifneq ($(custom_pre),)
     217        $(eval $(custom_pre))
     218endif   
     219        $(TOOL_MINGW32_DLLWRAP) $(flags) \
     220                --dllname=$(dll) \
     221                --output-exp=$(outbase).exp \
     222                --output-lib=$(outbase).a \
     223                $(foreach def,$(filter %.def,$(othersrc)), --def $(def)) \
     224                $(filter %.res,$(othersrc)) \
     225                $(foreach p,$(libpath), /LIBPATH:$(p)) \
     226                $(objs) \
     227                $(foreach p,$(libpath), -L$(p)) \
     228                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
     229ifeq ($(filter %.exp .def,$(othersrc)),)
     230        $(CP) $(outbase).exp $(outbase).a $(PATH_LIB)/
     231endif
     232ifneq ($(custom_post),)
     233        $(eval $(custom_post))
     234endif   
     235_OUT_FILES += $(outbase).map $(outbase).a $(outbase).exp
     236
     237endef
     238
Note: See TracChangeset for help on using the changeset viewer.