-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (52 loc) · 1.39 KB
/
Makefile
File metadata and controls
64 lines (52 loc) · 1.39 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
62
63
#
# Makefile for the output source package
#
ifeq ($(KERNELRELEASE),)
MAKEFLAGS += --no-print-directory
SHELL := /bin/bash
BACKPORT_DIR := $(shell pwd)
KMODDIR ?= updates
ifneq ($(origin KLIB), undefined)
KMODPATH_ARG := "INSTALL_MOD_PATH=$(KLIB)"
DEPMOD_BASE := $(KLIB)
DEPMOD_BASE_OPT := -b $(KLIB)
else
KLIB := /lib/modules/$(shell uname -r)/
KMODPATH_ARG :=
DEPMOD_BASE :=
DEPMOD_BASE_OPT :=
endif
KLIB_BUILD ?= $(KLIB)/build/
KERNEL_CONFIG := $(KLIB_BUILD)/.config
KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//')
DEPMOD_VERSION ?=
export KLIB KLIB_BUILD BACKPORT_DIR KMODDIR KMODPATH_ARG
# disable built-in rules for this file
.SUFFIXES:
.PHONY: default
default:
$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR)
.PHONY: clean
clean:
$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) clean
.PHONY: modules_install
modules_install: default
@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) \
INSTALL_MOD_DIR=$(KMODDIR) $(KMODPATH_ARG) \
modules_install
.PHONY: install
install: default
@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_DIR) \
INSTALL_MOD_DIR=$(KMODDIR) $(KMODPATH_ARG) \
modules_install
@./scripts/check_depmod.sh
@/sbin/depmod -a $(DEPMOD_BASE_OPT) $(DEPMOD_VERSION)
@./scripts/fw_install.sh $(DEPMOD_BASE)
.PHONY: uninstall
uninstall:
@./scripts/uninstall.sh
@/sbin/depmod -a
else
include $(BACKPORT_DIR)/Makefile.kernel
endif