Makefile.kmk revision 327441027a52879d8c0d9f92740efc2a84edfa01
af062818b47340eef15700d2f0211576ba3506eevboxsync# $Id$
af062818b47340eef15700d2f0211576ba3506eevboxsync## @file
af062818b47340eef15700d2f0211576ba3506eevboxsync# Makefile for the Cross Platform Guest Additions Driver.
af062818b47340eef15700d2f0211576ba3506eevboxsync#
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#
af062818b47340eef15700d2f0211576ba3506eevboxsync# Copyright (C) 2007 Sun Microsystems, Inc.
af062818b47340eef15700d2f0211576ba3506eevboxsync#
af062818b47340eef15700d2f0211576ba3506eevboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
af062818b47340eef15700d2f0211576ba3506eevboxsync# available from http://www.virtualbox.org. This file is free software;
af062818b47340eef15700d2f0211576ba3506eevboxsync# you can redistribute it and/or modify it under the terms of the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync# General Public License (GPL) as published by the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
af062818b47340eef15700d2f0211576ba3506eevboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
af062818b47340eef15700d2f0211576ba3506eevboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
af062818b47340eef15700d2f0211576ba3506eevboxsync#
af062818b47340eef15700d2f0211576ba3506eevboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
af062818b47340eef15700d2f0211576ba3506eevboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
af062818b47340eef15700d2f0211576ba3506eevboxsync# additional information or have any questions.
af062818b47340eef15700d2f0211576ba3506eevboxsync#
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncSUB_DEPTH = ../../../../..
af062818b47340eef15700d2f0211576ba3506eevboxsyncinclude $(KBUILD_PATH)/subheader.kmk
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncif1of ($(KBUILD_TARGET), \
af062818b47340eef15700d2f0211576ba3506eevboxsync freebsd \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(if $(defined VBOX_WITH_OS2_ADDITIONS),os2,) \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) \
af062818b47340eef15700d2f0211576ba3506eevboxsync solaris) # linux is not yet using this code, just for syntax checking changes.
af062818b47340eef15700d2f0211576ba3506eevboxsync #
af062818b47340eef15700d2f0211576ba3506eevboxsync # VBoxGuest - The Guest Additions Driver (mixed case).
af062818b47340eef15700d2f0211576ba3506eevboxsync #
af062818b47340eef15700d2f0211576ba3506eevboxsync SYSMODS += VBoxGuest
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_TEMPLATE = VBOXGUESTR0
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_NAME.freebsd = vboxguest
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_NAME.linux = vboxguest
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_NAME.solaris = vboxguest
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_NOINST.linux = true
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_INCS = .
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_INCS.freebsd = $(PATH_VBoxGuest)
af062818b47340eef15700d2f0211576ba3506eevboxsync ifneq ($(KBUILD_TARGET),os2)
af062818b47340eef15700d2f0211576ba3506eevboxsync ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
af062818b47340eef15700d2f0211576ba3506eevboxsync else
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
af062818b47340eef15700d2f0211576ba3506eevboxsync endif
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_SOURCES += VBoxGuest.cpp
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_LIBS = \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(VBOX_LIB_VBGL_R0BASE) \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(VBOX_LIB_IPRT_GUEST_R0)
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_INTERMEDIATES.freebsd = \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(PATH_VBoxGuest)/pci_if.h \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(PATH_VBoxGuest)/bus_if.h \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(PATH_VBoxGuest)/device_if.h
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_CLEAN.freebsd = $(VBoxGuest_INTERMEDIATES.freebsd)
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync else # OS/2:
af062818b47340eef15700d2f0211576ba3506eevboxsync # The library order is crucial, so a bit of trickery is necessary.
af062818b47340eef15700d2f0211576ba3506eevboxsync # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_SOURCES = \
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuestA-os2.asm \
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest-os2.def
af062818b47340eef15700d2f0211576ba3506eevboxsync #VBoxGuest_LDFLAGS = -s -t -v
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest_LIBS = \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(TARGET_VBoxGuestLibOs2Hack) \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(VBOX_LIB_VBGL_R0BASE) \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(VBOX_LIB_IPRT_GUEST_R0) \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(VBOX_GCC_LIBGCC) \
af062818b47340eef15700d2f0211576ba3506eevboxsync end
af062818b47340eef15700d2f0211576ba3506eevboxsync ## When debugging init with kDrvTest:
af062818b47340eef15700d2f0211576ba3506eevboxsync #VBoxGuest_NAME = VBoxGst
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync # see
af062818b47340eef15700d2f0211576ba3506eevboxsync LIBRARIES += VBoxGuestLibOs2Hack
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuestLibOs2Hack_NOINST = true
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuestLibOs2Hack_INCS = \
af062818b47340eef15700d2f0211576ba3506eevboxsync . \
af062818b47340eef15700d2f0211576ba3506eevboxsync $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuestLibOs2Hack_SOURCES = \
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest-os2.cpp \
af062818b47340eef15700d2f0211576ba3506eevboxsync VBoxGuest.cpp
af062818b47340eef15700d2f0211576ba3506eevboxsync endif # OS/2
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync ifeq ($(KBUILD_TARGET),freebsd)
af062818b47340eef15700d2f0211576ba3506eevboxsync #
af062818b47340eef15700d2f0211576ba3506eevboxsync # FreeBSD: Genereate bus, device and pci interface headers. (explain why)
af062818b47340eef15700d2f0211576ba3506eevboxsync #
af062818b47340eef15700d2f0211576ba3506eevboxsync # We cannot give a output path to the awk program, it will always generate
af062818b47340eef15700d2f0211576ba3506eevboxsync # the header next to the source. So, we'll have to temporarily copy the
af062818b47340eef15700d2f0211576ba3506eevboxsync # source file to the destination direction for it to work out correctly.
af062818b47340eef15700d2f0211576ba3506eevboxsync #
af062818b47340eef15700d2f0211576ba3506eevboxsync VBOX_AWK := /usr/bin/awk
af062818b47340eef15700d2f0211576ba3506eevboxsync $$(PATH_VBoxGuest)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/bus_if.m $(PATH_VBoxGuest)/bus_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/bus_if.m -h -p
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(RM) $(PATH_VBoxGuest)/bus_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync $$(PATH_VBoxGuest)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/device_if.m $(PATH_VBoxGuest)/device_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/device_if.m -h -p
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(RM) $(PATH_VBoxGuest)/device_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync $$(PATH_VBoxGuest)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m $(PATH_VBoxGuest)/pci_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/pci_if.m -h -p
af062818b47340eef15700d2f0211576ba3506eevboxsync $(QUIET)$(RM) $(PATH_VBoxGuest)/pci_if.m
af062818b47340eef15700d2f0211576ba3506eevboxsync endif # FreeBSD
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncendif # enabled
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncinclude $(KBUILD_PATH)/subfooter.kmk
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync