# Copyright (C) 2021 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. #******************************************************************************* #The rule of make Linux kernel module #******************************************************************************* $(HIFB_MOD_NAME)-objs = $(HIFB_SRC:%.c=%.o) $(MOD_NAME)-objs = $(HIFB_SRC_O:%.c=%.o) ifneq ($(KERNELRELEASE),) obj-m += hifb.o #obj-m += $(MOD_NAME).o endif ifeq ($(CROSS),arm-hisiv500-linux-) EXTRA_CFLAGS += -Wno-error=date-time else ifeq ($(CROSS),arm-hisiv600-linux-) EXTRA_CFLAGS += -Wno-error=date-time endif ifeq ($(HIARCH),hi3516ev200) TDE_ROOT := tde_hi3516ev200 VGS_ROOT := vgs/vgs_hi3516ev200 else TDE_ROOT := tde endif #******************************************************************************* .PHONY: default clean default: @echo -e "\e[0;32;1m--Compiling 'hiFB'... Configs as follow:\e[0;36;1m" @echo ---- CROSS=$(CROSS) @echo ---- HIARCH=$(HIARCH), HICHIP=$(HICHIP), CVER=$(CVER), DBG=$(HIDBG) @echo ---- SDK_PATH=$(SDK_PATH) , PARAM_FILE=$(PARAM_FILE) @echo ---- KERNEL_ROOT=$(KERNEL_ROOT) @@echo -e "\e[0m" @$(MAKE) -C $(KERNEL_ROOT) M=$(PWD) $(COMPILER_TRIPLE) V=10 modules @mkdir -p $(REL_KO) && cp -rf $(HIFB_MOD_NAME).ko $(REL_KO) clean: @for x in `find . -name "*.o"`;do rm -rf $$x;done @for x in `find . -name ".*.o.cmd"`;do rm -rf $$x;done @for x in `find . -name "*.ko"`;do rm -rf $$x;done @for x in `find . -name "*.mod.c"`;do rm -rf $$x;done @for x in `find . -name ".*.ko.cmd"`;do rm -rf $$x;done @rm -f *.mod .*.cmd @rm .tmp_versions -fr @rm Module.symvers -f @rm modules.order -f @rm -rf $(REL_KO)/$(HIFB_MOD_NAME).ko @rm -rf $(REL_INC)/$(HIFB_MOD_NAME)*.h @rm -f $(REL_OBJ)/$(MOD_NAME).o