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 17ifeq ($(CFG_HI_EXPORT_FLAG),) 18 ifneq ($(KERNELRELEASE),) 19 KERNEL_DIR := $(srctree) 20 21 SDK_DIR := $(KERNEL_DIR)/../../.. 22 else 23 SDK_DIR := $(CURDIR)/../../../.. 24 endif 25 26 ifneq ($(SDK_SOURCE_DIR),) 27 SDK_DIR := $(SDK_SOURCE_DIR)/.. 28 endif 29 30include $(SDK_DIR)/base.mak 31endif 32 33EXTRA_CFLAGS += -I$(srctree)/drivers/devfreq 34 35MOD_NAME := utgard_ondemand 36 37$(MOD_NAME)-y := governor_utgard_ondemand.o 38obj-$(CFG_MSP_BUILDTYPE) += $(MOD_NAME).o 39 40#=============================================================================== 41# rules 42#=============================================================================== 43.PHONY: all clean install uninstall 44 45all: 46 $(AT)make -C $(LINUX_DIR) ARCH=$(CFG_HI_CPU_ARCH) CROSS_COMPILE=$(CFG_HI_TOOLCHAINS_NAME)- M=$(CURDIR) modules 47 48clean: 49 $(AT)make -C $(LINUX_DIR) M=$(CURDIR) clean 50 $(AT)rm -rf *.o 51 $(AT)rm -rf .*.o.cmd 52 $(AT)rm -rf .tmp_versions 53 $(AT)rm -rf Module.symvers 54 $(AT)rm -rf modules.order 55 56install: all 57ifneq ($(CFG_MSP_BUILDTYPE),y) 58 $(AT)cp -f $(CURDIR)/$(MOD_NAME).ko $(MODULE_DIR)/ 59endif 60 61uninstall: 62 $(AT)rm -rf $(MODULE_DIR)/$(MOD_NAME).ko