diff options
Diffstat (limited to 'jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk')
-rw-r--r-- | jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk | 125 |
1 files changed, 102 insertions, 23 deletions
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk index 81ecb9e..ac84bb8 100644 --- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk | |||
@@ -58,14 +58,11 @@ $(call directory-must-exist,$(TOP)) | |||
58 | 58 | ||
59 | # RELATIVE_OUT is relative only if it's under $(TOP) | 59 | # RELATIVE_OUT is relative only if it's under $(TOP) |
60 | RELATIVE_OUT := $(patsubst $(TOP)/%,%,$(OUT)) | 60 | RELATIVE_OUT := $(patsubst $(TOP)/%,%,$(OUT)) |
61 | HOST_OUT := $(RELATIVE_OUT)/host | 61 | CONFIG_MK := $(RELATIVE_OUT)/config.mk |
62 | TARGET_OUT := $(RELATIVE_OUT)/target | 62 | CONFIG_H := $(RELATIVE_OUT)/config.h |
63 | DOCS_OUT := $(RELATIVE_OUT)/docs | ||
64 | CONFIG_MK := $(RELATIVE_OUT)/config.mk | ||
65 | CONFIG_H := $(RELATIVE_OUT)/config.h | ||
66 | CONFIG_KERNEL_MK := $(RELATIVE_OUT)/config_kernel.mk | 63 | CONFIG_KERNEL_MK := $(RELATIVE_OUT)/config_kernel.mk |
67 | CONFIG_KERNEL_H := $(RELATIVE_OUT)/config_kernel.h | 64 | CONFIG_KERNEL_H := $(RELATIVE_OUT)/config_kernel.h |
68 | MAKE_TOP := eurasiacon/build/linux2 | 65 | MAKE_TOP := eurasiacon/build/linux2 |
69 | THIS_MAKEFILE := (top-level makefiles) | 66 | THIS_MAKEFILE := (top-level makefiles) |
70 | 67 | ||
71 | # Convert commas to spaces in $(D). This is so you can say "make | 68 | # Convert commas to spaces in $(D). This is so you can say "make |
@@ -83,11 +80,6 @@ ifneq ($(INTERNAL_CLOBBER_ONLY),true) | |||
83 | # | 80 | # |
84 | $(shell mkdir -p $(OUT)) | 81 | $(shell mkdir -p $(OUT)) |
85 | 82 | ||
86 | # Provide rules to create the directories for binaries and documentation | ||
87 | .SECONDARY: $(HOST_OUT) $(TARGET_OUT) $(DOCS_OUT) | ||
88 | $(HOST_OUT) $(TARGET_OUT) $(DOCS_OUT): | ||
89 | $(make-directory) | ||
90 | |||
91 | # If these generated files differ from any pre-existing ones, | 83 | # If these generated files differ from any pre-existing ones, |
92 | # replace them, causing affected parts of the driver to rebuild. | 84 | # replace them, causing affected parts of the driver to rebuild. |
93 | # | 85 | # |
@@ -143,16 +135,73 @@ REMAINING_MAKEFILES := $(ALL_MAKEFILES) | |||
143 | ALL_MODULES := | 135 | ALL_MODULES := |
144 | INTERNAL_INCLUDED_ALL_MAKEFILES := | 136 | INTERNAL_INCLUDED_ALL_MAKEFILES := |
145 | 137 | ||
146 | ifneq ($(INTERNAL_CLOBBER_ONLY),true) | ||
147 | # Please do not change the format of the following lines | 138 | # Please do not change the format of the following lines |
148 | -include $(CONFIG_KERNEL_MK) | 139 | -include $(CONFIG_KERNEL_MK) |
140 | |||
141 | # If we haven't set host/target archs, set some sensible defaults now. | ||
142 | # This allows things like prune.sh to work | ||
143 | ifeq ($(HOST_PRIMARY_ARCH),) | ||
144 | ifneq ($(FORCE_ARCH),) | ||
145 | HOST_PRIMARY_ARCH := host_i386 | ||
146 | HOST_32BIT_ARCH := host_i386 | ||
147 | endif | ||
148 | endif | ||
149 | |||
150 | # Output directory for configuration, object code, | ||
151 | # final programs/libraries, and install/rc scripts. | ||
152 | HOST_OUT := $(RELATIVE_OUT)/$(HOST_PRIMARY_ARCH) | ||
153 | HOST_32BIT_OUT := $(RELATIVE_OUT)/$(HOST_32BIT_ARCH) | ||
154 | TARGET_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH) | ||
155 | TARGET_PRIMARY_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH) | ||
156 | TARGET_NEUTRAL_OUT := $(RELATIVE_OUT)/target_neutral | ||
157 | GENERATED_CODE_OUT := $(TARGET_NEUTRAL_OUT)/intermediates | ||
158 | DOCS_OUT := $(RELATIVE_OUT)/doc | ||
159 | |||
160 | # Make directories that won't otherwise be made. | ||
161 | # (This is for the install scripts and other things that aren't made by | ||
162 | # normal module rules.) | ||
163 | TARGET_OUT_DIRECTORIES := $(addprefix $(RELATIVE_OUT)/,$(TARGET_ALL_ARCH)) $(TARGET_NEUTRAL_OUT) $(DOCS_OUT) | ||
164 | .SECONDARY: $(TARGET_OUT_DIRECTORIES) | ||
165 | $(TARGET_OUT_DIRECTORIES): | ||
166 | $(make-directory) | ||
167 | |||
168 | ifneq ($(INTERNAL_CLOBBER_ONLY),true) | ||
149 | # These files may not exist in GPL km source packages | 169 | # These files may not exist in GPL km source packages |
150 | -include $(MAKE_TOP)/xorgconf.mk | ||
151 | -include $(MAKE_TOP)/llvm.mk | 170 | -include $(MAKE_TOP)/llvm.mk |
152 | endif | 171 | endif |
153 | 172 | ||
154 | include $(MAKE_TOP)/commands.mk | 173 | include $(MAKE_TOP)/commands.mk |
174 | |||
175 | # We don't need to include this if we're just doing a clean or a clobber | ||
176 | # | ||
177 | ifneq ($(INTERNAL_CLOBBER_ONLY),true) | ||
155 | include $(MAKE_TOP)/buildvars.mk | 178 | include $(MAKE_TOP)/buildvars.mk |
179 | endif | ||
180 | |||
181 | include $(MAKE_TOP)/pvrversion.mk | ||
182 | |||
183 | ifeq ($(INTERNAL_CLOBBER_ONLY)$(SUPPORT_ANDROID_PLATFORM),) | ||
184 | # doing a Linux build. We need to worry about sysroots. | ||
185 | |||
186 | ifneq ($(SUPPORT_BUILD_LWS),) | ||
187 | -include $(MAKE_TOP)/xorgconf.mk | ||
188 | |||
189 | else ifneq ($(SYSROOT),) | ||
190 | LWS_PREFIX ?= /usr | ||
191 | |||
192 | ALL_CFLAGS += --sysroot=${SYSROOT} | ||
193 | ALL_CXXFLAGS += --sysroot=${SYSROOT} | ||
194 | ALL_LDFLAGS += --sysroot=${SYSROOT} | ||
195 | |||
196 | PKG_CONFIG_SYSROOT_DIR := ${SYSROOT} | ||
197 | |||
198 | ifneq ($(SYSROOT),/) | ||
199 | # Override PKG_CONFIG_PATH to prevent additional host paths from being | ||
200 | # searched | ||
201 | PKG_CONFIG_PATH := | ||
202 | endif | ||
203 | endif | ||
204 | endif | ||
156 | 205 | ||
157 | HOST_INTERMEDIATES := $(HOST_OUT)/intermediates | 206 | HOST_INTERMEDIATES := $(HOST_OUT)/intermediates |
158 | TARGET_INTERMEDIATES := $(TARGET_OUT)/intermediates | 207 | TARGET_INTERMEDIATES := $(TARGET_OUT)/intermediates |
@@ -167,6 +216,15 @@ else | |||
167 | $(error Impossible: $(words $(REMAINING_MAKEFILES)) makefiles were mysteriously ignored when reading $$(ALL_MAKEFILES)) | 216 | $(error Impossible: $(words $(REMAINING_MAKEFILES)) makefiles were mysteriously ignored when reading $$(ALL_MAKEFILES)) |
168 | endif | 217 | endif |
169 | 218 | ||
219 | # Compute the isystem paths passed in via SYS_INCLUDES. We'll use this in | ||
220 | # the module target_xxx makefiles to filter duplicate -isystem and -I flags, | ||
221 | # to ensure the module can always override the include precedence. (Also | ||
222 | # calculate any 'residual' non-include flags, as we need to put them back.) | ||
223 | SYS_INCLUDES_ISYSTEM := \ | ||
224 | $(subst -isystem,,$(filter -isystem%,$(subst -isystem ,-isystem,$(SYS_INCLUDES)))) | ||
225 | SYS_INCLUDES_RESIDUAL := \ | ||
226 | $(strip $(filter-out -isystem%,$(subst -isystem ,-isystem,$(SYS_INCLUDES)))) | ||
227 | |||
170 | # At this point, all Linux.mks have been included. Now generate rules to build | 228 | # At this point, all Linux.mks have been included. Now generate rules to build |
171 | # each module: for each module in $(ALL_MODULES), set per-makefile variables | 229 | # each module: for each module in $(ALL_MODULES), set per-makefile variables |
172 | $(foreach _m,$(ALL_MODULES),$(eval $(call process-module,$(_m)))) | 230 | $(foreach _m,$(ALL_MODULES),$(eval $(call process-module,$(_m)))) |
@@ -177,27 +235,47 @@ kbuild install: | |||
177 | ifneq ($(INTERNAL_CLOBBER_ONLY),true) | 235 | ifneq ($(INTERNAL_CLOBBER_ONLY),true) |
178 | -include $(MAKE_TOP)/scripts.mk | 236 | -include $(MAKE_TOP)/scripts.mk |
179 | -include $(MAKE_TOP)/kbuild/kbuild.mk | 237 | -include $(MAKE_TOP)/kbuild/kbuild.mk |
180 | else | 238 | endif |
181 | # We won't depend on 'build' here so that people can build subsets of | 239 | # We won't depend on 'build' here so that people can build subsets of |
182 | # components and still have the install script attempt to install the | 240 | # components and still have the install script attempt to install the |
183 | # subset. | 241 | # subset. |
184 | install: | 242 | install: |
185 | @if [ ! -d "$(DISCIMAGE)" ]; then \ | 243 | @if [ ! -d "$(DISCIMAGE)" -a -z "$(INSTALL_TARGET)" ]; then \ |
186 | echo; \ | 244 | echo; \ |
187 | echo "** DISCIMAGE was not set or does not point to a valid directory."; \ | 245 | echo "** DISCIMAGE was not set or does not point to a valid directory."; \ |
246 | echo "** Either use INSTALL_TARGET or set DISCIMAGE."; \ | ||
188 | echo "** Cannot continue with install."; \ | 247 | echo "** Cannot continue with install."; \ |
189 | echo; \ | 248 | echo; \ |
190 | exit 1; \ | 249 | exit 1; \ |
191 | fi | 250 | fi |
192 | @if [ ! -f $(TARGET_OUT)/install.sh ]; then \ | 251 | @if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \ |
193 | echo; \ | 252 | echo; \ |
194 | echo "** install.sh not found in $(TARGET_OUT)."; \ | 253 | echo "** install.sh not found in $(TARGET_OUT)."; \ |
195 | echo "** Cannot continue with install."; \ | 254 | echo "** Cannot continue with install."; \ |
196 | echo; \ | 255 | echo; \ |
197 | exit 1; \ | 256 | exit 1; \ |
198 | fi | 257 | fi |
199 | @cd $(TARGET_OUT) && ./install.sh | 258 | @cd $(RELATIVE_OUT) && ./install.sh |
200 | endif | 259 | |
260 | .PHONY: uninstall | ||
261 | uninstall: install_script | ||
262 | uninstall: | ||
263 | @if [ ! -d "$(DISCIMAGE)" -a -z "$(INSTALL_TARGET)" ]; then \ | ||
264 | echo; \ | ||
265 | echo "** DISCIMAGE was not set or does not point to a valid directory."; \ | ||
266 | echo "** Either use INSTALL_TARGET or set DISCIMAGE."; \ | ||
267 | echo "** Cannot continue with uninstall."; \ | ||
268 | echo; \ | ||
269 | exit 1; \ | ||
270 | fi | ||
271 | @if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \ | ||
272 | echo; \ | ||
273 | echo "** install.sh not found in $(TARGET_OUT)."; \ | ||
274 | echo "** Cannot continue with uninstall."; \ | ||
275 | echo; \ | ||
276 | exit 1; \ | ||
277 | fi | ||
278 | @cd $(RELATIVE_OUT) && ./install.sh -u | ||
201 | 279 | ||
202 | # You can say 'make all_modules' to attempt to make everything, or 'make | 280 | # You can say 'make all_modules' to attempt to make everything, or 'make |
203 | # components' to only make the things which are listed (in the per-build | 281 | # components' to only make the things which are listed (in the per-build |
@@ -210,7 +288,8 @@ docs: $(DOCS) | |||
210 | 288 | ||
211 | # Cleaning | 289 | # Cleaning |
212 | .PHONY: clean clobber | 290 | .PHONY: clean clobber |
213 | clean: MODULE_DIRS_TO_REMOVE := $(HOST_OUT) $(TARGET_OUT) $(DOCS_OUT) | 291 | clean: MODULE_DIRS_TO_REMOVE := $(HOST_OUT) $(HOST_32BIT_OUT) \ |
292 | $(TARGET_OUT_DIRECTORIES) | ||
214 | clean: | 293 | clean: |
215 | $(clean-dirs) | 294 | $(clean-dirs) |
216 | clobber: MODULE_DIRS_TO_REMOVE := $(OUT) | 295 | clobber: MODULE_DIRS_TO_REMOVE := $(OUT) |
@@ -220,11 +299,11 @@ clobber: | |||
220 | # Saying 'make clean-MODULE' removes the intermediates for MODULE. | 299 | # Saying 'make clean-MODULE' removes the intermediates for MODULE. |
221 | # clobber-MODULE deletes the output files as well | 300 | # clobber-MODULE deletes the output files as well |
222 | clean-%: | 301 | clean-%: |
223 | $(if $(V),,@echo " RM " $(call relative-to-top,$(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(OUT)/docs/intermediates/$*)) | 302 | $(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLEAN_TARGETS_FOR_$*))) |
224 | $(RM) -rf $(OUT)/host/intermediates/$*/* $(OUT)/target/intermediates/$*/* $(OUT)/docs/intermediates/$*/* | 303 | $(RM) -rf $(INTERNAL_CLEAN_TARGETS_FOR_$*) |
225 | clobber-%: | 304 | clobber-%: |
226 | $(if $(V),,@echo " RM " $(call relative-to-top,$(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(INTERNAL_TARGETS_FOR_$*))) | 305 | $(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLOBBER_TARGETS_FOR_$*))) |
227 | $(RM) -rf $(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(OUT)/docs/intermediates/$* $(INTERNAL_TARGETS_FOR_$*) | 306 | $(RM) -rf $(INTERNAL_CLOBBER_TARGETS_FOR_$*) |
228 | 307 | ||
229 | include $(MAKE_TOP)/bits.mk | 308 | include $(MAKE_TOP)/bits.mk |
230 | 309 | ||