developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 1 | # 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 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | include $(INCLUDE_DIR)/kernel.mk |
| 10 | |
| 11 | PKG_NAME:=crypto-eip |
| 12 | PKG_RELEASE:=1 |
| 13 | |
| 14 | include $(INCLUDE_DIR)/package.mk |
| 15 | include $(INCLUDE_DIR)/package-defaults.mk |
| 16 | |
| 17 | # For package initialization such as menuconfig or description etc. |
| 18 | EIP_KERNEL_PKGS:= |
| 19 | EIP_PKGS:= |
| 20 | |
| 21 | include crypto-eip.mk |
| 22 | include $(filter-out crypto-eip.mk,$(wildcard *.mk)) |
| 23 | |
| 24 | EXTRA_CFLAGS+= \ |
| 25 | $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ |
| 26 | $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) |
| 27 | |
| 28 | EXTRA_CFLAGS+= -Wall -Werror |
| 29 | |
| 30 | define 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)/ |
| 34 | endef |
| 35 | |
| 36 | define 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 |
| 43 | endef |
| 44 | |
| 45 | $(foreach KERNEL_PKG,$(EIP_KERNEL_PKGS),$(eval $(call KernelPackage,$(KERNEL_PKG)))) |
| 46 | $(foreach PKG,$(EIP_PKGS),$(eval $(call BuildPackage,$(PKG)))) |