forked from gjvdbraak/mpss-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
106 lines (93 loc) · 4.35 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 2010-2017 Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2,
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# Disclaimer: The codes contained in these modules may be specific to
# the Intel Software Development Platform codenamed Knights Ferry,
# and the Intel product codenamed Knights Corner, and are not backward
# compatible with other Intel products. Additionally, Intel will NOT
# support the codes or instruction set in future products.
#
# Intel offers no warranty of any kind regarding the code. This code is
# licensed on an "AS IS" basis and Intel is not obligated to provide
# any support, assistance, installation, training, or other services
# of any kind. Intel is also not obligated to provide any updates,
# enhancements or extensions. Intel specifically disclaims any warranty
# of merchantability, non-infringement, fitness for any particular
# purpose, and any other warranty.
#
# Further, Intel disclaims all liability of any kind, including but
# not limited to liability for infringement of any proprietary rights,
# relating to the use of the code, even if Intel is notified of the
# possibility of such liability. Except as expressly stated in an Intel
# license agreement provided with this code and agreed upon with Intel,
# no license, express or implied, by estoppel or otherwise, to any
# intellectual property rights is granted herein.
MPSS_COMMIT ?= $(or $(shell sed -ne '2 p' .mpss-metadata 2>/dev/null), \
$(error .mpss-metadata file is missing or incorrect))
MPSS_VERSION ?= $(or $(shell sed -ne '1 p' .mpss-metadata 2>/dev/null), \
$(error .mpss-metadata file is missing or incorrect))
MPSS_BUILDNO ?= 0
export MPSS_COMMIT := $(MPSS_COMMIT)
export MPSS_VERSION := $(MPSS_VERSION)
export MPSS_BUILDNO := $(MPSS_BUILDNO)
export MPSS_BUILTBY := $(shell echo "`whoami`@`uname -n`")
export MPSS_BUILTON := $(shell date +'%F %T %z')
KERNELRELEASE := $(shell uname -r)
KERNEL_SRC = /lib/modules/$(KERNELRELEASE)/build
INSTALL = install
INSTALL_d = $(INSTALL) -d
INSTALL_x = $(INSTALL)
INSTALL_f = $(INSTALL) -m644
prefix = /usr/local
sysconfdir = $(prefix)/etc
includedir = $(prefix)/include
kmodinstalldir = /lib/modules/$(KERNELRELEASE)
kmodincludedir = $(realpath $(KERNEL_SRC))/include/modules
# If building the host's driver for a MIC co-processor card, which card
# $(ARCH) it should support
export MIC_CARD_ARCH := k1om
.PHONY: all install modules clean
.PHONY: modules_install conf_install dev_install kdev_install
all: modules
install: modules_install conf_install kdev_install
modules modules_install clean: %:
$(MAKE) -C $(KERNEL_SRC) M=$(CURDIR) $* \
INSTALL_MOD_PATH=$(DESTDIR)
conf_install:
ifneq ($(MIC_CARD_ARCH),)
$(INSTALL_d) $(DESTDIR)$(sysconfdir)/sysconfig/modules
$(INSTALL_x) mic.modules $(DESTDIR)$(sysconfdir)/sysconfig/modules
$(INSTALL_d) $(DESTDIR)$(sysconfdir)/modprobe.d
$(INSTALL_f) mic.conf $(DESTDIR)$(sysconfdir)/modprobe.d
endif
$(INSTALL_d) $(DESTDIR)$(sysconfdir)/udev/rules.d
$(INSTALL_f) udev-mic.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/50-udev-mic.rules
dev_install:
$(INSTALL_d) $(DESTDIR)$(includedir)/mic
$(INSTALL_f) include/scif_ioctl.h $(DESTDIR)$(includedir)
$(INSTALL_f) include/mic/io_interface.h $(DESTDIR)$(includedir)/mic
$(INSTALL_f) include/mic/mic_pm.h $(DESTDIR)$(includedir)/mic
$(INSTALL_f) ras/micras_api.h $(DESTDIR)$(includedir)/mic
$(INSTALL_f) ras/micmca_api.h $(DESTDIR)$(includedir)/mic
ifeq ($(MIC_CARD_ARCH),) # Card side
$(INSTALL_f) ras/micpm_api.h $(DESTDIR)$(includedir)/mic
$(INSTALL_f) ras/micras.h $(DESTDIR)$(includedir)/mic
else # Host side
$(INSTALL_f) include/mic/micbaseaddressdefine.h $(DESTDIR)$(includedir)/mic
$(INSTALL_f) include/mic/micsboxdefine.h $(DESTDIR)$(includedir)/mic
$(INSTALL_f) include/mic/micdboxdefine.h $(DESTDIR)$(includedir)/mic
$(INSTALL_f) ras/micpm_api.h $(DESTDIR)$(includedir)/mic
endif
kdev_install:
$(INSTALL_d) $(DESTDIR)$(kmodinstalldir)
$(INSTALL_f) Module.symvers $(DESTDIR)$(kmodinstalldir)/scif.symvers
$(INSTALL_d) $(DESTDIR)$(kmodincludedir)
$(INSTALL_f) include/scif.h $(DESTDIR)$(kmodincludedir)