-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
32 lines (26 loc) · 812 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# cm4io-fan
KERNELRELEASE ?= $(shell uname -r)
export kernelver ?= $(KERNELRELEASE)
export arch ?= $(shell uname -m)
DKMS := $(shell command -v dkms 2> /dev/null)
DIRS = emc2301 overlays
BUILDDIRS = $(DIRS:%=build-%)
CLEANDIRS = $(DIRS:%=clean-%)
INSTALLDIRS = $(DIRS:%=install-%)
all: check_dkms $(BUILDDIRS)
modules_install: $(BUILDDIRS)
$(DIRS): $(BUILDDIRS)
$(BUILDDIRS):
$(MAKE) -C $(@:build-%=%) $(MAKECMDGOALS) KERNELRELEASE=$(KERNELRELEASE)
clean: $(CLEANDIRS)
$(CLEANDIRS):
$(MAKE) -C $(@:clean-%=%) $(MAKECMDGOALS) KERNELRELEASE=$(KERNELRELEASE)
install: $(INSTALLDIRS)
modules_install: $(INSTALLDIRS)
$(INSTALLDIRS):
$(MAKE) -C $(@:install-%=%) modules_install
check_dkms:
ifndef DKMS
$(error "DKMS is not installed, please apt install dkms")
endif
echo "DKMS found at $(shell which dkms)"