-
Notifications
You must be signed in to change notification settings - Fork 38
/
config.mk
115 lines (104 loc) · 2.49 KB
/
config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
#通用工程配置文件
#
#
#苹果的平台的交叉编译器
#
ifeq ($(TERM_PROGRAM),Apple_Terminal)
ifeq ($(ARCH),arm)
export GCC_PREFIX=arm-linux-gnueabi-
else ifeq ($(ARCH),mips32)
export GCC_PREFIX=mips64el-linux-
else ifeq ($(ARCH),mips64)
export GCC_PREFIX=mips64el-linux-
else
export GCC_PREFIX=i686-linux-
endif
endif
#
#工具宏
#
CC = $(GCC_PREFIX)gcc
C++ = $(GCC_PREFIX)g++
AS = $(GCC_PREFIX)as
AR = $(GCC_PREFIX)ar
LD = $(GCC_PREFIX)ld
RES = fares
CP = cp
RM = rm
OBJCOPY = $(GCC_PREFIX)objcopy
CFLAGS_arm = -c -O2 -march=armv6k
CFLAGS_i386 = -c -O2 -m32
CFGAGS_MIPS64 = -c -O2 -mabi=64 -mips3 -EL -G0
CFGAGS_MIPS32 = -c -O2 -mabi=32 -mips32 -EL -G0
CL_INCLUDE = -I$(MY_BUILD_BASE)/source/libs/common/include -I$(MY_BUILD_BASE)/source/libs/common/include/arch/$(ARCH_DIR)
STD_INCLUDE = -I$(MY_BUILD_BASE)/include -I$(MY_BUILD_BASE)/include/arch/$(ARCH_DIR)
COMMON_CC_FLAGS += -Wimplicit-function-declaration -Wall
COMMON_CC_FLAGS += -fvisibility=hidden
#
#连接选项
#
LDFLAGS = -L$(SYSTEM_DIR)
ifeq ($(DLL),yes)
LDFLAGS += -shared --entry=_start
COMMON_CC_FLAGS += -fPIC
endif
#
#项目管理文件配置
#
SYSTEM_BUILD_TMP = $(MY_BUILD_BASE)/build
SYSTEM_DIR = $(MY_BUILD_BASE)/release/os/$(ARCH)
SYSTEM_DRV_DIR = $(SYSTEM_DIR)/Drivers
SYSTEM_PACK_DIR = $(MY_BUILD_BASE)/tools/kpck
#
#编码处理,默认为GBK字符,宽字符的是UNICODE。设置宏"CODE_ENCODE=utf8"可选择utf8的编码
#
ifeq ($(CODE_ENCODE),utf8)
COMMON_CC_FLAGS +=
else
COMMON_CC_FLAGS += -fexec-charset=gbk -finput-charset=gbk -fwide-exec-charset=UCS-2LE
endif
#
#调试处理
#
ifeq ($(DEBUG),YES)
COMMON_CC_FLAGS +=-D__DEBUG__=1 -g
endif
#
#编译命令行合成
#
ifeq ($(ARCH),mips64)
BITS=64
ARCH_DIR =mips
ARCH_LD_FLAGS =-melf64ltsmip
ifeq ($(DLL),yes)
COMMON_CC_FLAGS += -mabicalls
else ifeq ($(NORMAL_APP),yes)
COMMON_CC_FLAGS += -mabicalls
else
COMMON_CC_FLAGS += -mno-abicalls
endif
COMMON_CC_FLAGS +=$(CFGAGS_MIPS64) $(STD_INCLUDE)
else ifeq ($(ARCH),mips32)
BITS=32
ARCH_DIR=mips
ARCH_LD_FLAGS =-melf32ltsmip
ifeq ($(DLL),yes)
COMMON_CC_FLAGS += -mabicalls
else ifeq ($(NORMAL_APP),yes)
COMMON_CC_FLAGS += -mabicalls
else
COMMON_CC_FLAGS += -mno-abicalls
endif
COMMON_CC_FLAGS += $(CFGAGS_MIPS32) $(STD_INCLUDE)
else ifeq ($(ARCH),arm)
BITS=32
COMMON_CC_FLAGS += $(CFLAGS_arm) $(STD_INCLUDE)
ARCH_DIR=arm
else
BITS=32
ARCH=i386
COMMON_CC_FLAGS += $(CFLAGS_i386) $(STD_INCLUDE)
ARCH_DIR=x86
ARCH_LD_FLAGS=-melf_i386
endif