aboutsummaryrefslogtreecommitdiff
path: root/datapath/linux/Makefile.main.in
blob: b55fc957036cf65a0d0c1961817cdd4b7d1a80aa (plain)
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
# -*- makefile -*-
export builddir = @abs_builddir@
export srcdir = @abs_srcdir@
export top_srcdir = @abs_top_srcdir@
export KSRC = @KBUILD@
export VERSION = @VERSION@

include $(srcdir)/../Modules.mk
include $(srcdir)/Modules.mk

default: $(build_links)

$(foreach s,$(sort $(foreach m,$(build_modules),$($(m)_sources))), \
  $(eval $(notdir $(s)): ; ln -s $(srcdir)/../$(s) $@))

all: default
distdir: clean
install:
install-data:
install-exec:
uninstall:
install-dvi:
install-html:
install-info:
install-ps:
install-pdf:
installdirs:
check: all
installcheck:
mostlyclean:
clean:
	rm -f *.o *.ko *.mod.* Module.symvers *.cmd kcompat.h.new
	for d in $(build_links); do if test -h $$d; then rm $$d; fi; done
distclean: clean
	rm -f kcompat.h
maintainer-clean: distclean
dvi:
pdf:
ps:
info:
html:
tags:
TAGS:

ifneq ($(KSRC),)

ifeq (/lib/modules/$(shell uname -r)/source, $(KSRC))
  KOBJ := /lib/modules/$(shell uname -r)/build
else
  KOBJ := $(KSRC)
endif

VERSION_FILE := $(KOBJ)/include/linux/version.h
ifeq (,$(wildcard $(VERSION_FILE)))
  $(error Linux kernel source not configured - missing version.h)
endif

CONFIG_FILE := $(KSRC)/include/generated/autoconf.h
ifeq (,$(wildcard $(CONFIG_FILE)))
  CONFIG_FILE := $(KSRC)/include/linux/autoconf.h
  ifeq (,$(wildcard $(CONFIG_FILE)))
    $(error Linux kernel source not configured - missing autoconf.h)
  endif
endif

default:
	$(MAKE) -C $(KSRC) M=$(builddir) modules

modules_install:
	$(MAKE) -C $(KSRC) M=$(builddir) modules_install
endif

# Much of the kernel build system in this file is derived from Intel's
# e1000 distribution, with the following license:

################################################################################
#
# Intel PRO/1000 Linux driver
# Copyright(c) 1999 - 2007, 2009 Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope 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.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
#
# Contact Information:
# Linux NICS <linux.nics@intel.com>
# e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
#
################################################################################