ovs-sandbox: Add note about OVN to initial output.
[cascardo/ovs.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
8 include $(srcdir)/../Modules.mk
9 include $(srcdir)/Modules.mk
10
11 default: $(build_links)
12
13 $(foreach s,$(sort $(foreach m,$(build_modules),$($(m)_sources))), \
14   $(eval $(notdir $(s)): ; ln -s $(srcdir)/../$(s) $@))
15
16 all: default
17 distdir: clean
18 install:
19 install-data:
20 install-exec:
21 uninstall:
22 install-dvi:
23 install-html:
24 install-info:
25 install-ps:
26 install-pdf:
27 installdirs:
28 check: all
29 installcheck:
30 mostlyclean:
31 clean:
32         rm -f *.o *.ko *.mod.* Module.symvers .*.cmd kcompat.h.new \
33                 modules.order .tmp_versions/openvswitch.mod
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   VERSION_FILE := $(KOBJ)/include/generated/uapi/linux/version.h
57   ifeq (,$(wildcard $(VERSION_FILE)))
58     $(error Linux kernel source not configured - missing version.h)
59   endif
60 endif
61
62 CONFIG_FILE := $(KSRC)/include/generated/autoconf.h
63 ifeq (,$(wildcard $(CONFIG_FILE)))
64   CONFIG_FILE := $(KSRC)/include/linux/autoconf.h
65   ifeq (,$(wildcard $(CONFIG_FILE)))
66     $(error Linux kernel source not configured - missing autoconf.h)
67   endif
68 endif
69
70 default:
71         $(MAKE) -C $(KSRC) M=$(builddir) modules
72
73 modules_install:
74         $(MAKE) -C $(KSRC) M=$(builddir) modules_install
75         depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h`
76 endif
77
78 # Much of the kernel build system in this file is derived from Intel's
79 # e1000 distribution, with the following license:
80
81 ################################################################################
82 #
83 # Intel PRO/1000 Linux driver
84 # Copyright(c) 1999 - 2007, 2009 Intel Corporation.
85 #
86 # This program is free software; you can redistribute it and/or modify it
87 # under the terms and conditions of the GNU General Public License,
88 # version 2, as published by the Free Software Foundation.
89 #
90 # This program is distributed in the hope it will be useful, but WITHOUT
91 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
92 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
93 # more details.
94 #
95 # You should have received a copy of the GNU General Public License along with
96 # this program; if not, write to the Free Software Foundation, Inc.,
97 # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
98 #
99 # The full GNU General Public License is included in this distribution in
100 # the file called "COPYING".
101 #
102 # Contact Information:
103 # Linux NICS <linux.nics@intel.com>
104 # e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
105 # Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
106 #
107 ################################################################################