-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.param
164 lines (133 loc) · 3.64 KB
/
Makefile.param
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Makefile.param
# Only global variable should be defined here.
# All the variables must be used as "export" and "?=".
# Otherwise, there will be some errors, when Makefile.param is nested.
# Use this file as the following sample
# ifeq ($(PARAM_FILE), )
# PARAM_FILE:=../Makefile.param
# include $(PARAM_FILE)
# endif
# Define the default OS link directory.
export HIWORK_PATH?=/hiwork
export ARCH=arm
export MPP_BUILD=n
# use HIARCH indicate chip, use libc to choose cross compiler.
export HIARCH?=hi3518
export LIBC?=uclibc
# Whether support the debug information. HI_DEBUG or HI_RELEASE
export HIDBG?=HI_DEBUG
# Whether open -g
#export HIGDB?=y
export HIGDB?=n
# FPGA board or not
export FPGA?=n
ifeq ($(HIARCH), )
$(error HIARCH not defined! Please check!)
endif
ifeq ($(LIBC), )
$(error LIBC not defined! Please check!)
endif
ifeq ($(HIARCH),hi3531)
export HICHIP?=0x35310100
export ARCH_DIR?=hi3531
endif
ifeq ($(HIARCH),hi3532)
export HICHIP?=0x35320100
export ARCH_DIR?=hi3531
endif
ifeq ($(HIARCH),hi3521)
export HICHIP?=0x35210100
export ARCH_DIR?=hi3521
endif
ifeq ($(HIARCH),hi3520A)
export HICHIP?=0x3520A100
export ARCH_DIR?=hi3521
endif
ifeq ($(HIARCH),hi3520D)
export HICHIP?=0x3520D100
export ARCH_DIR?=hi3520D
endif
ifeq ($(HIARCH),hi3518)
export HICHIP?=0x35180100
export ARCH_DIR?=hi3518
endif
# use C01 to indicate uclibc, C02 to indicate glibc, C00 to indicate FPGA.
ifeq ($(LIBC),glibc)
export CVER?=.C02
else
export CVER?=.C01
endif
ifeq ($(FPGA),y)
export CVER=.C00
export HI_FPGA:=HI_FPGA
export EXTDRV:=extdrv/$(HIARCH)_fpga
else
export HI_FPGA:=HI_XXXX
export EXTDRV:=extdrv/$(HIARCH)
endif
# Get the local SDK_ROOT path or RELEASE_ROOT path by PARAM_FILE.
# PARAM_FILE is configed at Makefile before include this file
export PARAM_FILE
export SDK_PATH?=$(shell cd $(PWD)/`dirname $(PARAM_FILE)`/..; pwd)
export DRV_ROOT?=$(SDK_PATH)/drv
export MPP_PATH?=$(SDK_PATH)/mpp
# Allocated the linux position
ifneq ($(shell ls $(HIWORK_PATH)/osdrv$(HIARCH)$(CVER)), )
export LINUX_ROOT?=$(HIWORK_PATH)/osdrv$(HIARCH)$(CVER)/kernel/linux-3.0.y
else
export LINUX_ROOT?=$(SDK_PATH)/osdrv/kernel/linux-3.0.y
endif
# Define cross compiler
ifeq ($(LIBC),glibc)
export CROSS_COMPILE?= arm-hisiv200-linux-
export CROSS?= arm-hisiv200-linux-
else
export CROSS_COMPILE?= arm-hisiv100nptl-linux-
export CROSS?= arm-hisiv100nptl-linux-
endif
export CC:=$(CROSS)gcc
export AR:=$(CROSS)ar
export MPP_CFLAGS:= -Wall
ifeq ($(HIGDB), y)
MPP_CFLAGS += -g
else
MPP_CFLAGS += -O2
endif
# Define the object output directory
ifeq ($(MPP_BUILD), y)
REL_DIR=$(SDK_PATH)/mpp/release/$(HIARCH)
SAMPLE_DIR=$(SDK_PATH)/mpp/sample/$(HIARCH)
else
REL_DIR=$(MPP_PATH)
EXTDRV=extdrv
SAMPLE_DIR=$(MPP_PATH)/sample
endif
export REL_INC := $(REL_DIR)/include
export REL_LIB := $(REL_DIR)/lib
export REL_KO := $(REL_DIR)/ko
# Define the lib of audio codec
export AUDIO_PATH?=$(MPP_PATH)/component/audio/lib/$(CROSS)
export AUDIO_LIBA := $(REL_LIB)/libVoiceEngine.a \
$(REL_LIB)/libaec.a \
$(REL_LIB)/libresampler.a \
$(REL_LIB)/libanr.a\
$(REL_LIB)/libvqev2.a\
$(REL_LIB)/libupvqe.a\
$(REL_LIB)/libdnvqe.a
# Define the lib of jpeg codec
export JPEGD_PATH?=$(MPP_PATH)/component/jpegd
export JPEGD_LIBA:=$(REL_LIB)/libjpeg.a
#********************* Macro for version management*****************************
VER_X ?= 1
VER_Y ?= 0
VER_Z ?= 0
VER_P ?= 0
MPP_CFLAGS += -DVER_X=$(VER_X) -DVER_Y=$(VER_Y) -DVER_Z=$(VER_Z) -DVER_P=$(VER_P)
#*******************************************************************************
# include the config file of platform
ifeq ($(MPP_BUILD), y)
-include $(SDK_PATH)/mpp/configs/config.mk
else
export CONFIG_ISP=y
endif
# End!!