1 # Copyright (c) 2014 The Native Client Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6 # GNU Make based build file. For details on GNU Make see:
7 # http://www.gnu.org/software/make/manual/make.html
12 MAKEFILE_DEPS?=$(MAKEFILE_LIST)
15 # Rules for output directories.
17 # Output will be places in a directory name based on Toolchain and configuration
18 # be default this will be "newlib/Debug". We use a python wrapped MKDIR to
19 # proivde a cross platform solution. The use of '|' checks for existance instead
20 # of timestamp, since the directory can update when files change.
24 @echo Directory Stamp > $@
27 # Define a LOG macro that allow a command to be run in quiet mode where
28 # the command echoed is not the same as the actual command executed.
29 # The primary use case for this is to avoid echoing the full compiler
30 # and linker command in the default case. Defining V=1 will restore
31 # the verbose behavior
33 # $1 = The name of the tool being run
34 # $2 = The target file being built
35 # $3 = The full command to run
44 @echo $(1) $(2) && $(3)
48 @echo " $(1) $(2)" && $(3)
56 # $1 = Output (fully qualified path)
57 # $2 = Input (fully qualified path)
58 # $3 = Tool (fully qualified path)
59 # $4 = PRE ARGS (before output name)
60 # $5 = STD ARGS (before input name)
61 # $6 = POST ARGS (final args)
62 # $7 = Extra Required DEPS
63 # $8 = Add to Depend list
64 # $9 = GROUP Name (compile, lib, link, etc...)
66 # The standard definition is:
68 # $(3) $(4) $(1) $(5) $(2) $(6)
71 # gcc -o a.o -c a.c $(CCFLAGS)
85 @echo DEPENDS ON: $(7)
86 @echo DEPEND FOR: $(8)
97 $(2)_clean: $(1)_clean
103 .PHONY : compile compile_info
105 # Basic Compile Target
107 define BASIC_COMPILE_TARGET
108 $(call BASIC_TARGET,$(1),$(2),$(3),$(4),$(5),$(6),$(7) $(MAKEFILE_DEPS),$(8),compile)
110 -include $(patsubst %.o,%.d,$(1))
111 $(1) : $(2) $(7) $(MAKEFILE_DEPS)
113 $(call LOG,$(notdir $(3)),$(1),$(3) $(4) -o $(1) -c $(2) $(5) $(6))
116 $(basename $(notdir $(1))).txt : $(2) $(7) $(MAKEFILE_DEPS)
117 $(call LOG,$(notdir $(3) -E),$(basename $(notdir $(1))).txt,$(3) $(4) -o $(basename $(notdir $(1))).txt -E $(2) $(5) $(6))
121 .PHONY : lib lib_info lib_clean
123 # Basic Libarary Target
125 define BASIC_LIB_TARGET
126 $(call BASIC_TARGET,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),lib)
127 $(call CLEAN_TARGET,$(1),lib)
130 $(1): $(2) $(7) | $(dir $(1))dir.stamp
132 $(call LOG,LIB ,$(1),$(3) $(4) -cr $(1) $(2) $(5) $(6))
138 .PHONY : link link_info link_clean
139 define BASIC_LINK_TARGET
140 $(call BASIC_TARGET,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),link)
141 $(call CLEAN_TARGET,$(1),link)
144 $(1): $(2) $(7) | $(dir $(1))dir.stamp
145 $(call LOG,LINK,$(1),$(3) $(4) -o $(1) $(2) $(5) $(6))
149 # Basic Install Target
151 .PHONY : install_info install_clean
152 define BASIC_INSTALL_TARGET
153 $(call BASIC_TARGET,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),install)
154 $(call CLEAN_TARGET,$(1),install)
157 $(1): $(2) $(7) | $(dir $(1))dir.stamp
158 $(call LOG,CP,$(1),$(3) $(4) $(5) $(2) $(1) $(6))
161 .PHONY : stamp_info stamp_clean
165 define BASIC_STAMP_TARGET
166 $(call BASIC_TARGET,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),stamp)
167 $(call CLEAN_TARGET,$(1),stamp)
171 $(1): $(2) $(7) | $(dir $(1))dir.stamp
172 $(call LOG,STAMP,$(1),$(3) $(4) $(5) $(6) > $(1))
182 # $4 = Extra Required DEPS
183 # $5 = Add to Depend list
184 define C_COMPILER_RULE
185 ifneq (,$(findstring x86_32,$(ARCHES)))
186 $(call BASIC_COMPILE_TARGET,$(call SRC_TO_OBJ,$(1),_x86_32,$(3)),$(1),$(X86_32_CC),$(X86_INCS) $(POSIX_FLAGS),$(2),$(X86_32_CFLAGS) $(X86_32_CCFLAGS),$(4),$(5))
189 ifneq (,$(findstring x86_64,$(ARCHES)))
190 $(call BASIC_COMPILE_TARGET,$(call SRC_TO_OBJ,$(1),_x86_64,$(3)),$(1),$(X86_64_CC),$(X86_INCS) $(POSIX_FLAGS),$(2),$(X86_64_CFLAGS) $(X86_64_CCFLAGS),$(4),$(5))
193 ifneq (,$(findstring arm,$(ARCHES)))
194 $(call BASIC_COMPILE_TARGET,$(call SRC_TO_OBJ,$(1),_arm,$(3)),$(1),$(ARM_CC),$(ARM_INCS) $(POSIX_FLAGS),$(2),$(ARM_CFLAGS) $(ARM_CCFLAGS),$(4),$(5))
198 define CXX_COMPILER_RULE
199 ifneq (,$(findstring x86_32,$(ARCHES)))
200 $(call BASIC_COMPILE_TARGET,$(call SRC_TO_OBJ,$(1),_x86_32,$(3)),$(1),$(X86_32_CXX),$(X86_INCS) $(POSIX_FLAGS),$(2),$(X86_32_CFLAGS) $(X86_32_CXXFLAGS),$(4),$(5))
203 ifneq (,$(findstring x86_64,$(ARCHES)))
204 $(call BASIC_COMPILE_TARGET,$(call SRC_TO_OBJ,$(1),_x86_64,$(3)),$(1),$(X86_64_CXX),$(X86_INCS) $(POSIX_FLAGS),$(2),$(X86_64_CFLAGS) $(X86_64_CXXFLAGS),$(4),$(5))
207 ifneq (,$(findstring arm,$(ARCHES)))
208 $(call BASIC_COMPILE_TARGET,$(call SRC_TO_OBJ,$(1),_arm,$(3)),$(1),$(ARM_CXX),$(ARM_INCS) $(POSIX_FLAGS),$(2),$(ARM_CFLAGS) $(ARM_CXXFLAGS),$(4),$(5))
214 # $2 = POSIX Compile Flags
216 # $4 = Extra Required DEPS
217 # $5 = Add to Depend list
220 ifeq ($(suffix $(1)),.c)
221 $(call C_COMPILER_RULE,$(1),$(2),$(3),$(4),$(5))
223 $(call CXX_COMPILER_RULE,$(1),$(2),$(3),$(4),$(5))
233 # $3 = Extra Required DEPS
234 # $4 = Add to Depend list
237 $(call BASIC_INSTALL_TARGET,$(1),$(2),cp,,,,$(3),$(4))
246 # $4 = Extra Required DEPS
247 # $5 = Defines target
249 ifneq (,$(findstring x86_32,$(ARCHES)))
250 $(call INSTALL_RULE,$(LIBDIR)/nacl_x86_32/$(CONFIG)/$(1).$(2),$(3)/$(1)_x86_32.$(2),$(4),$(5))
253 ifneq (,$(findstring x86_64,$(ARCHES)))
254 $(call INSTALL_RULE,$(LIBDIR)/nacl_x86_64/$(CONFIG)/$(1).$(2),$(3)/$(1)_x86_64.$(2),$(4),$(5))
257 ifneq (,$(findstring arm,$(ARCHES)))
258 $(call INSTALL_RULE,$(LIBDIR)/nacl_arm/$(CONFIG)/$(1).$(2),$(3)/$(1)_arm.$(2),$(4),$(5))
269 # $5 = Extra Required DEPS
270 # $6 = Add to Depend list
271 define INSTALL_LIB_AS
272 ifneq (,$(findstring x86_32,$(ARCHES)))
273 $(call INSTALL_RULE,$(LIBDIR)/nacl_x86_32/$(CONFIG)/$(1),$(2)/$(3)_x86_32.$(4),$(5),$(6))
276 ifneq (,$(findstring x86_64,$(ARCHES)))
277 $(call INSTALL_RULE,$(LIBDIR)/nacl_x86_64/$(CONFIG)/$(1),$(2)/$(3)_x86_64.$(4),$(5),$(6))
280 ifneq (,$(findstring arm,$(ARCHES)))
281 $(call INSTALL_RULE,$(LIBDIR)/nacl_arm/$(CONFIG)/$(1),$(2)/$(3)_arm.$(4),$(5),$(6))
289 # $2 = List of Sources
293 define LIB_RULE_X86_32
294 ifneq (,$(findstring x86_32,$(ARCHES)))
295 $(call BASIC_LIB_TARGET,$(3)/lib$(1)_x86_32.a,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32,$(3))),$(X86_32_LIB),,,,$(4),$(5))
299 define LIB_RULE_X86_64
300 ifneq (,$(findstring x86_64,$(ARCHES)))
301 $(call BASIC_LIB_TARGET,$(3)/lib$(1)_x86_64.a,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64,$(3))),$(X86_64_LIB),,,,$(4),$(5))
306 ifneq (,$(findstring arm,$(ARCHES)))
307 $(call BASIC_LIB_TARGET,$(3)/lib$(1)_arm.a,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm,$(3))),$(ARM_LIB),,,,$(4),$(5))
312 $(call LIB_RULE_X86_32,$(1),$(2),$(3),$(4),$(5))
313 $(call LIB_RULE_X86_64,$(1),$(2),$(3),$(4),$(5))
314 $(call LIB_RULE_ARM,$(1),$(2),$(3),$(4),$(5))
317 #DEFAULT_STATIC_LIBS ?=-lsupc++ -lc -lgcc_eh
318 #DEFAULT_STATIC_DEPS ?=libsupc++.a libc.a libgcc_eh.a crtbegin_st.o crtend_st.o
320 #DEFAULT_DYNAMIC_LIBS ?=-lsupc++ -lc -lgcc_s
321 #DEFAULT_DYNAMIC_DEPS ?=libsupc++.so libc.so libgcc_s.so crtbegin_dy.o crtend_dy.o
323 #DEFAULT_SO_LIBS ?=-lsupc++ -lc -lgcc_s -lgcc
324 #DEFAULT_SO_DEPS ?=libsupc++.so libc.so libgcc_s.so crtbegin_so.o crtend_so.o
326 DEFAULT_STATIC_LIBS ?=-lsupc++ -lc -lgcc_eh
327 DEFAULT_STATIC_DEPS ?=libsupc++.a libc.a crtbegin_st.o crtend_st.o
329 DEFAULT_DYNAMIC_LIBS ?=-lsupc++ -lc -lgcc_s
330 DEFAULT_DYNAMIC_DEPS ?=libsupc++.so libc.so libgcc_s.so crtbegin_dy.o crtend_dy.o
332 DEFAULT_SO_LIBS ?=-lsupc++ -lc -lgcc_s
333 DEFAULT_SO_DEPS ?=libsupc++.so libc.so libgcc_s.so crtbegin_so.o crtend_so.o
335 LDFLAGS_STATIC ?= -nostdlib -nostartfiles -static
336 LDFLAGS_DYNAMIC ?= -nostdlib -nostartfiles -Wl,-Ttext-segment,0x1000000 -Wl,--hash-style=sysv
337 LDFLAGS_SO ?= -nostdlib -nostartfiles -shared -fPIC -Wl,--hash-style=sysv -g
339 X86_32_LD ?= -L$(X86_32_LIB_PATH)
340 X86_64_LD ?= -L$(X86_64_LIB_PATH)
341 ARM_LD ?= -L$(ARM_LIB_PATH) -mcpu=cortex-a15 -mfloat-abi=hard -mthumb-interwork -Wl,-z,noexecstack -Wl,--fix-cortex-a8 -Wl,-Bsymbolic -Wl,--warn-shared-textrel
343 X86_32_LD_HEAD_STATIC ?= $(LIBDIR)/nacl_x86_32/$(CONFIG)/crtbegin_st.o
344 X86_64_LD_HEAD_STATIC ?= $(LIBDIR)/nacl_x86_64/$(CONFIG)/crtbegin_st.o
345 ARM_LD_HEAD_STATIC ?= $(LIBDIR)/nacl_arm/$(CONFIG)/crtbegin_st.o
347 X86_32_LD_HEAD_DYNAMIC ?= $(LIBDIR)/nacl_x86_32/$(CONFIG)/crtbegin_dy.o
348 X86_64_LD_HEAD_DYNAMIC ?= $(LIBDIR)/nacl_x86_64/$(CONFIG)/crtbegin_dy.o
349 ARM_LD_HEAD_DYNAMIC ?= $(LIBDIR)/nacl_arm/$(CONFIG)/crtbegin_dy.o
351 X86_32_LD_HEAD_SO ?= $(LIBDIR)/nacl_x86_32/$(CONFIG)/crtbegin_so.o
352 X86_64_LD_HEAD_SO ?= $(LIBDIR)/nacl_x86_64/$(CONFIG)/crtbegin_so.o
353 ARM_LD_HEAD_SO ?= $(LIBDIR)/nacl_arm/$(CONFIG)/crtbegin_so.o
355 ARM_LIBGCC_A ?= $(ARM_TC)/lib/gcc/arm-nacl/4.8.2/libgcc.a
356 X86_32_LIBGCC_A ?= $(X86_TC)/lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a
357 X86_64_LIBGCC_A ?= $(X86_TC)/lib/gcc/x86_64-nacl/4.4.3/libgcc.a
359 X86_32_LD_TAIL_STATIC ?= -T $(NACL_SDK_ROOT)/arch-x86_32/lib/static.lds $(DEFAULT_STATIC_LIBS) -lgcc_eh $(X86_32_LIBGCC_A) $(LIBDIR)/nacl_x86_32/$(CONFIG)/crtend_st.o
360 X86_64_LD_TAIL_STATIC ?= -T $(NACL_SDK_ROOT)/arch-x86_64/lib/static.lds $(DEFAULT_STATIC_LIBS) -lgcc_eh $(X86_64_LIBGCC_A) $(LIBDIR)/nacl_x86_64/$(CONFIG)/crtend_st.o
361 ARM_LD_TAIL_STATIC ?= -T $(NACL_SDK_ROOT)/arch-arm/lib/static.lds $(DEFAULT_STATIC_LIBS) $(ARM_LIBGCC_A) $(LIBDIR)/nacl_arm/$(CONFIG)/crtend_st.o
363 X86_32_LD_TAIL_DYNAMIC ?= $(DEFAULT_DYNAMIC_LIBS) $(X86_32_LIBGCC_A) $(LIBDIR)/nacl_x86_32/$(CONFIG)/crtend_dy.o
364 X86_64_LD_TAIL_DYNAMIC ?= $(DEFAULT_DYNAMIC_LIBS) $(X86_64_LIBGCC_A) $(LIBDIR)/nacl_x86_64/$(CONFIG)/crtend_dy.o
365 ARM_LD_TAIL_DYNAMIC ?= $(DEFAULT_DYNAMIC_LIBS) $(ARM_LIBGCC_A) $(LIBDIR)/nacl_arm/$(CONFIG)/crtend_dy.o
367 X86_32_LD_TAIL_SO ?= $(DEFAULT_SO_LIBS) $(X86_32_LIBGCC_A) $(LIBDIR)/nacl_x86_32/$(CONFIG)/crtend_so.o
368 X86_64_LD_TAIL_SO ?= $(DEFAULT_SO_LIBS) $(X86_64_LIBGCC_A) $(LIBDIR)/nacl_x86_64/$(CONFIG)/crtend_so.o
369 ARM_LD_TAIL_SO ?= $(DEFAULT_SO_LIBS) $(ARM_LIBGCC_A) $(LIBDIR)/nacl_arm/$(CONFIG)/crtend_so.o
373 # As well as building and installing a shared library this rule adds dependencies
374 # on the library's .stamp file in STAMPDIR. However, the rule for creating the stamp
375 # file is part of LIB_RULE, so users of the DEPS system are currently required to
376 # use the LIB_RULE macro as well as the SO_RULE for each shared library.
379 # $2 = List of Sources
384 define SO_LINK_RULE_X86_32
385 ifneq (,$(findstring x86_32,$(ARCHES)))
386 $(call BASIC_LINK_TARGET,$(4)/lib$(1)_x86_32.so,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32,$(4))),$(X86_32_LINK),$(LDFLAGS_SO) $(X86_32_LD) $(X86_32_LD_HEAD_SO),$(3),$(X86_32_LD_TAIL_SO),$(5),$(6))
390 define SO_LINK_RULE_X86_64
391 ifneq (,$(findstring x86_64,$(ARCHES)))
392 $(call BASIC_LINK_TARGET,$(4)/lib$(1)_x86_64.so,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64,$(4))),$(X86_64_LINK),$(LDFLAGS_SO) $(X86_64_LD) $(X86_64_LD_HEAD_SO),$(3),$(X86_64_LD_TAIL_SO),$(5),$(6))
396 define SO_LINK_RULE_ARM
397 ifneq (,$(findstring arm,$(ARCHES)))
398 $(call BASIC_LINK_TARGET,$(4)/lib$(1)_arm.so,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm,$(4))),$(ARM_LINK),$(LDFLAGS_SO) $(ARM_LD) $(ARM_LD_HEAD_SO),$(3),$(ARM_LD_TAIL_SO),$(5),$(6))
403 $(call SO_LINK_RULE_X86_32,$(1),$(2),$(3),$(4),$(5) $(foreach src,$(DEFAULT_SO_DEPS),$(LIBDIR)/nacl_x86_32/$(CONFIG)/$(src)),$(6))
404 $(call SO_LINK_RULE_X86_64,$(1),$(2),$(3),$(4),$(5) $(foreach src,$(DEFAULT_SO_DEPS),$(LIBDIR)/nacl_x86_64/$(CONFIG)/$(src)),$(6))
405 $(call SO_LINK_RULE_ARM,$(1),$(2),$(3),$(4),$(5) $(foreach src,$(DEFAULT_SO_DEPS),$(LIBDIR)/nacl_arm/$(CONFIG)/$(src)),$(6))
410 # Specific Link Macro
413 # $2 = List of Sources
418 define STATIC_LINK_RULE_X86_32
419 ifneq (,$(findstring x86_32,$(ARCHES)))
420 $(call BASIC_LINK_TARGET,$(4)/$(1)_x86_32.nexe,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32,$(4))),$(X86_32_LINK), $(LDFLAGS_STATIC) $(X86_32_LD) $(X86_32_LD_HEAD_STATIC),$(3),$(X86_32_LD_TAIL_STATIC),$(5),$(6))
424 define STATIC_LINK_RULE_X86_64
425 ifneq (,$(findstring x86_64,$(ARCHES)))
426 $(call BASIC_LINK_TARGET,$(4)/$(1)_x86_64.nexe,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64,$(4))),$(X86_64_LINK), $(LDFLAGS_STATIC) $(X86_64_LD) $(X86_64_LD_HEAD_STATIC),$(3),$(X86_64_LD_TAIL_STATIC),$(5),$(6))
430 define STATIC_LINK_RULE_ARM
431 ifneq (,$(findstring arm,$(ARCHES)))
432 $(call BASIC_LINK_TARGET,$(4)/$(1)_arm.nexe,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm,$(4))),$(ARM_LINK), $(LDFLAGS_STATIC) $(ARM_LD) $(ARM_LD_HEAD_STATIC),$(3),$(ARM_LD_TAIL_STATIC),$(5),$(6))
436 define STATIC_LINK_RULE
437 $(call STATIC_LINK_RULE_X86_32,$(1),$(2),$(3),$(4),$(5))
438 $(call STATIC_LINK_RULE_X86_64,$(1),$(2),$(3),$(4),$(5))
439 $(call STATIC_LINK_RULE_ARM,$(1),$(2),$(3),$(4),$(5))
446 # $2 = List of Sources
451 define DYNAMIC_LINK_RULE_X86_32
452 ifneq (,$(findstring x86_32,$(ARCHES)))
453 $(call BASIC_LINK_TARGET,$(4)/$(1)_x86_32.nexe,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32,$(4))),$(X86_32_LINK), $(LDFLAGS_DYNAMIC) $(X86_32_LD) $(X86_32_LD_HEAD_DYNAMIC),$(3),$(X86_32_LD_TAIL_DYNAMIC),$(5),$(6))
457 define DYNAMIC_LINK_RULE_X86_64
458 ifneq (,$(findstring x86_64,$(ARCHES)))
459 $(call BASIC_LINK_TARGET,$(4)/$(1)_x86_64.nexe,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64,$(4))),$(X86_64_LINK), $(LDFLAGS_DYNAMIC) $(X86_64_LD) $(X86_64_LD_HEAD_DYNAMIC),$(3),$(X86_64_LD_TAIL_DYNAMIC),$(5),$(6))
463 define DYNAMIC_LINK_RULE_ARM
464 ifneq (,$(findstring arm,$(ARCHES)))
465 $(call BASIC_LINK_TARGET,$(4)/$(1)_arm.nexe,$(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm,$(4))),$(ARM_LINK), $(LDFLAGS_DYNAMIC) $(ARM_LD) $(ARM_LD_HEAD_DYNAMIC),$(3),$(ARM_LD_TAIL_DYNAMIC),$(5),$(6))
469 define DYNAMIC_LINK_RULE
470 $(call DYNAMIC_LINK_RULE_X86_32,$(1),$(2),$(3),$(4),$(5))
471 $(call DYNAMIC_LINK_RULE_X86_64,$(1),$(2),$(3),$(4),$(5))
472 $(call DYNAMIC_LINK_RULE_ARM,$(1),$(2),$(3),$(4),$(5))
477 # Strip Macro for each arch (e.g., each arch supported by LINKER_RULE).
482 define STRIP_RULE_x86_32
483 ifneq (,$(findstring x86_32,$(ARCHES)))
484 all: $(OUTDIR)/$(1)_x86_32.nexe
485 $(OUTDIR)/$(1)_x86_32.nexe: $(OUTDIR)/$(2)_x86_32.nexe
486 $(call LOG,STRIP,$$@,$(X86_32_STRIP) -o $$@ $$^)
490 define STRIP_RULE_x86_64
491 ifneq (,$(findstring x86_64,$(ARCHES)))
492 all: $(OUTDIR)/$(1)_x86_64.nexe
493 $(OUTDIR)/$(1)_x86_64.nexe: $(OUTDIR)/$(2)_x86_64.nexe
494 $(call LOG,STRIP,$$@,$(X86_64_STRIP) -o $$@ $$^)
498 define STRIP_RULE_ARM
499 ifneq (,$(findstring arm,$(ARCHES)))
500 all: $(OUTDIR)/$(1)_arm.nexe
501 $(OUTDIR)/$(1)_arm.nexe: $(OUTDIR)/$(2)_arm.nexe
502 $(call LOG,STRIP,$$@,$(ARM_STRIP) -o $$@ $$^)
506 define STRIP_ALL_RULE
507 $(call STRIP_RULE_X86_32,$(1),$(2))
508 $(call STRIP_RULE_X86_64,$(1),$(2))
509 $(call STRIP_RULE_ARM,$(1),$(2))
514 # Top-level Strip Macro
516 # $1 = Target Basename
517 # $2 = Source Basename
520 $(call STRIP_ALL_RULE,$(1),$(2))
524 # Strip Macro for each arch (e.g., each arch supported by MAP_RULE).
530 ifneq (,$(findstring x86_32,$(ARCHES)))
531 all: $(OUTDIR)/$(1)_x86_32.map
532 $(OUTDIR)/$(1)_x86_32.map: $(OUTDIR)/$(2)_x86_32.nexe
533 $(call LOG,MAP,$$@,$(X86_32_NM) -l $$^ > $$@)
536 ifneq (,$(findstring x86_64,$(ARCHES)))
537 all: $(OUTDIR)/$(1)_x86_64.map
538 $(OUTDIR)/$(1)_x86_64.map: $(OUTDIR)/$(2)_x86_64.nexe
539 $(call LOG,MAP,$$@,$(X86_64_NM) -l $$^ > $$@)
542 ifneq (,$(findstring arm,$(ARCHES)))
543 all: $(OUTDIR)/$(1)_arm.map
544 $(OUTDIR)/$(1)_arm.map: $(OUTDIR)/$(2)_arm.nexe
545 $(call LOG,MAP,$$@,$(ARM_NM) -l $$^ > $$@ )
550 # Top-level MAP Generation Macro
552 # $1 = Target Basename
553 # $2 = Source Basename
556 $(call MAP_ALL_RULE,$(1),$(2))
562 # $1 = Target Basename
563 # $2 = Source Basename
569 $(call BASIC_STAMP_TARGET,$(1),$(2),echo,$(3),$(4),$(5))
572 info: compile_info lib_info link_info
573 @echo TOOLCHAIN=$(TOOLCHAIN)
574 @echo CONFIG=$(CONFIG)
575 @echo LIBDIR=$(LIBDIR)
576 @echo ARCHES=$(ARCHES)
577 @echo OUTDIR=$(OUTDIR)