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