1 | # $Id: Makefile.kmk 35380 2010-12-30 16:06:17Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Network Adapter Driver (VBoxNetAdp).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009-2010 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | if1of ($(KBUILD_TARGET), solaris darwin linux freebsd)
|
---|
23 | #
|
---|
24 | # VBoxNetAdp - Virtual Network Adapter
|
---|
25 | # Note! On Solaris the name has to be <= 8 chars long.
|
---|
26 | #
|
---|
27 | ifdef VBOX_WITH_VBOXDRV
|
---|
28 | SYSMODS += VBoxNetAdp
|
---|
29 | VBoxNetAdp_TEMPLATE = VBOXR0DRV
|
---|
30 | VBoxNetAdp_INST = $(INST_VBOXNETADP)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
|
---|
31 | VBoxNetAdp_NAME.solaris = vboxnet
|
---|
32 | VBoxNetAdp_NAME.linux = vboxnetadp
|
---|
33 | VBoxNetAdp_NAME.freebsd = vboxnetadp
|
---|
34 | VBoxNetAdp_NOINST.linux = true
|
---|
35 | VBoxNetAdp_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
36 | VBoxNetAdp_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
|
---|
37 | VBoxNetAdp_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetadp\) KBUILD_BASENAME=KBUILD_STR\(vboxnetadp\) MODULE
|
---|
38 | #VBoxNetAdp_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
|
---|
39 | VBoxNetAdp_LDFLAGS.solaris += -N misc/gld -N drv/vboxdrv
|
---|
40 | VBoxNetAdp_INCS.linux := \
|
---|
41 | $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
|
---|
42 | VBoxNetAdp_INCS = \
|
---|
43 | .
|
---|
44 | VBoxNetAdp_SOURCES.darwin = \
|
---|
45 | darwin/VBoxNetAdp-darwin.cpp \
|
---|
46 | VBoxNetAdp.c
|
---|
47 | VBoxNetAdp_SOURCES.solaris = \
|
---|
48 | solaris/VBoxNetAdp-solaris.c
|
---|
49 | VBoxNetAdp_SOURCES.linux = \
|
---|
50 | linux/VBoxNetAdp-linux.c \
|
---|
51 | VBoxNetAdp.c
|
---|
52 | VBoxNetAdp_SOURCES.freebsd = \
|
---|
53 | freebsd/VBoxNetAdp-freebsd.c \
|
---|
54 | VBoxNetAdp.c
|
---|
55 | VBoxNetAdp_SOURCES =
|
---|
56 | #VBoxNetAdp_SOURCES = \
|
---|
57 | # VBoxNetAdp.c
|
---|
58 | VBoxNetAdp_LIBS += \
|
---|
59 | $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
60 | endif
|
---|
61 | endif
|
---|
62 |
|
---|
63 | #
|
---|
64 | # Darwin extras.
|
---|
65 | #
|
---|
66 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
67 | INSTALLS += VBoxNetAdp.kext
|
---|
68 | VBoxNetAdp.kext_INST = $(INST_VBOXNETADP)Contents/
|
---|
69 | VBoxNetAdp.kext_SOURCES = \
|
---|
70 | $(VBoxNetAdp.kext_0_OUTDIR)/Info.plist
|
---|
71 | VBoxNetAdp.kext_CLEAN = \
|
---|
72 | $(VBoxNetAdp.kext_0_OUTDIR)/Info.plist
|
---|
73 |
|
---|
74 | $$(VBoxNetAdp.kext_0_OUTDIR)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
|
---|
75 | $(call MSG_GENERATE,VBoxNetAdp,$@,$<)
|
---|
76 | $(QUIET)$(RM) -f $@
|
---|
77 | $(QUIET)$(SED) \
|
---|
78 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
79 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
80 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
81 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
82 | -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
|
---|
83 | -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
|
---|
84 | -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
|
---|
85 | --output $@ \
|
---|
86 | $<
|
---|
87 |
|
---|
88 | INSTALLS.darwin += Scripts-darwin-adp
|
---|
89 | Scripts-darwin-adp_INST = $(INST_DIST)
|
---|
90 | Scripts-darwin-adp_SOURCES = \
|
---|
91 | darwin/loadnetadp.sh
|
---|
92 | endif # darwin
|
---|
93 |
|
---|
94 | ifeq ($(KBUILD_TARGET),linux)
|
---|
95 | #
|
---|
96 | # Install source files for compilation on Linux.
|
---|
97 | # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
|
---|
98 | #
|
---|
99 | include $(PATH_SUB_CURRENT)/linux/files_vboxnetadp
|
---|
100 | INSTALLS += VBoxNetAdp-src VBoxNetAdp-sh
|
---|
101 | VBoxNetAdp-src_INST = bin/src/vboxnetadp/
|
---|
102 | VBoxNetAdp-src_MODE = a+r,u+w
|
---|
103 | VBoxNetAdp-src_SOURCES = $(subst ",,$(VBOX_VBOXNETADP_SOURCES)) #"
|
---|
104 | VBoxNetAdp-src_SOURCES+= \
|
---|
105 | $(VBoxNetAdp-src_0_OUTDIR)/Makefile
|
---|
106 | VBoxNetAdp-src_CLEAN = \
|
---|
107 | $(VBoxNetAdp-src_0_OUTDIR)/Makefile \
|
---|
108 | $(PATH_TARGET)/VBoxNetAdp-src-1.dep
|
---|
109 |
|
---|
110 | VBoxNetAdp-sh_INST = bin/src/vboxnetadp/
|
---|
111 | VBoxNetAdp-sh_MODE = a+rx,u+w
|
---|
112 | VBoxNetAdp-sh_SOURCES = \
|
---|
113 | $(VBoxNetAdp-sh_0_OUTDIR)/build_in_tmp \
|
---|
114 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
|
---|
115 | VBoxNetAdp-sh_CLEAN = $(VBoxNetAdp-sh_0_OUTDIR)/build_in_tmp
|
---|
116 |
|
---|
117 |
|
---|
118 | includedep $(PATH_TARGET)/VBoxNetAdp-src-1.dep
|
---|
119 | $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \
|
---|
120 | $(PATH_SUB_CURRENT)/linux/Makefile \
|
---|
121 | $$(if $$(eq $$(VBoxNetAdp/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
122 | | $$(dir $$@)
|
---|
123 | ifndef VBOX_WITH_HARDENING
|
---|
124 | $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
|
---|
125 | else
|
---|
126 | $(QUIET)$(CP) -f $< $@
|
---|
127 | endif
|
---|
128 | %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetAdp-src-1.dep
|
---|
129 | %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetAdp-src-1.dep' 'VBoxNetAdp/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
|
---|
130 |
|
---|
131 | ## Scripts needed for building the kernel modules
|
---|
132 |
|
---|
133 | $$(VBoxNetAdp-sh_0_OUTDIR)/build_in_tmp: \
|
---|
134 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
|
---|
135 | $(VBOX_VERSION_STAMP) \
|
---|
136 | | $$(dir $$@)
|
---|
137 | $(call MSG_TOOL,Creating,,$@)
|
---|
138 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetadp;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
|
---|
139 | $(QUIET)chmod 0755 $@
|
---|
140 |
|
---|
141 | endif # linux
|
---|
142 |
|
---|
143 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
144 | #
|
---|
145 | # Install source files for compilation on FreeBSD.
|
---|
146 | # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
|
---|
147 | #
|
---|
148 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetadp
|
---|
149 | INSTALLS += VBoxNetAdp-src
|
---|
150 | VBoxNetAdp-src_INST = bin/src/vboxnetadp/
|
---|
151 | VBoxNetAdp-src_MODE = a+r,u+w
|
---|
152 | VBoxNetAdp-src_SOURCES = $(subst ",,$(VBOX_VBOXNETADP_SOURCES)) #"
|
---|
153 | VBoxNetAdp-src_SOURCES+= \
|
---|
154 | $(VBoxNetAdp-src_0_OUTDIR)/Makefile
|
---|
155 | VBoxNetAdp-src_CLEAN = \
|
---|
156 | $(VBoxNetAdp-src_0_OUTDIR)/Makefile \
|
---|
157 |
|
---|
158 | $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \
|
---|
159 | $(PATH_SUB_CURRENT)/freebsd/Makefile \
|
---|
160 | $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
161 | | $$(dir $$@)
|
---|
162 | ifndef VBOX_WITH_HARDENING
|
---|
163 | $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
|
---|
164 | else
|
---|
165 | $(QUIET)$(CP) -f $< $@
|
---|
166 | endif
|
---|
167 |
|
---|
168 | endif # freebsd
|
---|
169 |
|
---|
170 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
171 |
|
---|