# $Id: Makefile.kmk 13435 2008-10-21 12:21:12Z vboxsync $ ## @file # Sub-Makefile for the Network Filter Driver (VBoxNetFlt). # # # Copyright (C) 2008 Sun Microsystems, Inc. # # Sun Microsystems, Inc. confidential # All rights reserved # SUB_DEPTH = ../../../.. 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/) if defined(VBOX_SIGNING_MODE) && "$(KBUILD_TARGET)" == "win" VBoxNetFlt_NOINST = true 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 ifdef VBOX_NETFLT_ONDEMAND_BIND VBoxNetFlt_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND endif 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_SOURCES.win.amd64 += win/VBoxNetFltA-win.asm VBoxNetFlt_DEFS.win.amd64 += RT_WITH_W64_UNWIND_HACK 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. ifeq ($(KBUILD_TARGET),darwin) INSTALLS += VBoxNetFlt.kext VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/ VBoxNetFlt.kext_SOURCES = \ $(PATH_VBoxNetFlt.kext)/Info.plist VBoxNetFlt.kext_CLEAN = \ $(PATH_VBoxNetFlt.kext)/Info.plist $$(PATH_VBoxNetFlt.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@) $(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' \ --output $@ \ $< INSTALLS.darwin += Scripts-darwin Scripts-darwin_INST = $(INST_DIST) Scripts-darwin_SOURCES = \ darwin/loadnetflt.sh endif # darwin # 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) | $$(dir $$@) $(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) | $$(dir $$@) $(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) | $$(dir $$@) $(INSTALL) -m 644 $< $(@D) $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \ $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.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) ## @todo vboxflt should resolves all the IPRT bits from vboxdrv. vboxnetflt_LIBS += \ $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c vboxnetflt_SOURCES = VBoxNetFlt.c endif include $(KBUILD_PATH)/subfooter.kmk