6b46c0c0bb05a02dd37ef3a0ee418b76bc613878
[sliver-openvswitch.git] / datapath / linux / 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 = @KBUILD@
6 export VERSION = @VERSION@
7 export BUILD_BRCOMPAT = @BUILD_BRCOMPAT@
8
9 include $(srcdir)/../Modules.mk
10 include $(srcdir)/Modules.mk
11
12 default: $(build_links)
13
14 $(foreach s,$(sort $(foreach m,$(build_modules),$($(m)_sources))), \
15   $(eval $(notdir $(s)): ; ln -s $(srcdir)/../$(s) $@))
16
17 all: default
18 distdir: clean
19 install:
20 install-data:
21 install-exec:
22 uninstall:
23 install-dvi:
24 install-html:
25 install-info:
26 install-ps:
27 install-pdf:
28 installdirs:
29 check: all
30 installcheck:
31 mostlyclean:
32 clean:
33         rm -f *.o *.ko *.mod.* Module.symvers *.cmd kcompat.h.new
34         for d in $(build_links); do if test -h $$d; then rm $$d; fi; done
35 distclean: clean
36         rm -f kcompat.h
37 maintainer-clean: distclean
38 dvi:
39 pdf:
40 ps:
41 info:
42 html:
43 tags:
44 TAGS:
45
46 ifneq ($(KSRC),)
47
48 ifeq (/lib/modules/$(shell uname -r)/source, $(KSRC))
49   KOBJ := /lib/modules/$(shell uname -r)/build
50 else
51   KOBJ := $(KSRC)
52 endif
53
54 VERSION_FILE := $(KOBJ)/include/linux/version.h
55 ifeq (,$(wildcard $(VERSION_FILE)))
56   $(error Linux kernel source not configured - missing version.h)
57 endif
58
59 CONFIG_FILE := $(KSRC)/include/generated/autoconf.h
60 ifeq (,$(wildcard $(CONFIG_FILE)))
61   CONFIG_FILE := $(KSRC)/include/linux/autoconf.h
62   ifeq (,$(wildcard $(CONFIG_FILE)))
63     $(error Linux kernel source not configured - missing autoconf.h)
64   endif
65 endif
66
67 default:
68         $(MAKE) -C $(KSRC) M=$(builddir) modules
69
70 modules_install:
71         $(MAKE) -C $(KSRC) M=$(builddir) modules_install
72 endif
73
74 # Much of the kernel build system in this file is derived from Intel's
75 # e1000 distribution, with the following license:
76
77 ################################################################################
78 #
79 # Intel PRO/1000 Linux driver
80 # Copyright(c) 1999 - 2007, 2009 Intel Corporation.
81 #
82 # This program is free software; you can redistribute it and/or modify it
83 # under the terms and conditions of the GNU General Public License,
84 # version 2, as published by the Free Software Foundation.
85 #
86 # This program is distributed in the hope it will be useful, but WITHOUT
87 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
88 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
89 # more details.
90 #
91 # You should have received a copy of the GNU General Public License along with
92 # this program; if not, write to the Free Software Foundation, Inc.,
93 # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
94 #
95 # The full GNU General Public License is included in this distribution in
96 # the file called "COPYING".
97 #
98 # Contact Information:
99 # Linux NICS <linux.nics@intel.com>
100 # e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
101 # Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
102 #
103 ################################################################################