Ignore:
Timestamp:
Feb 8, 2005, 5:47:39 PM (20 years ago)
Author:
bird
Message:

Fixed more pass order shit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r219 r220  
    5858_DIRS     :=
    5959_IMPORT_LIBS :=
     60
     61# misc
     62pass_prev :=
     63
    6064
    6165# all objs of a specific target
     
    301305        $($(target)_LDTOOL)\
    302306        ,$(eval _TOOLS += $(tool)))
    303 $(foreach source, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE)) \
     307$(foreach source, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE)) \
    304308        , $(eval $(def_tools_target_source)))
    305309endef
     
    320324_SDKS := $(SDKS)
    321325define def_sdks_target_source
    322 $(foreach sdk, $($(source)_SDKS) $($(source)_SDKS.$(BUILD_TARGET)) $($(source)_SDKS.$(BUILD_MODE)) \
    323                            $($(target)_$(source)_SDKS) $($(target)_$(source)_SDKS.$(BUILD_TARGET)) $($(target)_$(source)_SDKS.$(BUILD_MODE)), \
     326$(foreach sdk, $($(source)_SDKS) $($(source)_SDKS.$(BUILD_TARGET)) $($(source)_SDKS.$(BUILD_TYPE)) \
     327                           $($(target)_$(source)_SDKS) $($(target)_$(source)_SDKS.$(BUILD_TARGET)) $($(target)_$(source)_SDKS.$(BUILD_TYPE)), \
    324328        $(eval _SDKS += $(sdk)))
    325329endef
    326330define def_sdks_target
    327 $(foreach sdk, $($(target)_SDKS) $($(target)_SDKS.$(BUILD_TARGET)) $($(target)_SDKS.$(BUILD_MODE))\
     331$(foreach sdk, $($(target)_SDKS) $($(target)_SDKS.$(BUILD_TARGET)) $($(target)_SDKS.$(BUILD_TYPE))\
    328332        , $(eval _SDKS += $(sdk)))
    329 $(foreach source, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))\
     333$(foreach source, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE))\
    330334        , $(eval $(def_sdks_target_source)))
    331335endef
     
    646650#$ (warning def_target_sources)
    647651# C sources
    648 $(foreach type,C,$(foreach source, $(filter %.c, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE)))\
     652$(foreach type,C,$(foreach source, $(filter %.c, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE)))\
    649653        ,$(eval $(def_target_source_c_cpp_asm)) ))
    650654
    651655# C++ sources
    652 $(foreach type,CXX,$(foreach source, $(filter %.cpp %.cxx %.xx, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE)))\
     656$(foreach type,CXX,$(foreach source, $(filter %.cpp %.cxx %.xx, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE)))\
    653657        ,$(eval $(def_target_source_c_cpp_asm)) ))
    654658
    655659# ASM sources
    656 $(foreach type,AS,$(foreach source, $(filter %.asm %.s %.S, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE)))\
     660$(foreach type,AS,$(foreach source, $(filter %.asm %.s %.S, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE)))\
    657661        ,$(eval $(def_target_source_c_cpp_asm)) ))
    658662endef
     
    670674$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    671675$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
     676$(eval bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE)))
     677$(eval bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET)))
     678$(eval bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU)))
     679$(eval bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH)))
    672680$(eval exesuff     := $(firstword $($(target)_EXESUFF) $($(target)_EXESUFF) $(TOOL_$(tool)_LDEXESUFF) $(HOSTSUFF_EXE)))
     681$(eval exe         := $(outbase)$(exesuff))
     682$(eval TARGET_$(target) := $(exe))
     683
     684# source -> object
     685$(eval $(def_target_sources))
     686
     687# more library stuff.
     688$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     689$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     690$(eval objs         = $(_OBJS_$(target)))
     691$(eval flags       :=\
     692        $(TOOL_$(tool)_LDFLAGS)\
     693        $(TOOL_$(tool)_LDFLAGS.$(bld_type))\
     694        $(TOOL_$(tool)_LDFLAGS.$(bld_trg))\
     695        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_ARCH))\
     696        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_CPU))\
     697        $(LDFLAGS)\
     698        $(LDFLAGS.$(bld_type))\
     699        $(LDFLAGS.$(bld_trg))\
     700        $(LDFLAGS.$(BUILD_TARGET_ARCH))\
     701        $(LDFLAGS.$(BUILD_TARGET_CPU))\
     702        $($(target)_LDFLAGS)\
     703        $($(target)_LDFLAGS.$(bld_type))\
     704        $($(target)_LDFLAGS.$(bld_trg))\
     705        $($(target)_LDFLAGS.$(BUILD_TARGET_ARCH))\
     706        $($(target)_LDFLAGS.$(BUILD_TARGET_CPU))\
     707)
     708$(eval libs        :=\
     709        $($(target)_LIBS.$(BUILD_TARGET_CPU))\
     710        $($(target)_LIBS.$(BUILD_TARGET_ARCH))\
     711        $($(target)_LIBS.$(bld_trg))\
     712        $($(target)_LIBS.$(bld_type))\
     713        $($(target)_LIBS)\
     714        $(foreach sdk, $($(target)_SDKS.$(bld_trg)) \
     715                                   $($(target)_SDKS.$(bld_type)) \
     716                                   $($(target)_SDKS),\
     717        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
     718        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
     719        $(SDK_$(sdk)_LIBS.$(bld_trg))\
     720        $(SDK_$(sdk)_LIBS.$(bld_type))\
     721        $(SDK_$(sdk)_LIBS))\
     722        $(LIBS.$(BUILD_TARGET_CPU))\
     723        $(LIBS.$(BUILD_TARGET_ARCH))\
     724        $(LIBS.$(bld_trg))\
     725        $(LIBS.$(bld_type))\
     726        $(LIBS)\
     727        $(foreach sdk, $(SDKS.$(bld_trg)) \
     728                                   $(SDKS.$(bld_type)) \
     729                                   $(SDKS),\
     730        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
     731        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
     732        $(SDK_$(sdk)_LIBS.$(bld_trg))\
     733        $(SDK_$(sdk)_LIBS.$(bld_type))\
     734        $(SDK_$(sdk)_LIBS))\
     735        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_CPU))\
     736        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_ARCH))\
     737        $(TOOL_$(tool)_LIBS.$(bld_trg))\
     738        $(TOOL_$(tool)_LIBS.$(bld_type))\
     739        $(TOOL_$(tool)_LIBS)\
     740)
     741$(eval libpath    :=\
     742        $($(target)_LIBPATH.$(BUILD_TARGET_CPU))\
     743        $($(target)_LIBPATH.$(BUILD_TARGET_ARCH))\
     744        $($(target)_LIBPATH.$(bld_trg))\
     745        $($(target)_LIBPATH.$(bld_type))\
     746        $($(target)_LIBPATH)\
     747        $(foreach sdk, $($(target)_SDKS.$(bld_trg)) \
     748                                   $($(target)_SDKS.$(bld_type)) \
     749                                   $($(target)_SDKS),\
     750        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
     751        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
     752        $(SDK_$(sdk)_LIBPATH.$(bld_trg))\
     753        $(SDK_$(sdk)_LIBPATH.$(bld_type))\
     754        $(SDK_$(sdk)_LIBPATH))\
     755        $(LIBPATH.$(BUILD_TARGET_CPU))\
     756        $(LIBPATH.$(BUILD_TARGET_ARCH))\
     757        $(LIBPATH.$(bld_trg))\
     758        $(LIBPATH.$(bld_type))\
     759        $(LIBPATH)\
     760        $(foreach sdk, $(SDKS.$(bld_trg)) \
     761                                   $(SDKS.$(bld_type)) \
     762                                   $(SDKS),\
     763        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
     764        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
     765        $(SDK_$(sdk)_LIBPATH.$(bld_trg))\
     766        $(SDK_$(sdk)_LIBPATH.$(bld_type))\
     767        $(SDK_$(sdk)_LIBPATH))\
     768        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_CPU))\
     769        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_ARCH))\
     770        $(TOOL_$(tool)_LIBPATH.$(bld_trg))\
     771        $(TOOL_$(tool)_LIBPATH.$(bld_type))\
     772        $(TOOL_$(tool)_LIBPATH)\
     773)
     774$(eval dirdep      := $(dir $(exe)).dir_created)
     775## @todo fix dependencies
     776$(eval deps        := $($(target)_DEPS))
     777#
     778$(eval custom_pre    := $(strip $(firstword
     779        $($(target)_CUSTOM_PRE.$(bld_trg).$(bld_type))\
     780        $($(target)_CUSTOM_PRE.$(bld_trg))\
     781        $($(target)_CUSTOM_PRE.$(bld_type))\
     782        $($(target)_CUSTOM_PRE)\
     783        $(CUSTOM_PRE.$(bld_trg).$(bld_type))\
     784        $(CUSTOM_PRE.$(bld_trg))\
     785        $(CUSTOM_PRE.$(bld_type))\
     786        $(CUSTOM_PRE)\
     787)))
     788$(eval custom_post    := $(strip $(firstword
     789        $($(target)_CUSTOM_POST.$(bld_trg).$(bld_type))\
     790        $($(target)_CUSTOM_POST.$(bld_trg))\
     791        $($(target)_CUSTOM_POST.$(bld_type))\
     792        $($(target)_CUSTOM_POST)\
     793        $(CUSTOM_POST.$(bld_trg).$(bld_type))\
     794        $(CUSTOM_POST.$(bld_trg))\
     795        $(CUSTOM_POST.$(bld_type))\
     796        $(CUSTOM_POST)\
     797)))
     798$(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_type))))
     799
     800$(eval $(TOOL_$(tool)_LINK_PROGRAM))
     801# publish rule (still need work)
     802ifndef $(target)_INST
     803$(eval pubexe := $(PATH_BIN)/$(notdir $(exe)))
     804$(pubexe) : $(exe) $(dir $(pubexe)).dir_created
     805        $(CP) $(exe) $(pubexe)
     806
     807_NEEDED    += $(pubexe)
     808_OUT_FILES += $(exe) $(pubexe)
     809else
     810_NEEDED    += $(exe)
     811_OUT_FILES += $(exe)
     812endif
     813_OBJS += $(_OBJS_$(target))
     814endef
     815
     816# Process needed.
     817$(foreach target, $(NEEDED) $(NEEDED.$(BUILD_TARGET)), $(eval $(def_needed)))
     818
     819
     820
     821#
     822# LIBRARIES
     823#
     824
     825## Library (one).
     826# @param    $(target)   Normalized library (target) name.
     827define def_lib
     828# library basics
     829$(eval tool        := $(call _TARGET_TOOL,$(target),AR))
     830ifeq ($(tool),)
     831$$(error kBuild: Library target $(target) doesn't have a tool defined!)
     832endif
     833## @todo prefix
     834$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     835$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
     836$(eval libsuff     := $(firstword\
     837        $($(target)_LIBSUFF.$(BUILD_TARGET))\
     838        $($(target)_LIBSUFF)\
     839        $(TOOL_$(tool)_ARLIBSUFF.$(BUILD_TARGET))\
     840        $(TOOL_$(tool)_ARLIBSUFF)\
     841        $(SUFF_LIB)\
     842))
     843$(eval lib         := $(outbase)$(libsuff))
     844$(eval TARGET_$(target) := $(lib))
     845
     846# source -> object
     847$(eval $(def_target_sources))
     848
     849# library linking
     850$(eval tool        := $(call _TARGET_TOOL,$(target),AR))
     851$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     852$(eval flags       :=\
     853        $(TOOL_$(tool)_ARFLAGS)\
     854        $(TOOL_$(tool)_ARFLAGS.$(BUILD_TYPE))\
     855        $(ARFLAGS)\
     856        $(ARFLAGS.$(BUILD_TYPE))\
     857        $($(target)_ARFLAGS)\
     858        $($(target)_ARFLAGS.$(BUILD_TYPE))\
     859        )
     860$(eval objs         = $(_OBJS_$(target)))
     861$(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE))))
     862$(eval dirdep      := $(dir $(lib)).dir_created)
     863## @todo fix dependencies on makefiles an such
     864$(eval deps        := $($(target)_DEPS))
     865
     866$(eval $(TOOL_$(tool)_LINK_LIBRARY))
     867
     868# publish rule (still need work)
     869ifndef $(target)_NOINST
     870$(eval publib := $(PATH_LIB)/$(notdir $(lib)))
     871$(publib) : $(lib) $(dir $(publib)).dir_created
     872        $(CP) $(lib) $(publib)
     873
     874_LIBS += $(publib)
     875_OUT_FILES += $(lib) $(publib)
     876else
     877_LIBS += $(lib)
     878_OUT_FILES += $(lib)
     879endif
     880_OBJS += $(_OBJS_$(target))
     881endef
     882
     883# Process libraries
     884$(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)), $(eval $(def_lib)))
     885
     886
     887
     888#
     889# DLLS
     890#
     891
     892## DLL (one).
     893# @param    $(target)   Normalized target (program) name.
     894define def_dll
     895# dllmod basics
     896$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     897$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     898$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
     899$(eval dllsuff     := $(firstword $($(target)_DLLSUFF) $($(target)_DLLSUFF) $(TOOL_$(tool)_LDDLLSUFF) $(SUFF_DLL)))
     900$(eval dll         := $(outbase)$(dllsuff))
     901$(eval TARGET_$(target) := $(dll))
     902
     903# source -> object
     904$(eval $(def_target_sources))
     905
     906# dllmod linking.
     907$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     908$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     909$(eval objs         = $(_OBJS_$(target)))
     910$(eval flags       :=\
     911        $(TOOL_$(tool)_LDFLAGS)\
     912        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TYPE))\
     913        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET))\
     914        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_ARCH))\
     915        $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_CPU))\
     916        $(LDFLAGS)\
     917        $(LDFLAGS.$(BUILD_TYPE))\
     918        $(LDFLAGS.$(BUILD_TARGET))\
     919        $(LDFLAGS.$(BUILD_TARGET_ARCH))\
     920        $(LDFLAGS.$(BUILD_TARGET_CPU))\
     921        $($(target)_LDFLAGS)\
     922        $($(target)_LDFLAGS.$(BUILD_TYPE))\
     923        $($(target)_LDFLAGS.$(BUILD_TARGET))\
     924        $($(target)_LDFLAGS.$(BUILD_TARGET_ARCH))\
     925        $($(target)_LDFLAGS.$(BUILD_TARGET_CPU))\
     926)
     927$(eval libs        :=\
     928        $($(target)_LIBS.$(BUILD_TARGET_CPU))\
     929        $($(target)_LIBS.$(BUILD_TARGET_ARCH))\
     930        $($(target)_LIBS.$(BUILD_TARGET))\
     931        $($(target)_LIBS.$(BUILD_TYPE))\
     932        $($(target)_LIBS)\
     933        $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
     934                                   $($(target)_SDKS.$(BUILD_TYPE)) \
     935                                   $($(target)_SDKS),\
     936        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
     937        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
     938        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
     939        $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
     940        $(SDK_$(sdk)_LIBS))\
     941        $(LIBS.$(BUILD_TARGET_CPU))\
     942        $(LIBS.$(BUILD_TARGET_ARCH))\
     943        $(LIBS.$(BUILD_TARGET))\
     944        $(LIBS.$(BUILD_TYPE))\
     945        $(LIBS)\
     946        $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
     947                                   $(SDKS.$(BUILD_TYPE)) \
     948                                   $(SDKS),\
     949        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
     950        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
     951        $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
     952        $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
     953        $(SDK_$(sdk)_LIBS))\
     954        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_CPU))\
     955        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_ARCH))\
     956        $(TOOL_$(tool)_LIBS.$(BUILD_TARGET))\
     957        $(TOOL_$(tool)_LIBS.$(BUILD_TYPE))\
     958        $(TOOL_$(tool)_LIBS)\
     959)
     960$(eval libpath    :=\
     961        $($(target)_LIBPATH.$(BUILD_TARGET_CPU))\
     962        $($(target)_LIBPATH.$(BUILD_TARGET_ARCH))\
     963        $($(target)_LIBPATH.$(BUILD_TARGET))\
     964        $($(target)_LIBPATH.$(BUILD_TYPE))\
     965        $($(target)_LIBPATH)\
     966        $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
     967                                   $($(target)_SDKS.$(BUILD_TYPE)) \
     968                                   $($(target)_SDKS),\
     969        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
     970        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
     971        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
     972        $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
     973        $(SDK_$(sdk)_LIBPATH))\
     974        $(LIBPATH.$(BUILD_TARGET_CPU))\
     975        $(LIBPATH.$(BUILD_TARGET_ARCH))\
     976        $(LIBPATH.$(BUILD_TARGET))\
     977        $(LIBPATH.$(BUILD_TYPE))\
     978        $(LIBPATH)\
     979        $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
     980                                   $(SDKS.$(BUILD_TYPE)) \
     981                                   $(SDKS),\
     982        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
     983        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
     984        $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
     985        $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
     986        $(SDK_$(sdk)_LIBPATH))\
     987        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_CPU))\
     988        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_ARCH))\
     989        $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET))\
     990        $(TOOL_$(tool)_LIBPATH.$(BUILD_TYPE))\
     991        $(TOOL_$(tool)_LIBPATH)\
     992)
     993$(eval dirdep      := $(dir $(dll)).dir_created)
     994## @todo fix dependencies
     995$(eval deps        := $($(target)_DEPS))
     996#
     997$(eval custom_pre    := $(strip $(firstword
     998        $($(target)_CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
     999        $($(target)_CUSTOM_PRE.$(BUILD_TARGET))\
     1000        $($(target)_CUSTOM_PRE.$(BUILD_TYPE))\
     1001        $($(target)_CUSTOM_PRE)\
     1002        $(CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
     1003        $(CUSTOM_PRE.$(BUILD_TARGET))\
     1004        $(CUSTOM_PRE.$(BUILD_TYPE))\
     1005        $(CUSTOM_PRE)\
     1006)))
     1007$(eval custom_post    := $(strip $(firstword
     1008        $($(target)_CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
     1009        $($(target)_CUSTOM_POST.$(BUILD_TARGET))\
     1010        $($(target)_CUSTOM_POST.$(BUILD_TYPE))\
     1011        $($(target)_CUSTOM_POST)\
     1012        $(CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
     1013        $(CUSTOM_POST.$(BUILD_TARGET))\
     1014        $(CUSTOM_POST.$(BUILD_TYPE))\
     1015        $(CUSTOM_POST)\
     1016)))
     1017$(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE))))
     1018
     1019ifndef TOOL_$(tool)_LINK_DLL
     1020$$(warning kBuild: TOOL_$(tool)_LINK_DLL is not defined. target=$(target) )
     1021$$(warning kBuild: tools: \
     1022        1 $($(target)_$(source)TOOL.$(BUILD_TARGET)) \
     1023        2 $($(target)_$(source)TOOL) \
     1024        3 $($(target)_TOOL.$(BUILD_TARGET)) \
     1025        4 $($(target)_TOOL) \
     1026        5 $($(source)TOOL) \
     1027        6 $($(source)TOOL.$(BUILD_TARGET)) \
     1028        7 $(TOOL.$(BUILD_TARGET)) \
     1029        8 $(TOOL) )
     1030endif
     1031
     1032$(eval $(TOOL_$(tool)_LINK_DLL))
     1033
     1034
     1035# publish rule (still need work)
     1036ifndef $(target)_NOINST
     1037$(eval pubdll := $(PATH_BIN)/$(notdir $(dll)))
     1038$(pubdll) : $(dll) $(dir $(pubdll)).dir_created
     1039        $(CP) $(dll) $(pubdll)
     1040
     1041$(eval TARGET_PUB_$(target) := $(pubdll))
     1042_DLLS += $(pubdll)
     1043_OUT_FILES += $(dll) $(pubdll)
     1044else
     1045_DLLS += $(dll)
     1046_OUT_FILES += $(dll)
     1047endif
     1048_OBJS += $(_OBJS_$(target))
     1049endef
     1050
     1051# Process dlls
     1052$(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)), $(eval $(def_dll)))
     1053
     1054
     1055
     1056#
     1057# Process import libraries.
     1058#
     1059#   - On OS/2 and windows these are libraries.
     1060#   - On other platforms they are fake DLLs.
     1061ifeq ($(subst win32,os2,$(BUILD_TARGET)),os2)
     1062$(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval $(def_lib)))
     1063else
     1064$(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval $(def_dll)))
     1065endif
     1066$(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval _IMPORT_LIBS += $(firstword $(TARGET_PUB_$(target)) $(TARGET_$(target)))))
     1067
     1068   
     1069
     1070#
     1071# PROGRAMS
     1072#
     1073
     1074## Program (one).
     1075# @param    $(target)   Normalized target (program) name.
     1076define def_program
     1077# basics
     1078$(eval tool        := $(call _TARGET_TOOL,$(target),LD))
     1079$(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
     1080$(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
     1081$(eval exesuff     := $(firstword $($(target)_EXESUFF) $($(target)_EXESUFF) $(TOOL_$(tool)_LDEXESUFF) $(SUFF_EXE)))
    6731082$(eval exe         := $(outbase)$(exesuff))
    6741083$(eval TARGET_$(target) := $(exe))
     
    7881197        $(CUSTOM_POST)\
    7891198)))
    790 $(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))))
    791 
    792 $(eval $(TOOL_$(tool)_LINK_PROGRAM))
    793 # publish rule (still need work)
    794 ifndef $(target)_INST
    795 $(eval pubexe := $(PATH_BIN)/$(notdir $(exe)))
    796 $(pubexe) : $(exe) $(dir $(pubexe)).dir_created
    797         $(CP) $(exe) $(pubexe)
    798 
    799 _NEEDED    += $(pubexe)
    800 _OUT_FILES += $(exe) $(pubexe)
    801 else
    802 _NEEDED    += $(exe)
    803 _OUT_FILES += $(exe)
    804 endif
    805 _OBJS += $(_OBJS_$(target))
    806 endef
    807 
    808 # Process needed.
    809 $(foreach target, $(NEEDED) $(NEEDED.$(BUILD_TARGET)), $(eval $(def_needed)))
    810 
    811 
    812 
    813 #
    814 # LIBRARIES
    815 #
    816 
    817 ## Library (one).
    818 # @param    $(target)   Normalized library (target) name.
    819 define def_lib
    820 # library basics
    821 $(eval tool        := $(call _TARGET_TOOL,$(target),AR))
    822 ifeq ($(tool),)
    823 $$(error kBuild: Library target $(target) doesn't have a tool defined!)
    824 endif
    825 ## @todo prefix
    826 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    827 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    828 $(eval libsuff     := $(firstword\
    829         $($(target)_LIBSUFF.$(BUILD_TARGET))\
    830         $($(target)_LIBSUFF)\
    831         $(TOOL_$(tool)_ARLIBSUFF.$(BUILD_TARGET))\
    832         $(TOOL_$(tool)_ARLIBSUFF)\
    833         $(SUFF_LIB)\
    834 ))
    835 $(eval lib         := $(outbase)$(libsuff))
    836 $(eval TARGET_$(target) := $(lib))
    837 
    838 # source -> object
    839 $(eval $(def_target_sources))
    840 
    841 # library linking
    842 $(eval tool        := $(call _TARGET_TOOL,$(target),AR))
    843 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    844 $(eval flags       :=\
    845         $(TOOL_$(tool)_ARFLAGS)\
    846         $(TOOL_$(tool)_ARFLAGS.$(BUILD_TYPE))\
    847         $(ARFLAGS)\
    848         $(ARFLAGS.$(BUILD_TYPE))\
    849         $($(target)_ARFLAGS)\
    850         $($(target)_ARFLAGS.$(BUILD_TYPE))\
    851         )
    852 $(eval objs         = $(_OBJS_$(target)))
    853 $(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))))
    854 $(eval dirdep      := $(dir $(lib)).dir_created)
    855 ## @todo fix dependencies on makefiles an such
    856 $(eval deps        := $($(target)_DEPS))
    857 
    858 $(eval $(TOOL_$(tool)_LINK_LIBRARY))
    859 
    860 # publish rule (still need work)
    861 ifndef $(target)_NOINST
    862 $(eval publib := $(PATH_LIB)/$(notdir $(lib)))
    863 $(publib) : $(lib) $(dir $(publib)).dir_created
    864         $(CP) $(lib) $(publib)
    865 
    866 _LIBS += $(publib)
    867 _OUT_FILES += $(lib) $(publib)
    868 else
    869 _LIBS += $(lib)
    870 _OUT_FILES += $(lib)
    871 endif
    872 _OBJS += $(_OBJS_$(target))
    873 endef
    874 
    875 # Process libraries
    876 $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)), $(eval $(def_lib)))
    877 
    878 
    879 
    880 #
    881 # DLLS
    882 #
    883 
    884 ## DLL (one).
    885 # @param    $(target)   Normalized target (program) name.
    886 define def_dll
    887 # dllmod basics
    888 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    889 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    890 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    891 $(eval dllsuff     := $(firstword $($(target)_DLLSUFF) $($(target)_DLLSUFF) $(TOOL_$(tool)_LDDLLSUFF) $(SUFF_DLL)))
    892 $(eval dll         := $(outbase)$(dllsuff))
    893 $(eval TARGET_$(target) := $(dll))
    894 
    895 # source -> object
    896 $(eval $(def_target_sources))
    897 
    898 # dllmod linking.
    899 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    900 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    901 $(eval objs         = $(_OBJS_$(target)))
    902 $(eval flags       :=\
    903         $(TOOL_$(tool)_LDFLAGS)\
    904         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TYPE))\
    905         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET))\
    906         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_ARCH))\
    907         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_CPU))\
    908         $(LDFLAGS)\
    909         $(LDFLAGS.$(BUILD_TYPE))\
    910         $(LDFLAGS.$(BUILD_TARGET))\
    911         $(LDFLAGS.$(BUILD_TARGET_ARCH))\
    912         $(LDFLAGS.$(BUILD_TARGET_CPU))\
    913         $($(target)_LDFLAGS)\
    914         $($(target)_LDFLAGS.$(BUILD_TYPE))\
    915         $($(target)_LDFLAGS.$(BUILD_TARGET))\
    916         $($(target)_LDFLAGS.$(BUILD_TARGET_ARCH))\
    917         $($(target)_LDFLAGS.$(BUILD_TARGET_CPU))\
    918 )
    919 $(eval libs        :=\
    920         $($(target)_LIBS.$(BUILD_TARGET_CPU))\
    921         $($(target)_LIBS.$(BUILD_TARGET_ARCH))\
    922         $($(target)_LIBS.$(BUILD_TARGET))\
    923         $($(target)_LIBS.$(BUILD_TYPE))\
    924         $($(target)_LIBS)\
    925         $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
    926                                    $($(target)_SDKS.$(BUILD_TYPE)) \
    927                                    $($(target)_SDKS),\
    928         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
    929         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
    930         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
    931         $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
    932         $(SDK_$(sdk)_LIBS))\
    933         $(LIBS.$(BUILD_TARGET_CPU))\
    934         $(LIBS.$(BUILD_TARGET_ARCH))\
    935         $(LIBS.$(BUILD_TARGET))\
    936         $(LIBS.$(BUILD_TYPE))\
    937         $(LIBS)\
    938         $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
    939                                    $(SDKS.$(BUILD_TYPE)) \
    940                                    $(SDKS),\
    941         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
    942         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
    943         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
    944         $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
    945         $(SDK_$(sdk)_LIBS))\
    946         $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_CPU))\
    947         $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_ARCH))\
    948         $(TOOL_$(tool)_LIBS.$(BUILD_TARGET))\
    949         $(TOOL_$(tool)_LIBS.$(BUILD_TYPE))\
    950         $(TOOL_$(tool)_LIBS)\
    951 )
    952 $(eval libpath    :=\
    953         $($(target)_LIBPATH.$(BUILD_TARGET_CPU))\
    954         $($(target)_LIBPATH.$(BUILD_TARGET_ARCH))\
    955         $($(target)_LIBPATH.$(BUILD_TARGET))\
    956         $($(target)_LIBPATH.$(BUILD_TYPE))\
    957         $($(target)_LIBPATH)\
    958         $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
    959                                    $($(target)_SDKS.$(BUILD_TYPE)) \
    960                                    $($(target)_SDKS),\
    961         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
    962         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
    963         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
    964         $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
    965         $(SDK_$(sdk)_LIBPATH))\
    966         $(LIBPATH.$(BUILD_TARGET_CPU))\
    967         $(LIBPATH.$(BUILD_TARGET_ARCH))\
    968         $(LIBPATH.$(BUILD_TARGET))\
    969         $(LIBPATH.$(BUILD_TYPE))\
    970         $(LIBPATH)\
    971         $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
    972                                    $(SDKS.$(BUILD_TYPE)) \
    973                                    $(SDKS),\
    974         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
    975         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
    976         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
    977         $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
    978         $(SDK_$(sdk)_LIBPATH))\
    979         $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_CPU))\
    980         $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_ARCH))\
    981         $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET))\
    982         $(TOOL_$(tool)_LIBPATH.$(BUILD_TYPE))\
    983         $(TOOL_$(tool)_LIBPATH)\
    984 )
    985 $(eval dirdep      := $(dir $(dll)).dir_created)
    986 ## @todo fix dependencies
    987 $(eval deps        := $($(target)_DEPS))
    988 #
    989 $(eval custom_pre    := $(strip $(firstword
    990         $($(target)_CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
    991         $($(target)_CUSTOM_PRE.$(BUILD_TARGET))\
    992         $($(target)_CUSTOM_PRE.$(BUILD_TYPE))\
    993         $($(target)_CUSTOM_PRE)\
    994         $(CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
    995         $(CUSTOM_PRE.$(BUILD_TARGET))\
    996         $(CUSTOM_PRE.$(BUILD_TYPE))\
    997         $(CUSTOM_PRE)\
    998 )))
    999 $(eval custom_post    := $(strip $(firstword
    1000         $($(target)_CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
    1001         $($(target)_CUSTOM_POST.$(BUILD_TARGET))\
    1002         $($(target)_CUSTOM_POST.$(BUILD_TYPE))\
    1003         $($(target)_CUSTOM_POST)\
    1004         $(CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
    1005         $(CUSTOM_POST.$(BUILD_TARGET))\
    1006         $(CUSTOM_POST.$(BUILD_TYPE))\
    1007         $(CUSTOM_POST)\
    1008 )))
    1009 $(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))))
    1010 
    1011 ifndef TOOL_$(tool)_LINK_DLL
    1012 $$(warning kBuild: TOOL_$(tool)_LINK_DLL is not defined. target=$(target) )
    1013 $$(warning kBuild: tools: \
    1014         1 $($(target)_$(source)TOOL.$(BUILD_TARGET)) \
    1015         2 $($(target)_$(source)TOOL) \
    1016         3 $($(target)_TOOL.$(BUILD_TARGET)) \
    1017         4 $($(target)_TOOL) \
    1018         5 $($(source)TOOL) \
    1019         6 $($(source)TOOL.$(BUILD_TARGET)) \
    1020         7 $(TOOL.$(BUILD_TARGET)) \
    1021         8 $(TOOL) )
    1022 endif
    1023 
    1024 $(eval $(TOOL_$(tool)_LINK_DLL))
    1025 
    1026 
    1027 # publish rule (still need work)
    1028 ifndef $(target)_NOINST
    1029 $(eval pubdll := $(PATH_BIN)/$(notdir $(dll)))
    1030 $(pubdll) : $(dll) $(dir $(pubdll)).dir_created
    1031         $(CP) $(dll) $(pubdll)
    1032 
    1033 $(eval TARGET_PUB_$(target) := $(pubdll))
    1034 _DLLS += $(pubdll)
    1035 _OUT_FILES += $(dll) $(pubdll)
    1036 else
    1037 _DLLS += $(dll)
    1038 _OUT_FILES += $(dll)
    1039 endif
    1040 _OBJS += $(_OBJS_$(target))
    1041 endef
    1042 
    1043 # Process dlls
    1044 $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)), $(eval $(def_dll)))
    1045 
    1046 
    1047 
    1048 #
    1049 # Process import libraries.
    1050 #
    1051 #   - On OS/2 and windows these are libraries.
    1052 #   - On other platforms they are fake DLLs.
    1053 ifeq ($(subst win32,os2,$(BUILD_TARGET)),os2)
    1054 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval $(def_lib)))
    1055 else
    1056 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval $(def_dll)))
    1057 endif
    1058 $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)), $(eval _IMPORT_LIBS += $(firstword $(TARGET_PUB_$(target)) $(TARGET_$(target)))))
    1059 
    1060    
    1061 
    1062 #
    1063 # PROGRAMS
    1064 #
    1065 
    1066 ## Program (one).
    1067 # @param    $(target)   Normalized target (program) name.
    1068 define def_program
    1069 # basics
    1070 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    1071 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    1072 $(eval PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))))
    1073 $(eval exesuff     := $(firstword $($(target)_EXESUFF) $($(target)_EXESUFF) $(TOOL_$(tool)_LDEXESUFF) $(SUFF_EXE)))
    1074 $(eval exe         := $(outbase)$(exesuff))
    1075 $(eval TARGET_$(target) := $(exe))
    1076 
    1077 # source -> object
    1078 $(eval $(def_target_sources))
    1079 
    1080 # more library stuff.
    1081 $(eval tool        := $(call _TARGET_TOOL,$(target),LD))
    1082 $(eval outbase     := $(call _TARGET_BASE,$(target),$(target)))
    1083 $(eval objs         = $(_OBJS_$(target)))
    1084 $(eval flags       :=\
    1085         $(TOOL_$(tool)_LDFLAGS)\
    1086         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TYPE))\
    1087         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET))\
    1088         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_ARCH))\
    1089         $(TOOL_$(tool)_LDFLAGS.$(BUILD_TARGET_CPU))\
    1090         $(LDFLAGS)\
    1091         $(LDFLAGS.$(BUILD_TYPE))\
    1092         $(LDFLAGS.$(BUILD_TARGET))\
    1093         $(LDFLAGS.$(BUILD_TARGET_ARCH))\
    1094         $(LDFLAGS.$(BUILD_TARGET_CPU))\
    1095         $($(target)_LDFLAGS)\
    1096         $($(target)_LDFLAGS.$(BUILD_TYPE))\
    1097         $($(target)_LDFLAGS.$(BUILD_TARGET))\
    1098         $($(target)_LDFLAGS.$(BUILD_TARGET_ARCH))\
    1099         $($(target)_LDFLAGS.$(BUILD_TARGET_CPU))\
    1100 )
    1101 $(eval libs        :=\
    1102         $($(target)_LIBS.$(BUILD_TARGET_CPU))\
    1103         $($(target)_LIBS.$(BUILD_TARGET_ARCH))\
    1104         $($(target)_LIBS.$(BUILD_TARGET))\
    1105         $($(target)_LIBS.$(BUILD_TYPE))\
    1106         $($(target)_LIBS)\
    1107         $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
    1108                                    $($(target)_SDKS.$(BUILD_TYPE)) \
    1109                                    $($(target)_SDKS),\
    1110         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
    1111         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
    1112         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
    1113         $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
    1114         $(SDK_$(sdk)_LIBS))\
    1115         $(LIBS.$(BUILD_TARGET_CPU))\
    1116         $(LIBS.$(BUILD_TARGET_ARCH))\
    1117         $(LIBS.$(BUILD_TARGET))\
    1118         $(LIBS.$(BUILD_TYPE))\
    1119         $(LIBS)\
    1120         $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
    1121                                    $(SDKS.$(BUILD_TYPE)) \
    1122                                    $(SDKS),\
    1123         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
    1124         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
    1125         $(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
    1126         $(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
    1127         $(SDK_$(sdk)_LIBS))\
    1128         $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_CPU))\
    1129         $(TOOL_$(tool)_LIBS.$(BUILD_TARGET_ARCH))\
    1130         $(TOOL_$(tool)_LIBS.$(BUILD_TARGET))\
    1131         $(TOOL_$(tool)_LIBS.$(BUILD_TYPE))\
    1132         $(TOOL_$(tool)_LIBS)\
    1133 )
    1134 $(eval libpath    :=\
    1135         $($(target)_LIBPATH.$(BUILD_TARGET_CPU))\
    1136         $($(target)_LIBPATH.$(BUILD_TARGET_ARCH))\
    1137         $($(target)_LIBPATH.$(BUILD_TARGET))\
    1138         $($(target)_LIBPATH.$(BUILD_TYPE))\
    1139         $($(target)_LIBPATH)\
    1140         $(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
    1141                                    $($(target)_SDKS.$(BUILD_TYPE)) \
    1142                                    $($(target)_SDKS),\
    1143         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
    1144         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
    1145         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
    1146         $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
    1147         $(SDK_$(sdk)_LIBPATH))\
    1148         $(LIBPATH.$(BUILD_TARGET_CPU))\
    1149         $(LIBPATH.$(BUILD_TARGET_ARCH))\
    1150         $(LIBPATH.$(BUILD_TARGET))\
    1151         $(LIBPATH.$(BUILD_TYPE))\
    1152         $(LIBPATH)\
    1153         $(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
    1154                                    $(SDKS.$(BUILD_TYPE)) \
    1155                                    $(SDKS),\
    1156         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
    1157         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
    1158         $(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
    1159         $(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
    1160         $(SDK_$(sdk)_LIBPATH))\
    1161         $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_CPU))\
    1162         $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_ARCH))\
    1163         $(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET))\
    1164         $(TOOL_$(tool)_LIBPATH.$(BUILD_TYPE))\
    1165         $(TOOL_$(tool)_LIBPATH)\
    1166 )
    1167 $(eval dirdep      := $(dir $(exe)).dir_created)
    1168 ## @todo fix dependencies
    1169 $(eval deps        := $($(target)_DEPS))
    1170 #
    1171 $(eval custom_pre    := $(strip $(firstword
    1172         $($(target)_CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
    1173         $($(target)_CUSTOM_PRE.$(BUILD_TARGET))\
    1174         $($(target)_CUSTOM_PRE.$(BUILD_TYPE))\
    1175         $($(target)_CUSTOM_PRE)\
    1176         $(CUSTOM_PRE.$(BUILD_TARGET).$(BUILD_TYPE))\
    1177         $(CUSTOM_PRE.$(BUILD_TARGET))\
    1178         $(CUSTOM_PRE.$(BUILD_TYPE))\
    1179         $(CUSTOM_PRE)\
    1180 )))
    1181 $(eval custom_post    := $(strip $(firstword
    1182         $($(target)_CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
    1183         $($(target)_CUSTOM_POST.$(BUILD_TARGET))\
    1184         $($(target)_CUSTOM_POST.$(BUILD_TYPE))\
    1185         $($(target)_CUSTOM_POST)\
    1186         $(CUSTOM_POST.$(BUILD_TARGET).$(BUILD_TYPE))\
    1187         $(CUSTOM_POST.$(BUILD_TARGET))\
    1188         $(CUSTOM_POST.$(BUILD_TYPE))\
    1189         $(CUSTOM_POST)\
    1190 )))
    1191 $(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))))
     1199$(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE))))
    11921200
    11931201$(eval $(TOOL_$(tool)_LINK_PROGRAM))
     
    13411349        $(CUSTOM_POST)\
    13421350)))
    1343 $(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))))
     1351$(eval othersrc    := $(filter-out %.c %.cpp %.cxx %.cc %.s %.S %.asm,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TYPE))))
    13441352
    13451353ifndef TOOL_$(tool)_LINK_SYSMOD
     
    14651473.NOTPARALLEL: pass_$(pass)_before pass_$(pass)_after
    14661474.PHONY: pass_$(pass) pass_$(pass)_before pass_$(pass)_doit pass_$(pass)_after
    1467 pass_$(pass)_doit:      pass_$(pass)_before
    1468 pass_$(pass)_after::    pass_$(pass)_doit
     1475pass_$(pass)_this:      pass_$(pass)_before
     1476        + $(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)_doit
     1477pass_$(pass)_after::    pass_$(pass)_this
    14691478pass_$(pass):           pass_$(pass)_after
    14701479
Note: See TracChangeset for help on using the changeset viewer.