# $Id: Makefile.kmk 11935 2008-09-01 16:07:27Z vboxsync $ ## @file # Sub-Makefile for the Network Filter Driver (VBoxNetFlt). # # # Copyright (C) 2008 Sun Microsystems, Inc. # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa # Clara, CA 95054 USA or visit http://www.sun.com if you need # additional information or have any questions. # ifdef VBOX_KBUILD_HACKING SUB_DEPTH = ../../../.. else SUB_DEPTH = .. DEPTH ?= ../../../.. endif include $(KBUILD_PATH)/subheader.kmk if1of ($(KBUILD_TARGET), darwin win) # # VBoxNetFlt.sys - The mixed case driver. # SYSMODS += VBoxNetFlt VBoxNetFlt_TEMPLATE = VBOXR0DRV VBoxNetFlt_INST = $(INST_VBOXNETFLT)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/) ifdef VBOX_SIGNING_MODE ifeq ($(KBUILD_TARGET),win) VBoxNetFlt_NOINST = true endif endif VBoxNetFlt_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC VBoxNetFlt_SDKS.win = W2K3DDK WINPSDKINCS VBoxNetFlt_INCS := $(PATH_SUB_CURRENT) VBoxNetFlt_SOURCES.darwin = darwin/VBoxNetFlt-darwin.cpp VBoxNetFlt_SOURCES.win = win/VBoxNetFlt-win.c win/VBoxNetFlt-win.rc VBoxNetFlt_SOURCES = VBoxNetFlt.c VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded VBoxNetFlt_LDFLAGS.win.x86 = -Entry:DriverEntry@8 VBoxNetFlt_LDFLAGS.win.amd64 = -Entry:DriverEntry VBoxNetFlt_LIBS.win = \ $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \ $(PATH_SDK_W2K3DDK_LIB)/hal.lib \ $(PATH_SDK_W2K3DDK_LIB)/ndis.lib \ $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) VBoxNetFlt_LIBS = \ $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB) # Darwin extras. INSTALLS.darwin += VBoxNetFlt.kext VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/ VBoxNetFlt.kext_SOURCES = \ $(PATH_TARGET)/VBoxNetFlt/Info.plist VBoxNetFlt.kext_CLEAN = \ $(PATH_TARGET)/VBoxNetFlt/Info.plist $(PATH_TARGET)/VBoxNetFlt/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET)/VBoxNetFlt) $(call MSG_GENERATE,VBoxNetFlt,$@,$<) $(xQUIET)$(RM) -f $@ $(xQUIET)$(SED) \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ $< > $@ INSTALLS.darwin += Scripts-darwin Scripts-darwin_INST = $(INST_DIST) Scripts-darwin_SOURCES = \ darwin/loadnetflt.sh # Windows extras. INSTALLS.win += VBoxNetFlt-inf VBoxNetFlt-inf_INST = $(INST_BIN) VBoxNetFlt-inf_MODE = a+r,u+w VBoxNetFlt-inf_SOURCES = \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES) VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(call DIRDEP,$$(@D)) $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<) $(call VBOX_EDIT_INF_FN,$<,$@) $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt_m.inf $(MAKEFILE_CURRENT) | $$(call DIRDEP,$$(@D)) $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<) $(call VBOX_EDIT_INF_FN,$<,$@) ifdef VBOX_SIGNING_MODE VBoxNetFlt-inf_SOURCES += \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(TARGET_VBoxNetFlt) | $$(call DIRDEP,$$(@D)) $(INSTALL) -m 644 $< $(@D) $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<) $(call VBOX_MAKE_CAT_FN, $(@D),$@) endif # signing else if1of ($(KBUILD_TARGET), linux solaris) # # vboxnetflt(.ko/.o/) - The lower case driver. # Note! On Solaris the name has to be <= 8 chars long. # SYSMODS += vboxnetflt vboxnetflt_TEMPLATE = VBOXR0DRV vboxnetflt_NAME.solaris = vboxflt vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE vboxnetflt_DEFS = IN_RT_R0 vboxnetflt_INCS.linux := \ $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux vboxnetflt_INCS := \ $(PATH_SUB_CURRENT) vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv vboxnetflt_LIBS = \ $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB) if1of ($(KBUILD_TARGET),solaris) ## @todo vboxflt should resolve all the IPRT bits from vboxdrv. vboxnetflt_LIBS += \ $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) endif vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c vboxnetflt_SOURCES = VBoxNetFlt.c endif include $(KBUILD_PATH)/subfooter.kmk