Makefile.kmk revision b29e03c9044019d9c77222336e8f8616052824f5
# $Id$
## @file
# Makefile for the Cross Platform Guest Additions Driver.
#
#
# Copyright (C) 2007 innotek GmbH
#
# 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.
#
DEPTH ?= ../../../../..
SUB_DEPTH = ../..
include $(PATH_KBUILD)/subheader.kmk
# PORTME: OSes using mixed case driver names join OS/2, the others join Solaris below.
if1of ($(BUILD_TARGET),os2)
#
# VBoxGuest - The Guest Additions Driver (mixed case).
#
ifdef VBOX_WITH_OS2_ADDITIONS
SYSMODS.os2 += VBoxGuest
LIBRARIES += VBoxGuestLibOs2Hack
endif
VBoxGuest_TEMPLATE = VBOXGUESTR0
VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_HGCM
VBoxGuest_INCS := $(PATH_SUB_CURRENT)
ifneq ($(BUILD_TARGET),os2)
VBoxGuest_SOURCES = \
VBoxGuest-$(BUILD_TARGET).cpp \
VBoxGuest.cpp
VBoxGuest_LIBS = \
$(VBOX_LIB_VBGL_R0BASE) \
$(VBOX_LIB_IPRT_GUEST_R0)
else # OS/2:
# The library order is crusial, so a bit of trickery is necessary.
# A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
VBoxGuest_SOURCES = \
VBoxGuestA-os2.asm \
VBoxGuest-os2.def
#VBoxGuest_LDFLAGS = -s -t -v
VBoxGuest_LIBS = \
$(TARGET_VBoxGuestLibOs2Hack) \
$(VBOX_LIB_VBGL_R0BASE) \
$(VBOX_LIB_IPRT_GUEST_R0) \
$(VBOX_GCC_LIBGCC) \
end
## When debugging init with kDrvTest:
#VBoxGuest_NAME = VBoxGst
VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
VBoxGuestLibOs2Hack_NOINST = 1
VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
VBoxGuestLibOs2Hack_INCS := \
$(PATH_SUB_CURRENT) \
$(PATH_TARGET) \
$(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
VBoxGuestLibOs2Hack_SOURCES = \
VBoxGuest-os2.cpp \
VBoxGuest.cpp
endif # OS/2
else if1of ($(BUILD_TARGET),solaris)
#
# vboxguest - The Guest Additions Driver (lower cased).
#
SYSMODS.solaris += vboxguest
vboxguest_TEMPLATE = VBOXGUESTR0
vboxguest_DEFS = VBGL_VBOXGUEST VBOX_HGCM
vboxguest_INCS := $(PATH_SUB_CURRENT)
vboxguest_SOURCES = \
VBoxGuest-$(BUILD_TARGET).c \
VBoxGuest.cpp
vboxguest_LIBS = \
$(VBOX_LIB_VBGL_R0BASE) \
$(VBOX_LIB_IPRT_GUEST_R0)
else if1of ($(BUILD_TARGET),freebsd)
#
# vboxguest - The Guest Additions Driver
#
SYSMODS.freebsd += vboxguest
vboxguest_TEMPLATE = VBOXGUESTR0
vboxguest_DEFS = VBGL_VBOXGUEST VBOX_HGCM
vboxguest_INCS = \
$(PATH_SUB_CURRENT) \
$(PATH_TARGET)
vboxguest_DEPS = \
$(PATH_TARGET)/pci_if.h \
$(PATH_TARGET)/bus_if.h \
$(PATH_TARGET)/device_if.h
vboxguest_SOURCES = \
VBoxGuest-$(BUILD_TARGET).c \
VBoxGuest.cpp
vboxguest_LIBS = \
$(VBOX_LIB_VBGL_R0BASE) \
$(VBOX_LIB_IPRT_GUEST_R0)
vboxguest_CLEAN += \
$(PATH_TARGET)/pci_if.h \
$(PATH_TARGET)/bus_if.h \
$(PATH_TARGET)/device_if.h
# We need to generate some headers with awk to make building work
VBOX_AWKCMD := /usr/bin/awk
# We cannot give a path to the awk program where the header should be generated but can only
# make it produce the header at the location of the source file rather than in the current directory.
# Thatshwy we copy the source file to the destination of the header first and execute the program with the copied file
# afterwards.
$(PATH_TARGET)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m
$(call MSG_TOOL,awk,VBoxGuest,$<,$@)
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/bus_if.m $(PATH_TARGET)/bus_if.m
$(QUIET)$(VBOX_AWKCMD) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_TARGET)/bus_if.m -h -p
$(QUIET)$(RM) $(PATH_TARGET)/bus_if.m
$(PATH_TARGET)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m
$(call MSG_TOOL,awk,VBoxGuest,$<,$@)
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/device_if.m $(PATH_TARGET)/device_if.m
$(QUIET)$(VBOX_AWKCMD) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_TARGET)/device_if.m -h -p
$(QUIET)$(RM) $(PATH_TARGET)/device_if.m
$(PATH_TARGET)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m
$(call MSG_TOOL,awk,VBoxGuest,$<,$@)
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m $(PATH_TARGET)/pci_if.m
$(QUIET)$(VBOX_AWKCMD) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_TARGET)/pci_if.m -h -p
$(QUIET)$(RM) $(PATH_TARGET)/pci_if.m
endif
include $(PATH_KBUILD)/subfooter.kmk