summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk')
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk121
1 files changed, 121 insertions, 0 deletions
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk
new file mode 100644
index 0000000..82da9d6
--- /dev/null
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/_objects.mk
@@ -0,0 +1,121 @@
1########################################################################### ###
2#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
3#@License Dual MIT/GPLv2
4#
5# The contents of this file are subject to the MIT license as set out below.
6#
7# Permission is hereby granted, free of charge, to any person obtaining a copy
8# of this software and associated documentation files (the "Software"), to deal
9# in the Software without restriction, including without limitation the rights
10# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11# copies of the Software, and to permit persons to whom the Software is
12# furnished to do so, subject to the following conditions:
13#
14# The above copyright notice and this permission notice shall be included in
15# all copies or substantial portions of the Software.
16#
17# Alternatively, the contents of this file may be used under the terms of
18# the GNU General Public License Version 2 ("GPL") in which case the provisions
19# of GPL are applicable instead of those above.
20#
21# If you wish to allow use of your version of this file only under the terms of
22# GPL, and not to allow others to use your version of this file under the terms
23# of the MIT license, indicate your decision by deleting the provisions above
24# and replace them with the notice and other provisions required by GPL as set
25# out in the file called "GPL-COPYING" included in this distribution. If you do
26# not delete the provisions above, a recipient may use your version of this file
27# under the terms of either the MIT license or GPL.
28#
29# This License is also included in this distribution in the file called
30# "MIT-COPYING".
31#
32# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
33# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
34# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
35# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
36# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
37# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39#@Description Common processing for all modules that compile code.
40### ###########################################################################
41
42# Filter for source types
43MODULE_C_SOURCES := $(filter %.c,$(MODULE_SOURCES))
44MODULE_CXX_SOURCES := $(filter %.cpp,$(MODULE_SOURCES))
45
46MODULE_UNRECOGNISED_SOURCES := $(filter-out %.c %.cpp, $(MODULE_SOURCES))
47
48ifneq ($(strip $(MODULE_UNRECOGNISED_SOURCES)),)
49$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) specified source files with unrecognised suffixes: $(MODULE_UNRECOGNISED_SOURCES))
50endif
51
52# Objects built from MODULE_SOURCES
53# Objects built from MODULE_C_SOURCES and MODULE_CXX_SOURCES
54MODULE_C_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(foreach _cobj,$(MODULE_C_SOURCES:.c=.o),$(notdir $(_cobj))))
55MODULE_CXX_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(foreach _cxxobj,$(MODULE_CXX_SOURCES:.cpp=.o),$(notdir $(_cxxobj))))
56
57# MODULE_GENERATED_DEPENDENCIES are generated as a side effect of running the
58# rules below, but if we wanted to generate .d files for things that GCC
59# couldn't handle, we could add a rule with $(MODULE_GENERATED_DEPENDENCIES)
60# as a target
61MODULE_GENERATED_DEPENDENCIES := $(MODULE_C_OBJECTS:.o=.d) $(MODULE_CXX_OBJECTS:.o=.d)
62-include $(MODULE_GENERATED_DEPENDENCIES)
63
64MODULE_DEPENDS := $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_depends))
65MODULE_DEPENDS += $(addprefix $(GENERATED_CODE_OUT)/,$($(THIS_MODULE)_genheaders))
66
67# Add any MODULE_OUT relative include flags here
68MODULE_INCLUDE_FLAGS += $(addprefix -I $(MODULE_OUT)/, $($(THIS_MODULE)_includes_relative))
69
70define rule-for-objects-o-from-one-c
71$(1): MODULE_CC := $$(MODULE_CC)
72$(1): MODULE_CFLAGS := $$(MODULE_CFLAGS)
73$(1): MODULE_HOST_CFLAGS := $$(MODULE_HOST_CFLAGS)
74$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS)
75$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS)
76$(1): THIS_MODULE := $$(THIS_MODULE)
77ifneq ($(PKG_CONFIG_ENV_VAR),)
78$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT))
79$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/pkgconfig)
80endif
81$(1): export PKG_CONFIG_SYSROOT_DIR := $(PKG_CONFIG_SYSROOT_DIR)
82$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE)
83$(1): | $$(MODULE_INTERMEDIATES_DIR)
84$(1): $(2)
85 @: $(if $(MODULE_CHECK_CFLAGS),
86 $(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags)),\
87 $(error $(THIS_MODULE): LTO-incompatible cflag(s) used: \
88 $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags)))))
89 $$(check-src)
90ifeq ($(MODULE_HOST_BUILD),true)
91 $$(host-o-from-one-c)
92else
93 $$(target-o-from-one-c)
94endif
95endef
96
97# This rule is used to compile C++ source files
98define rule-for-objects-o-from-one-cxx
99$(1): MODULE_CXX := $$(MODULE_CXX)
100$(1): MODULE_CXXFLAGS := $$(MODULE_CXXFLAGS)
101$(1): MODULE_HOST_CXXFLAGS := $$(MODULE_HOST_CXXFLAGS)
102$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS)
103$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS)
104$(1): THIS_MODULE := $$(THIS_MODULE)
105ifneq ($(PKG_CONFIG_ENV_VAR),)
106$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT))
107$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/pkgconfig)
108endif
109$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE)
110$(1): | $$(MODULE_INTERMEDIATES_DIR)
111$(1): $(2)
112 @: $(if $(MODULE_CHECK_CFLAGS),
113 $(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags)),\
114 $(error $(THIS_MODULE): LTO-incompatible cxxflag(s) used: \
115 $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags)))))
116ifeq ($(MODULE_HOST_BUILD),true)
117 $$(host-o-from-one-cxx)
118else
119 $$(target-o-from-one-cxx)
120endif
121endef