• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED.
2#
3# This program is free software; you can redistribute it and/or
4# modify it under the terms of the GNU General Public License
5# as published by the Free Software Foundation; either version 2
6# of the License, or (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16
17#=======================================
18#	export variable
19#=======================================
20ifeq ($(CFG_HI_EXPORT_FLAG),)
21    ifneq ($(KERNELRELEASE),)
22    KERNEL_DIR := $(srctree)
23
24    SDK_DIR := $(KERNEL_DIR)/../../..
25    else
26    SDK_DIR := $(CURDIR)/../../..
27    endif
28
29    ifneq ($(SDK_SOURCE_DIR),)
30    SDK_DIR := $(SDK_SOURCE_DIR)/..
31    endif
32include $(SDK_DIR)/base.mak
33endif
34
35#=======================================
36#	local variable
37#======================================
38objs_depended := pm
39objs_depended += gpio
40ifneq ($(CFG_HI_USER_DRV),y)
41objs_depended += pq
42endif
43ifneq ($(CFG_HI_CHIP_TYPE),hi3751v350)
44objects := spi
45endif
46ifeq ($(CFG_HI_FPGA),y)
47objects += ssp
48endif
49objects += hiirq
50objects += hiproc
51objects += i2c
52objects += frontend
53objects += vfe
54objects += tvd
55objects += hddec
56objects += hdmirx
57ifneq ($(CFG_HI_USER_DRV),y)
58objects += panel
59endif
60ifeq ($(CFG_HI_MEMC_SUPPORT),y)
61objects += memc
62endif
63ifneq ($(CFG_HI_USER_DRV),y)
64objects += vo
65endif
66objects += pdm
67ifneq ($(CFG_HI_USER_DRV),y)
68objects += tde
69objects += hifb
70endif
71objects += vi
72objects += adsp
73objects += aiao
74objects += aflt
75objects += adec
76objects += demux
77objects += jpeg
78objects += vfmw
79ifneq ($(CFG_HI_USER_DRV),y)
80objects += vpss
81endif
82objects += vdec
83objects += omxvdec
84objects += vplugin
85objects += avplay
86objects += sync
87objects += sif
88objects += ir
89objects += lsadc
90objects += wdg
91objects += gpu
92objects += cipher
93ifeq ($(CFG_HI_SCI_SUPPORT), y)
94objects += sci
95endif
96objects += otp
97ifneq ($(CFG_HI_USER_DRV),y)
98objects += custom
99endif
100objects += pwm
101ifneq ($(CFG_HI_USER_DRV),y)
102objects += rm
103endif
104objects += dbe
105objects += vbi
106objects += mddrc
107
108ifeq ($(CFG_HI_FDMNG_SUPPORT), y)
109objects += fdmng
110endif
111
112ifeq ($(CFG_HI_PVR_SUPPORT),y)
113objects += pvr
114endif
115
116ifeq ($(CFG_HI_ADVCA_SUPPORT), y)
117objects += advca
118endif
119
120ifeq ($(CFG_HI_AENC_SUPPORT),y)
121objects += aenc
122endif
123
124ifeq ($(CFG_HI_VENC_SUPPORT),y)
125objects += venc
126endif
127
128ifeq ($(CFG_HI_CIPLUS_SUPPORT),y)
129objects += ci
130ifeq ($(CFG_HI_CI_DEV_CIMAXPLUS),y)
131objects += cimaxplus
132endif
133endif
134ifeq ($(CFG_HI_SND_AMP_SUPPORT),y)
135objects += amp
136endif
137ifneq ($(CFG_HI_ADAC_SLIC_SUPPORT)_$(CFG_HI_ADAC_TVL320AIC31_SUPPORT),_)
138objects += adac
139endif
140
141ifeq ($(CFG_MSP_BUILDTYPE),y)
142objects += base
143
144ifeq ($(KERNEL_VERSION), linux-5.10)
145ifeq ($(CFG_HI_USER_DRV),y)
146objects := hiirq
147objects += hiproc
148objects += hidev
149objects += gpio
150objects += i2c
151objects += gt911
152objects += fm11nt081d
153objects += devfreq
154objs_depended :=
155else
156objects += gt911
157objects += fm11nt081d
158objects += devfreq
159objects += securec
160endif
161
162EXTRA_CFLAGS += -I$(srctree)/bounds_checking_function/include
163endif
164
165obj-$(CFG_MSP_BUILDTYPE) += ${addsuffix /,${objs_depended}}
166obj-$(CFG_MSP_BUILDTYPE) += ${addsuffix /,${objects}}
167endif
168
169objects_clean:=${addsuffix _clean,${objects}}
170objects_install:=${addsuffix _install,${objects}}
171objects_uninstall:=${addsuffix _uninstall,${objects}}
172objects_prepare:=${addsuffix _prepare,${objects}}
173
174objs_depended_clean:=${addsuffix _clean,${objs_depended}}
175objs_depended_install:=${addsuffix _install,${objs_depended}}
176objs_depended_uninstall:=${addsuffix _uninstall,${objs_depended}}
177objs_depended_prepare:=${addsuffix _prepare,${objs_depended}}
178
179
180#=================================================================
181#	  rules
182#=================================================================
183
184.PHONY: all clean install uninstall ${objects} ${objects_clean} ${objects_install} ${objects_uninstall} ${objects_prepare}
185
186all: ${objects}
187
188clean: ${objects_clean} ${objs_depended_clean}
189	$(AT)rm -rf  *.o
190	$(AT)rm -rf  .*.o.cmd
191	$(AT)rm -rf  modules.order modules.builtin
192
193install: ${objects_install}
194${objects_install}: ${objs_depended_install}
195
196uninstall: ${objects_uninstall} ${objs_depended_uninstall}
197
198prepare: ${objects_prepare} ${objs_depended_prepare}
199
200${objects}:
201	make -C $@
202${objs_depended}:
203	make -C $@
204
205${objects_clean}:
206	make -C ${patsubst %_clean,%,$@} clean
207${objs_depended_clean}:
208	make -C ${patsubst %_clean,%,$@} clean
209
210${objects_install}:
211	make -C ${patsubst %_install,%,$@} install
212${objs_depended_install}:
213	make -C ${patsubst %_install,%,$@} install
214
215${objects_uninstall}:
216	make -C ${patsubst %_uninstall,%,$@} uninstall
217${objs_depended_uninstall}:
218	make -C ${patsubst %_uninstall,%,$@} uninstall
219
220${objects_prepare}:
221	@echo "prepare "$@
222#	make -C ${patsubst %_prepare,%,$@} prepare
223