File: Makefile

package info (click to toggle)
nvidia-open-gpu-kernel-modules 550.163.01-4
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 87,488 kB
  • sloc: ansic: 1,143,669; cpp: 22,547; sh: 3,721; makefile: 627; python: 315
file content (86 lines) | stat: -rw-r--r-- 2,909 bytes parent folder | download | duplicates (6)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
###########################################################################
# This is the top level makefile for the NVIDIA Linux kernel module source
# package.
#
# To build: run `make modules`
# To install the build kernel modules: run (as root) `make modules_install`
###########################################################################

###########################################################################
# variables
###########################################################################

nv_kernel_o                = src/nvidia/$(OUTPUTDIR)/nv-kernel.o
nv_kernel_o_binary         = kernel-open/nvidia/nv-kernel.o_binary

nv_modeset_kernel_o        = src/nvidia-modeset/$(OUTPUTDIR)/nv-modeset-kernel.o
nv_modeset_kernel_o_binary = kernel-open/nvidia-modeset/nv-modeset-kernel.o_binary

###########################################################################
# rules
###########################################################################

include utils.mk

.PHONY: all
all: modules

###########################################################################
# nv-kernel.o is the OS agnostic portion of nvidia.ko
###########################################################################

.PHONY: $(nv_kernel_o)
$(nv_kernel_o):
	$(MAKE) -C src/nvidia

$(nv_kernel_o_binary): $(nv_kernel_o)
	cd $(dir $@) && ln -sf ../../$^ $(notdir $@)


###########################################################################
# nv-modeset-kernel.o is the OS agnostic portion of nvidia-modeset.ko
###########################################################################

.PHONY: $(nv_modeset_kernel_o)
$(nv_modeset_kernel_o):
	$(MAKE) -C src/nvidia-modeset

$(nv_modeset_kernel_o_binary): $(nv_modeset_kernel_o)
	cd $(dir $@) && ln -sf ../../$^ $(notdir $@)


###########################################################################
# After the OS agnostic portions are built, descend into kernel-open/ and build
# the kernel modules with kbuild.
###########################################################################

.PHONY: modules
modules: $(nv_kernel_o_binary) $(nv_modeset_kernel_o_binary)
	$(MAKE) -C kernel-open modules

###########################################################################
# Install the built kernel modules using kbuild.
###########################################################################

.PHONY: modules_install
modules_install:
	$(MAKE) -C kernel-open modules_install

###########################################################################
# clean
###########################################################################

.PHONY: clean
clean: nvidia.clean nvidia-modeset.clean kernel-open.clean

.PHONY: nvidia.clean
nvidia.clean:
	$(MAKE) -C src/nvidia clean

.PHONY: nvidia-modeset.clean
nvidia-modeset.clean:
	$(MAKE) -C src/nvidia-modeset clean

.PHONY: kernel-open.clean
kernel-open.clean:
	$(MAKE) -C kernel-open clean