-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
41 lines (33 loc) · 1.07 KB
/
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
33
34
35
36
37
38
39
40
41
################################################################################
# Makefile - Build Advantech iManager Linux kernel modules with Makefile.kbuild
# recipe (out-of-tree kernel modules)
#
################################################################################
all: clean modules
NAME := imanager
DEPMOD := $(shell which depmod)
STRIP := $(shell which strip)
DRVPATH := /lib/modules/$(shell uname -r)/extra/$(NAME)
INCLUDE := $(src)
ccflags-y += -Wall -O3 $(EXTRA_CFLAGS) -I$(INCLUDE)
ifneq ($(KERNELRELEASE), )
# We've been invoked from the kernel build system and can
# use its language.
include $(src)/Makefile.kbuild
else
# Otherwise we were called directly from the command line;
# invoke the kernel build system.
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
endif
modules:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
$(RM) -rf *.bak
install: modules
$(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_DIR=extra/$(NAME) modules_install
$(DEPMOD) -a
uninstall:
$(RM) -r $(DRVPATH)
$(DEPMOD) -a