use DKMS to install realtek r8125 driver, get No rule to make target 'CLEAN'

660 Views Asked by At

I try to use dkms to install realtek r8125 driver. The official driver autorun script use this to compile source code

make $@ all 1>>log.txt || exit 1

the top level makefile is

KFLAG := 2$(shell uname -r | sed -ne 's/^2\.[4]\..*/4/p')x

all: clean modules install

modules:
ifeq ($(KFLAG),24x)
    $(MAKE) -C src/ -f Makefile_linux24x modules
else
    $(MAKE) -C src/ modules
endif

clean:
ifeq ($(KFLAG),24x)
    $(MAKE) -C src/ -f Makefile_linux24x clean
else
    $(MAKE) -C src/ clean
endif

install:
ifeq ($(KFLAG),24x)
    $(MAKE) -C src/ -f Makefile_linux24x install
else
    $(MAKE) -C src/ install
endif

my dkms.conf is

PACKAGE_NAME="realtek-r8125"
PACKAGE_VERSION="9.009.01"
MAKE="'make' $@ all"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]="r8125"
BUILT_MODULE_LOCATION[0]="src"
DEST_MODULE_LOCATION[0]="/kernel/driver/net/ethernet/realtek"
AUTOINSTALL="yes"
REMAKE_INITRD=no

when I build this project, I get an error

make: *** No rule to make target 'CLEAN'.  Stop.

when I change dkms.conf like this

PACKAGE_NAME="realtek-r8125"
PACKAGE_VERSION="9.009.01"
MAKE="'make' all"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]="r8125"
BUILT_MODULE_LOCATION[0]="src"
DEST_MODULE_LOCATION[0]="/kernel/driver/net/ethernet/realtek"
AUTOINSTALL="yes"
REMAKE_INITRD=no

it run success

why DKMS say "No rule to make target 'CLEAN'" even if there is a clean target in makefile

what is the difference between make all and make $@ all

0

There are 0 best solutions below