summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2018-01-04 14:32:19 -0600
committerRaptor Engineering Development Team <support@raptorengineering.com>2019-04-26 08:01:45 +0000
commit1914f662204d342f88ae37dced34bbe46ab64e7d (patch)
tree4b08e06e2cb44a2eecf05c3b0082f53e565ba005
parentbe6c99a982d34be4db602977d48543d72fd532d1 (diff)
downloadtalos-hcode-1914f662204d342f88ae37dced34bbe46ab64e7d.zip
talos-hcode-1914f662204d342f88ae37dced34bbe46ab64e7d.tar.gz
Allow split of HOST and TARGET toolchain binary names
-rw-r--r--tools/build/common.dir/exe.rules.mk6
-rw-r--r--tools/build/common.dir/modules.rules.mk6
-rw-r--r--tools/build/rules.dir/cc.rules.mk15
-rw-r--r--tools/build/rules.dir/mflags.env.mk10
4 files changed, 24 insertions, 13 deletions
diff --git a/tools/build/common.dir/exe.rules.mk b/tools/build/common.dir/exe.rules.mk
index e187062..3d1a02d 100644
--- a/tools/build/common.dir/exe.rules.mk
+++ b/tools/build/common.dir/exe.rules.mk
@@ -81,10 +81,10 @@ $(EXEPATH)/$(EXE).exe: LOCALLDFLAGS += $$($(EXE)_LDFLAGS)
$(EXEPATH)/$(EXE).exe: $$($(EXE)_PATH)/lib$(EXE).a \
$$(foreach lib,$$($(EXE)_DEPLIBS),$$($(EXE)_LIBPATH)/lib$$(lib).a) \
$$($(EXE)_EXTRALIBS) $$($(EXE)_DEPS) | $$($(EXE)_DEPSORDER)
-$(call __CALL_LD,$$(or $$($(EXE)_TARGET),TARGET))
+$(call __CALL_LD,$$(or $$($(EXE)_HOST),HOST))
$$($(EXE)_PATH)/lib$(EXE).a: $$($(EXE)_OBJS)
-$(call __CALL_AR,$$(or $$($(EXE)_TARGET),TARGET))
+$(call __CALL_AR,$$(or $$($(EXE)_HOST),HOST))
$(call __CLEAN_TARGET,$(EXEPATH)/$(EXE).exe)
$(call __CLEAN_TARGET,$$($(EXE)_PATH)/lib$(EXE).a)
@@ -128,7 +128,7 @@ __ADD_EXE_SRCDIR = \
# * Generate all the possible .C->.o, .c->.o, etc. pattern recipes.
define ___ADD_EXE_SRCDIR
$(call __ADD_EXE_INCDIR,$(1),$(2))
-$(call __GENERATE_OBJECTRULES,$(OBJPATH)/$(1),$(2),$$(or $$($(1)_TARGET),TARGET))
+$(call __GENERATE_OBJECTRULES,$(OBJPATH)/$(1),$(2),$$(or $$($(1)_HOST),HOST))
endef
# ADD_EXE_INCDIR
diff --git a/tools/build/common.dir/modules.rules.mk b/tools/build/common.dir/modules.rules.mk
index ed6bb7f..eab8f13 100644
--- a/tools/build/common.dir/modules.rules.mk
+++ b/tools/build/common.dir/modules.rules.mk
@@ -87,7 +87,7 @@ $$(lib$(MODULE)_LIBPATH)/lib$(MODULE).so: LOCALLDFLAGS += $$(lib$(MODULE)_LDFLAG
$$(lib$(MODULE)_LIBPATH)/lib$(MODULE).so: $$(lib$(MODULE)_LIBPATH)/lib$(MODULE).a \
$$(foreach lib,$$(lib$(MODULE)_DEPLIBS),$$$$(lib$(MODULE)_LIBPATH)/lib$$(lib).a ) \
$$(lib$(MODULE)_EXTRALIBS) | $$(lib$(MODULE)_DEPSORDER)
-$(call __CALL_LDSO,$$(or $$(lib$(MODULE)_TARGET),TARGET))
+$(call __CALL_LDSO,$$(or $$(lib$(MODULE)_HOST),HOST))
$$(lib$(MODULE)_LIBPATH)/lib$(MODULE).a: LOCALCOMMONFLAGS += $$(lib$(MODULE)_COMMONFLAGS)
$$(lib$(MODULE)_LIBPATH)/lib$(MODULE).a: LOCALCFLAGS += $$(lib$(MODULE)_CFLAGS)
@@ -96,7 +96,7 @@ $$(lib$(MODULE)_LIBPATH)/lib$(MODULE).a: LOCALLDFLAGS += $$(lib$(MODULE)_LDFLAGS
$$(lib$(MODULE)_LIBPATH)/lib$(MODULE).a: $$(lib$(MODULE)_OBJS)
-$(call __CALL_AR,$$(or $$(lib$(MODULE)_TARGET),TARGET))
+$(call __CALL_AR,$$(or $$(lib$(MODULE)_HOST),HOST))
$(call __CLEAN_TARGET,$$(lib$(MODULE)_LIBPATH)/lib$(MODULE).so)
$(call __CLEAN_TARGET,$$(lib$(MODULE)_LIBPATH)/lib$(MODULE).a)
@@ -141,7 +141,7 @@ __ADD_MODULE_SRCDIR = \
# * Generate all the possible .C->.o, .c->.o, etc. pattern recipes.
define ___ADD_MODULE_SRCDIR
$(call __ADD_MODULE_INCDIR,$(1),$(2))
-$(call __GENERATE_OBJECTRULES,$(OBJPATH)/$(1),$(2),$$(or $$(lib$(1)_TARGET),TARGET))
+$(call __GENERATE_OBJECTRULES,$(OBJPATH)/$(1),$(2),$$(or $$(lib$(1)_HOST),HOST))
endef
# ADD_MODULE_INCDIR
diff --git a/tools/build/rules.dir/cc.rules.mk b/tools/build/rules.dir/cc.rules.mk
index 2f37353..4b5f3b4 100644
--- a/tools/build/rules.dir/cc.rules.mk
+++ b/tools/build/rules.dir/cc.rules.mk
@@ -41,7 +41,7 @@ else
$(C2) " C++$(1) $$(@F)"
endif
$(C1) mkdir -p $$(@D)
- $(C1) $$($(1)_PREFIX)$$(CXX) $$(COMMONFLAGS) $$(CXXFLAGS) \
+ $(C1) $$($(1)_PREFIX)$$($(1)_CXX) $$(COMMONFLAGS) $$(CXXFLAGS) \
$$(LOCALCOMMONFLAGS) $$(LOCALCXXFLAGS) \
$$< -c -o $$@
endef
@@ -53,7 +53,7 @@ else
$(C2) " CC$(1) $$(@F)"
endif
$(C1) mkdir -p $$(@D)
- $(C1) $$($(1)_PREFIX)$$(CC) $$(COMMONFLAGS) $$(CFLAGS) \
+ $(C1) $$($(1)_PREFIX)$$($(1)_CC) $$(COMMONFLAGS) $$(CFLAGS) \
$$(LOCALCOMMONFLAGS) $$(LOCALCFLAGS) \
$$< -c -o $$@
endef
@@ -65,7 +65,7 @@ else
$(C2) " LDSO$(1) $$(@F)"
endif
$(C1) mkdir -p $$(@D)
- $(C1) $$($(1)_PREFIX)$$(CXX) $$(LDFLAGS) \
+ $(C1) $$($(1)_PREFIX)$$($(1)_CXX) $$(LDFLAGS) \
-shared $$(addprefix -L,$(FAPI2_PLAT_LIB)) $$(LOCALLDFLAGS) \
$$(patsubst lib%.so,-l%, $$(notdir $$(filter %.so, $$^))) \
-Wl,--whole-archive \
@@ -83,7 +83,7 @@ else
$(C2) " LD$(1) $$(@F)"
endif
$(C1) mkdir -p $$(@D)
- $(C1) $$($(1)_PREFIX)$$(CXX) $$(LDFLAGS) \
+ $(C1) $$($(1)_PREFIX)$$($(1)_CXX) $$(LDFLAGS) \
$$(addprefix -L,$(FAPI2_PLAT_LIB)) $$(LOCALLDFLAGS) \
$$(patsubst lib%.so,-l%, $$(notdir $$(filter %.so, $$^))) \
-Wl,--whole-archive \
@@ -100,7 +100,8 @@ else
$(C2) " AR$(1) $$(@F)"
endif
$(C1) mkdir -p $$(@D)
- $(C1) $$($(1)_PREFIX)$$(AR) rcs $$@ $$^
+ $(C1) rm -f $$@
+ $(C1) $$($(1)_PREFIX)$$($(1)_AR) rcs $$@ $$^
endef
define __CALL_CXX_DEP
@@ -110,7 +111,7 @@ else
$(C2) " DEP$(1) $$(@F:.o=.dep)"
endif
$(C1) mkdir -p $$(@D)
- $(C1) $$($(1)_PREFIX)$$(CXX) -M -MP -MT $$@ \
+ $(C1) $$($(1)_PREFIX)$$($(1)_CXX) -M -MP -MT $$@ \
$$(COMMONFLAGS) $$(CXXFLAGS) \
$$(LOCALCOMMONFLAGS) $$(LOCALCXXFLAGS) \
$$< -o $$(subst .o,.dep,$$@)
@@ -123,7 +124,7 @@ else
$(C2) " DEP$(1) $$(@F:.o=.dep)"
endif
$(C1) mkdir -p $$(@D)
- $(C1) $$($(1)_PREFIX)$$(CC) -M -MP -MT $$@ \
+ $(C1) $$($(1)_PREFIX)$$($(1)_CC) -M -MP -MT $$@ \
$$(COMMONFLAGS) $$(CFLAGS) \
$$(LOCALCOMMONFLAGS) $$(LOCALCFLAGS) \
$$< -o $$(subst .o,.dep,$$@)
diff --git a/tools/build/rules.dir/mflags.env.mk b/tools/build/rules.dir/mflags.env.mk
index 77aaad6..5a1a222 100644
--- a/tools/build/rules.dir/mflags.env.mk
+++ b/tools/build/rules.dir/mflags.env.mk
@@ -56,3 +56,13 @@ CC?=gcc
CXX?=g++
AR?=ar
LD?=ld
+
+HOST_CC?=$(CC)
+HOST_CXX?=$(CXX)
+HOST_AR?=$(AR)
+HOST_LD?=$(LD)
+
+TARGET_CC?=$(CC)
+TARGET_CXX?=$(CXX)
+TARGET_AR?=$(AR)
+TARGET_LD?=$(LD)
OpenPOWER on IntegriCloud