Commit | Line | Data |
---|---|---|
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 | ||
20 | KERNELDIR = /lib/modules/$(shell uname -r)/build | |
21 | KBUILD := $(MAKE) -C $(KERNELDIR) M=$(CURDIR) | |
22 | EXTRADIR = $(shell readlink -f $(KERNELDIR)) | |
23 | ||
24 | ifneq ($(DESTDIR),) | |
25 | INSTALL_MOD_PATH = $(DESTDIR) | |
26 | endif | |
27 | ||
28 | .PHONY: default modules install modules_install clean | |
29 | ||
30 | default: modules | |
31 | install: modules_install udev | |
32 | ||
33 | modules: | |
34 | +$(KBUILD) $@ | |
35 | ||
36 | modules_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 | ||
42 | udev: udev-scif.rules | |
43 | mkdir -p $(DESTDIR)/etc/udev/rules.d | |
44 | cp $< $(DESTDIR)/etc/udev/rules.d/50-$< | |
45 | ||
46 | clean: | |
47 | +$(KBUILD) clean |