-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (51 loc) · 1.68 KB
/
Copy pathMakefile
File metadata and controls
61 lines (51 loc) · 1.68 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# KERNELRELEASE is set by the kernel build system. This is used
# as a test to know if the build is being driven by the kernel.
ifneq ($(KERNELRELEASE),)
# Kernel build
# Older kernel scripts/Makefile.build only process Makefile so
# we include the Kbuild file here. Newer kernel scripts/Makefile.build
# include Kbuild directly and never process Makefile (this file).
include $(SHANNON_DRIVER_DIR)/Kbuild
else
KERNELVER ?= $(shell uname -r)
KERNEL_SRC = /lib/modules/$(KERNELVER)/build
GCC_FALLTHROUGH_OPTION = $(shell echo "" | gcc -fsyntax-only -Wno-implicit-fallthrough -xc - 2>&1)
ifeq ($(GCC_FALLTHROUGH_OPTION),)
SHANNON_FLAGS += -Wno-implicit-fallthrough
endif
# Uncomment this to build EMU module directly in this dir.
#SHANNON_FLAGS += -DCONFIG_SHANNON_EMU_MODULE
.PHONY: all clean modules_clean modules modules_install uninstall
all: modules
clean modules_clean:
$(MAKE) \
-C $(KERNEL_SRC) \
SHANNON_DRIVER_DIR=$(shell pwd) \
M=$(shell pwd) \
clean
debug:
$(MAKE) \
-C $(KERNEL_SRC) \
SHANNON_DRIVER_DIR=$(shell pwd) \
M=$(shell pwd) \
CONFIG_BLK_DEV_SHANNON=m \
CONFIG_SHANNON_EMU= \
EXTRA_CFLAGS="$(SHANNON_FLAGS)" \
INSTALL_MOD_PATH=$(INSTALL_ROOT) \
modules
modules modules_install:
$(MAKE) \
-C $(KERNEL_SRC) \
SHANNON_DRIVER_DIR=$(shell pwd) \
M=$(shell pwd) \
CONFIG_BLK_DEV_SHANNON=m \
CONFIG_SHANNON_EMU= \
EXTRA_CFLAGS="$(SHANNON_FLAGS) -DSHANNON_RELEASE" \
INSTALL_MOD_PATH=$(INSTALL_ROOT) \
$@
uninstall:
@echo "DELETE /lib/modules/$(KERNELVER)/extra/shannon.ko"
@rm -rf /lib/modules/$(KERNELVER)/extra/shannon.ko
@echo "DEPMOD $(KERNELVER)"
@/sbin/depmod $(KERNELVER)
endif