OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # | 5 # |
6 # GNU Make based build file. For details on GNU Make see: | 6 # GNU Make based build file. For details on GNU Make see: |
7 # http://www.gnu.org/software/make/manual/make.html | 7 # http://www.gnu.org/software/make/manual/make.html |
8 # | 8 # |
9 | 9 |
10 # | 10 # |
11 # Macros for TOOLS | 11 # Macros for TOOLS |
12 # | 12 # |
13 ifneq ($(TOOLCHAIN),bionic) | 13 ifneq ($(TOOLCHAIN),bionic) |
14 X86_32_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x
86_32 --tool=cc) | 14 X86_32_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x
86_32 --tool=cc) |
15 X86_32_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a
x86_32 --tool=c++) | 15 X86_32_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a
x86_32 --tool=c++) |
16 X86_32_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=c++) | 16 X86_32_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=c++) |
17 X86_32_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=ar) | 17 X86_32_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=ar) |
18 X86_32_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=strip) | 18 X86_32_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=strip) |
19 X86_32_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=nm) | 19 X86_32_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_32 --tool=nm) |
20 | 20 |
21 X86_64_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x
86_64 --tool=cc) | 21 X86_64_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x
86_64 --tool=cc) |
22 X86_64_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a
x86_64 --tool=c++) | 22 X86_64_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a
x86_64 --tool=c++) |
23 X86_64_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=c++) | 23 X86_64_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=c++) |
24 X86_64_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=ar) | 24 X86_64_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=ar) |
25 X86_64_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=strip) | 25 X86_64_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=strip) |
26 X86_64_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=nm) | 26 X86_64_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=nm) |
27 endif | 27 endif |
28 | 28 |
29 ifneq (,$(findstring $(TOOLCHAIN),newlib bionic clang-newlib)) | |
30 ARM_SUPPORT=1 | |
31 endif | |
32 | |
33 ifdef ENABLE_ARM_GLIBC | |
34 ARM_SUPPORT=1 | |
35 endif | |
36 | |
37 ifeq ($(ARM_SUPPORT),1) | |
38 ARM_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm
--tool=cc) | 29 ARM_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm
--tool=cc) |
39 ARM_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm
--tool=c++) | 30 ARM_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm
--tool=c++) |
40 ARM_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=c++) | 31 ARM_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=c++) |
41 ARM_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=ar) | 32 ARM_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=ar) |
42 ARM_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=strip) | 33 ARM_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=strip) |
43 ARM_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=nm) | 34 ARM_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=nm) |
44 endif | |
45 | 35 |
46 NCVAL ?= python $(NACL_SDK_ROOT)/tools/ncval.py | 36 NCVAL ?= python $(NACL_SDK_ROOT)/tools/ncval.py |
47 | 37 |
48 # Architecture-specific variables | 38 # Architecture-specific variables |
49 ifeq (,$(MULTI_PLATFORM)) | 39 ifeq (,$(MULTI_PLATFORM)) |
50 X86_32_OUTDIR ?= $(OUTDIR) | 40 X86_32_OUTDIR ?= $(OUTDIR) |
51 X86_64_OUTDIR ?= $(OUTDIR) | 41 X86_64_OUTDIR ?= $(OUTDIR) |
52 ARM_OUTDIR ?= $(OUTDIR) | 42 ARM_OUTDIR ?= $(OUTDIR) |
53 else | 43 else |
54 X86_32_OUTDIR ?= $(OUTDIR)/_platform_specific/x86-32 | 44 X86_32_OUTDIR ?= $(OUTDIR)/_platform_specific/x86-32 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 endif | 170 endif |
181 endef | 171 endef |
182 | 172 |
183 # | 173 # |
184 # Determine which architectures to build for. The user can set NACL_ARCH or | 174 # Determine which architectures to build for. The user can set NACL_ARCH or |
185 # ARCHES in the environment to control this. | 175 # ARCHES in the environment to control this. |
186 # | 176 # |
187 ifneq ($(TOOLCHAIN),bionic) | 177 ifneq ($(TOOLCHAIN),bionic) |
188 VALID_ARCHES := x86_32 x86_64 | 178 VALID_ARCHES := x86_32 x86_64 |
189 endif | 179 endif |
190 ifeq ($(ARM_SUPPORT),1) | |
191 VALID_ARCHES += arm | 180 VALID_ARCHES += arm |
192 endif | |
193 | 181 |
194 ifdef NACL_ARCH | 182 ifdef NACL_ARCH |
195 ifeq (,$(findstring $(NACL_ARCH),$(VALID_ARCHES))) | 183 ifeq (,$(findstring $(NACL_ARCH),$(VALID_ARCHES))) |
196 $(error Invalid arch specified in NACL_ARCH: $(NACL_ARCH). Valid values are: $(
VALID_ARCHES)) | 184 $(error Invalid arch specified in NACL_ARCH: $(NACL_ARCH). Valid values are: $(
VALID_ARCHES)) |
197 endif | 185 endif |
198 ARCHES = ${NACL_ARCH} | 186 ARCHES = ${NACL_ARCH} |
199 else | 187 else |
200 ARCHES ?= ${VALID_ARCHES} | 188 ARCHES ?= ${VALID_ARCHES} |
201 endif | 189 endif |
202 | 190 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 $(call LOG,LIB ,$$@,$(X86_64_LIB) -cr $$@ $$^) | 308 $(call LOG,LIB ,$$@,$(X86_64_LIB) -cr $$@ $$^) |
321 | 309 |
322 $(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a | 310 $(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a |
323 install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a | 311 install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a |
324 $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a: $(X86_64_OUTDIR)/lib$(1)_
x86_64.a | 312 $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a: $(X86_64_OUTDIR)/lib$(1)_
x86_64.a |
325 $(MKDIR) -p $$(dir $$@) | 313 $(MKDIR) -p $$(dir $$@) |
326 $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@) | 314 $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@) |
327 endif | 315 endif |
328 | 316 |
329 ifneq (,$(findstring arm,$(ARCHES))) | 317 ifneq (,$(findstring arm,$(ARCHES))) |
330 ifeq ($(ARM_SUPPORT),1) | |
331 all: $(ARM_OUTDIR)/lib$(1)_arm.a | 318 all: $(ARM_OUTDIR)/lib$(1)_arm.a |
332 $(ARM_OUTDIR)/lib$(1)_arm.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm)) | 319 $(ARM_OUTDIR)/lib$(1)_arm.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm)) |
333 $(MKDIR) -p $$(dir $$@) | 320 $(MKDIR) -p $$(dir $$@) |
334 $(RM) -f $$@ | 321 $(RM) -f $$@ |
335 $(call LOG,LIB ,$$@,$(ARM_LIB) -cr $$@ $$^) | 322 $(call LOG,LIB ,$$@,$(ARM_LIB) -cr $$@ $$^) |
336 | 323 |
337 $(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a | 324 $(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a |
338 install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a | 325 install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a |
339 $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a: $(ARM_OUTDIR)/lib$(1)_arm.a | 326 $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a: $(ARM_OUTDIR)/lib$(1)_arm.a |
340 $(MKDIR) -p $$(dir $$@) | 327 $(MKDIR) -p $$(dir $$@) |
341 $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@) | 328 $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@) |
342 endif | 329 endif |
343 endif | |
344 endef | 330 endef |
345 | 331 |
346 | 332 |
347 # | 333 # |
348 # Specific Link Macro | 334 # Specific Link Macro |
349 # | 335 # |
350 # $1 = Target name | 336 # $1 = Target name |
351 # $2 = List of source files | 337 # $2 = List of source files |
352 # $3 = List of LIBS | 338 # $3 = List of LIBS |
353 # $4 = List of DEPS | 339 # $4 = List of DEPS |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set) | 551 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set) |
566 endif | 552 endif |
567 $(SEL_LDR_PATH) $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe --
$(EXE_ARGS) | 553 $(SEL_LDR_PATH) $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe --
$(EXE_ARGS) |
568 | 554 |
569 debug: all | 555 debug: all |
570 ifndef NACL_ARCH | 556 ifndef NACL_ARCH |
571 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set) | 557 $(error Cannot run in sel_ldr unless $$NACL_ARCH is set) |
572 endif | 558 endif |
573 $(SEL_LDR_PATH) -d $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe
-- $(EXE_ARGS) | 559 $(SEL_LDR_PATH) -d $(SEL_LDR_ARGS) $(OUTDIR)/$(TARGET)_$(NACL_ARCH).nexe
-- $(EXE_ARGS) |
574 endif | 560 endif |
OLD | NEW |