Updated `README.md` with instructions for building/using the kernel module.
[xeon-phi-kernel-module] / host / Makefile
CommitLineData
800f879a
AT
1#
2# Manycore Throughput Linux Driver
3# Copyright (c) 2010, Intel Corporation.
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms and conditions of the GNU General Public License,
7# version 2, as published by the Free Software Foundation.
8#
9# This program is distributed in the hope it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12# more details.
13#
14# You should have received a copy of the GNU General Public License along with
15# this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17#
18#
19
20KERNELDIR = /lib/modules/$(shell uname -r)/build
21KBUILD := $(MAKE) -C $(KERNELDIR) M=$(CURDIR)
22EXTRADIR = $(shell readlink -f $(KERNELDIR))
23
24ifneq ($(DESTDIR),)
25INSTALL_MOD_PATH = $(DESTDIR)
26endif
27
28.PHONY: default modules install modules_install clean
29
30default: modules
31install: modules_install udev
32
33modules:
34 +$(KBUILD) $@
35
36modules_install:
37 +$(KBUILD) INSTALL_MOD_PATH=$(DESTDIR) modules_install
38 mkdir -p $(DESTDIR)$(EXTRADIR)/include
39 install -m644 include/scif.h $(DESTDIR)$(EXTRADIR)/include
40 install -m644 Module.symvers $(DESTDIR)$(EXTRADIR)/Module.symvers.mic
41
42udev: udev-scif.rules
43 mkdir -p $(DESTDIR)/etc/udev/rules.d
44 cp $< $(DESTDIR)/etc/udev/rules.d/50-$<
45
46clean:
47 +$(KBUILD) clean