8 EXE
:= $(findstring .exe
,$(MAKE
))
9 AR
= $(TCPREFIX
)ar$(EXE
)
10 AS
= $(TCPREFIX
)as$(EXE
)
13 CXX
= $(TCPREFIX
)clang
++$(TCSUFFIX
)$(EXE
)
14 CC
= $(TCPREFIX
)clang
$(TCSUFFIX
)$(EXE
)
16 CXX
= $(TCPREFIX
)g
++$(TCSUFFIX
)$(EXE
)
17 CC
= $(TCPREFIX
)gcc
$(TCSUFFIX
)$(EXE
)
20 DLLTOOL
= $(TCPREFIX
)dlltool
$(EXE
)
21 SIZE
= $(TCPREFIX
)size
$(EXE
)
22 STRIP
= $(TCPREFIX
)strip$(EXE
)
23 WINDRES
= $(TCPREFIX
)windres
$(EXE
)
32 ifeq ($(TARGET
)$(CLANG
),ANDROIDy
)
33 # on NDK r8c, binutils are only in the gcc toolchain directory
34 AR
= $(ANDROID_GCC_TOOLCHAIN
)/bin
/$(ANDROID_ABI4
)-ar$(EXE
)
35 STRIP
= $(ANDROID_GCC_TOOLCHAIN
)/bin
/$(ANDROID_ABI4
)-strip$(EXE
)
41 # generate LLVM bitcode
47 # Converts a list of source file names to *.o
48 SRC_TO_OBJ
= $(patsubst %.
cpp,%$(OBJ_SUFFIX
),$(patsubst %.c
,%$(OBJ_SUFFIX
),$(addprefix $(TARGET_OUTPUT_DIR
)/,$(1))))
50 ####### dependency handling
52 DEPFILE
= $(@
:$(OBJ_SUFFIX
)=.d
)
53 DEPFLAGS
= -Wp
,-MD
,$(DEPFILE
),-MT
,$@
54 cc-flags
= $(DEPFLAGS
) $(ALL_CFLAGS
) $(ALL_CPPFLAGS
) $(TARGET_ARCH
) $(FLAGS_COVERAGE
)
55 cxx-flags
= $(DEPFLAGS
) $(ALL_CXXFLAGS
) $(ALL_CPPFLAGS
) $(TARGET_ARCH
) $(FLAGS_COVERAGE
)
58 # Useful debugging targets - make preprocessed versions of the source
60 $(TARGET_OUTPUT_DIR
)/%.i
: %.
cpp FORCE
61 $(CXX
) $(cxx-flags
) -E
$(OUTPUT_OPTION
) $<
63 $(TARGET_OUTPUT_DIR
)/%.s
: %.
cpp FORCE
64 $(CXX
) $(cxx-flags
) -S
$(OUTPUT_OPTION
) $<
66 $(TARGET_OUTPUT_DIR
)/%.i
: %.c FORCE
67 $(CC
) $(cc-flags
) -E
$(OUTPUT_OPTION
) $<
72 # Provide our own rules for building...
75 WRAPPED_CC
= $(CCACHE
) $(CC
)
76 WRAPPED_CXX
= $(CCACHE
) $(CXX
)
78 $(TARGET_OUTPUT_DIR
)/%$(OBJ_SUFFIX
): %.c
$(TARGET_OUTPUT_DIR
)/%/..
/dirstamp
80 $(Q
)$(WRAPPED_CC
) -c
-o
$@
$(cc-flags
) $<
82 $(TARGET_OUTPUT_DIR
)/%$(OBJ_SUFFIX
): %.
cpp $(TARGET_OUTPUT_DIR
)/%/..
/dirstamp
84 $(Q
)$(WRAPPED_CXX
) -c
-o
$@
$(cxx-flags
) $<