Add-on hardware tables initial implementation.
[sliver-openvswitch.git] / datapath / linux-2.6 / Makefile.main.in
1 # -*- makefile -*-
2 export builddir = @abs_builddir@
3 export srcdir = @abs_srcdir@
4 export top_srcdir = @abs_top_srcdir@
5 export KSRC = @KSRC26@
6 export VMDIR = @VMDIR@
7 export VERSION = @VERSION@
8
9 include $(srcdir)/../Modules.mk
10 include $(srcdir)/Modules.mk
11 include @HW_TABLES@
12
13 default: $(all_sources)
14 $(all_sources):
15         mkdir -p `dirname $@`
16         ln -s $(srcdir)/../$@ $@
17
18 default:
19 distclean: clean
20 distdir: clean
21 install:
22 all: default
23 check: all
24 clean:
25         rm -f $(all_objects) *.ko *_mod.* Module.symvers
26         rm -f `find . -name \*.cmd`
27         for d in $(sources); do                 \
28                 if test -h $$d; then            \
29                         rm $$d;                 \
30                 fi;                             \
31         done
32
33 ifneq ($(KSRC),)
34
35 ifeq (/lib/modules/$(shell uname -r)/source, $(KSRC))
36   KOBJ := /lib/modules/$(shell uname -r)/build
37 else
38   KOBJ := $(KSRC)
39 endif
40
41 ifneq ($(shell grep -c 'PATCHLEVEL = 6' $(KSRC)/Makefile),1)
42   $(error Linux kernel source in $(KSRC) not 2.6)
43 endif
44
45 VERSION_FILE := $(KOBJ)/include/linux/version.h
46 ifeq (,$(wildcard $(VERSION_FILE)))
47   $(error Linux kernel source not configured - missing version.h)
48 endif
49
50 CONFIG_FILE := $(KSRC)/include/linux/autoconf.h
51 ifeq (,$(wildcard $(CONFIG_FILE)))
52   $(error Linux kernel source not configured - missing autoconf.h)
53 endif
54
55 default:
56         $(MAKE) -C $(KSRC) M=$(builddir) modules
57 endif
58
59 # Much of the kernel build system in this file is derived from Intel's
60 # e1000 distribution, with the following license:
61
62 ################################################################################
63 #
64 # Intel PRO/1000 Linux driver
65 # Copyright(c) 1999 - 2007 Intel Corporation.
66 #
67 # This program is free software; you can redistribute it and/or modify it
68 # under the terms and conditions of the GNU General Public License,
69 # version 2, as published by the Free Software Foundation.
70 #
71 # This program is distributed in the hope it will be useful, but WITHOUT
72 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
73 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
74 # more details.
75 #
76 # You should have received a copy of the GNU General Public License along with
77 # this program; if not, write to the Free Software Foundation, Inc.,
78 # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
79 #
80 # The full GNU General Public License is included in this distribution in
81 # the file called "COPYING".
82 #
83 # Contact Information:
84 # Linux NICS <linux.nics@intel.com>
85 # e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
86 # Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
87 #
88 ################################################################################