blob: 494eadbff02951581444594024530076aec028f6 [file] [log] [blame]
developer94c513e2023-08-21 17:33:25 +08001# SPDX-Liscense-Identifier: GPL-2.0-or-later
2#
3# Copyright (C) 2023 MediaTek Inc.
4#
5# Author: Chris.Chou <chris.chou@mediatek.com>
6# Ren-Ting Wang <ren-ting.wang@mediatek.com>
7
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=crypto-eip
12PKG_RELEASE:=1
13
14include $(INCLUDE_DIR)/package.mk
15include $(INCLUDE_DIR)/package-defaults.mk
16
17# For package initialization such as menuconfig or description etc.
18EIP_KERNEL_PKGS:=
19EIP_PKGS:=
20
21include crypto-eip.mk
22include $(filter-out crypto-eip.mk,$(wildcard *.mk))
23
24EXTRA_CFLAGS+= \
25 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
26 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG))))
27
28EXTRA_CFLAGS+= -Wall -Werror
29
30define Build/Prepare
31 mkdir -p $(PKG_BUILD_DIR)/firmware
32 $(CP) -r `find ./firmware -maxdepth 1 | grep -v ".git"` $(PKG_BUILD_DIR)/firmware/
33 $(CP) -r `find ./src -maxdepth 1 | grep -v ".git"` $(PKG_BUILD_DIR)/
34endef
35
36define Build/Compile
37 $(MAKE) -C "$(LINUX_DIR)" \
38 $(KERNEL_MAKE_FLAGS) \
39 M="$(PKG_BUILD_DIR)" \
40 EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
41 $(EXTRA_KCONFIG) \
42 modules
43endef
44
45$(foreach KERNEL_PKG,$(EIP_KERNEL_PKGS),$(eval $(call KernelPackage,$(KERNEL_PKG))))
46$(foreach PKG,$(EIP_PKGS),$(eval $(call BuildPackage,$(PKG))))