# Copyright (C) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #=============================================================================== # For Hi3751V350... #=============================================================================== # export variables #=============================================================================== ifeq ($(CFG_HI_EXPORT_FLAG),) ifneq ($(KERNELRELEASE),) KERNEL_DIR := $(srctree) SDK_DIR := $(KERNEL_DIR)/../../.. else SDK_DIR := $(CURDIR)/../../../.. endif ifneq ($(SDK_SOURCE_DIR),) SDK_DIR := $(SDK_SOURCE_DIR)/.. endif include $(SDK_DIR)/base.mak endif KBUILD_EXTRA_SYMBOLS += $(COMMON_DIR)/drv/Module.symvers export KBUILD_EXTRA_SYMBOLS #=============================================================================== # local variables #=============================================================================== EXTRA_CFLAGS += -I$(COMMON_UNF_INCLUDE) \ -I$(COMMON_API_INCLUDE) \ -I$(COMMON_DRV_INCLUDE) \ -I$(MSP_UNF_INCLUDE) \ -I$(MSP_API_INCLUDE) \ -I$(MSP_DRV_INCLUDE) \ -I$(MSP_DIR)/drv/hiproc/include \ -I$(SDK_DIR)/userspace_drv/osal/include/hicommon/include EXTRA_CFLAGS += $(CFG_HI_KMOD_CFLAGS) MOD_NAME := hi_proc obj-$(CFG_MSP_BUILDTYPE) += $(MOD_NAME).o $(MOD_NAME)-y := kernel/hiproc.o #=============================================================================== # rules #=============================================================================== .PHONY: all clean install uninstall all: $(AT)make -C $(LINUX_DIR) ARCH=$(CFG_HI_CPU_ARCH) CROSS_COMPILE=$(CFG_HI_TOOLCHAINS_NAME)- M=$(CURDIR) modules clean: $(AT)make -C $(LINUX_DIR) M=$(CURDIR) clean $(AT)rm -rf *.o $(AT)rm -rf .*.o.cmd $(AT)rm -rf .tmp_versions $(AT)rm -rf Module.symvers $(AT)rm -rf modules.order install: all ifneq ($(CFG_MSP_BUILDTYPE),y) $(AT)cp -f $(CURDIR)/$(MOD_NAME).ko $(MODULE_DIR)/ endif uninstall: $(AT)rm -rf $(MODULE_DIR)/$(MOD_NAME).ko