git / moonbite-core / depends/hosts/default.mk · raw

ifneq ($(host),$(build))host_toolchain:=$(host)-endifdefault_host_CC = $(host_toolchain)gccdefault_host_CXX = $(host_toolchain)g++default_host_AR = $(host_toolchain)ardefault_host_RANLIB = $(host_toolchain)ranlibdefault_host_STRIP = $(host_toolchain)stripdefault_host_LIBTOOL = $(host_toolchain)libtooldefault_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tooldefault_host_OTOOL = $(host_toolchain)otooldefault_host_NM = $(host_toolchain)nmdefine add_host_tool_funcifneq ($(filter $(origin $1),undefined default),)# Do not consider the well-known var $1 if it is undefined or is taking a value# that is predefined by "make" (e.g. the make variable "CC" has a predefined# value of "cc")$(host_os)_$1?=$$(default_host_$1)$(host_arch)_$(host_os)_$1?=$$($(host_os)_$1)$(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1)else$(host_os)_$1=$(or $($1),$($(host_os)_$1),$(default_host_$1))$(host_arch)_$(host_os)_$1=$(or $($1),$($(host_arch)_$(host_os)_$1),$$($(host_os)_$1))$(host_arch)_$(host_os)_$(release_type)_$1=$(or $($1),$($(host_arch)_$(host_os)_$(release_type)_$1),$$($(host_os)_$1))endifhost_$1=$$($(host_arch)_$(host_os)_$1)endefdefine add_host_flags_func$(host_arch)_$(host_os)_$1 += $($(host_os)_$1)$(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1)host_$1 = $$($(host_arch)_$(host_os)_$1)host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)endef$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool))))$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))