d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync# $Revision$
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync## @file
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# VirtualBox Guest Additions Module Makefile.
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync#
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync#
f5fc6d91e150cd61b1758c89b31d915270134385vboxsync# Copyright (C) 2006-2015 Oracle Corporation
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync#
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# available from http://www.virtualbox.org. This file is free software;
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# you can redistribute it and/or modify it under the terms of the GNU
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# General Public License (GPL) as published by the Free Software
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync#
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsync# Linux kbuild sets this to our source directory if we are called from there
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncobj ?= $(CURDIR)
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncinclude $(obj)/Makefile.include.header
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncMOD_NAME = vboxguest
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncMOD_OBJS = \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync VBoxGuest-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync VBoxGuest.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync GenericRequest.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync HGCMInternal.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync Init.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync PhysHeap.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync SysHlp.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync VMMDev.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/alloc-r0drv.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/initterm-r0drv.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/memobj-r0drv.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/mpnotification-r0drv.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/powernotification-r0drv.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/alloc-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/assert-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/initterm-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/memobj-r0drv-linux.o \
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync r0drv/linux/memuserkernel-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/mp-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/mpnotification-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/process-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/semevent-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/semeventmulti-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/semfastmutex-r0drv-linux.o \
5a4d5e0a9fbeedae85826992b32e19a14fe4c01bvboxsync r0drv/linux/semmutex-r0drv-linux.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync r0drv/linux/spinlock-r0drv-linux.o \
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync r0drv/linux/thread-r0drv-linux.o \
e91f2a55ed5a30342ec79ce273f3f4bad8283336vboxsync r0drv/linux/thread2-r0drv-linux.o \
40b7f0c2d3f97e0c6171f34f96ec3e05eea44d72vboxsync r0drv/linux/time-r0drv-linux.o \
ac2f8170e087931242786c8fe40ba16f457e18e0vboxsync r0drv/linux/timer-r0drv-linux.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync r0drv/linux/RTLogWriteDebugger-r0drv-linux.o \
78df3a3ca20e014e0d9eb72cd7bb72711255d5f6vboxsync r0drv/generic/semspinmutex-r0drv-generic.o \
e43535ace2499e7f8ef8822186047979bd58d464vboxsync common/alloc/alloc.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/err/RTErrConvertFromErrno.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/err/RTErrConvertToErrno.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/log/log.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/log/logellipsis.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/log/logrel.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/log/logrelellipsis.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/log/logcom.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/log/logformat.o \
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync common/misc/RTAssertMsg1Weak.o \
b6cc138b99f86c2d29ecfe32cecf9f68ba5e73afvboxsync common/misc/RTAssertMsg2.o \
0e5731ab59b4ecead38375f26eeea698f00b19fdvboxsync common/misc/RTAssertMsg2Add.o \
0e5731ab59b4ecead38375f26eeea698f00b19fdvboxsync common/misc/RTAssertMsg2AddWeak.o \
0e5731ab59b4ecead38375f26eeea698f00b19fdvboxsync common/misc/RTAssertMsg2AddWeakV.o \
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync common/misc/RTAssertMsg2Weak.o \
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync common/misc/RTAssertMsg2WeakV.o \
a7aa94e0115a73841f34ebbfa00f63fa1904e51fvboxsync common/misc/assert.o \
e91f2a55ed5a30342ec79ce273f3f4bad8283336vboxsync common/misc/thread.o \
32bf313cd8c0de52ef27b486f15945c55c94b038vboxsync common/string/RTStrCopy.o \
210db75d2af02f67370c4a1be6570484d29eb394vboxsync common/string/RTStrCopyEx.o \
e66c95fa9950a4d9c567db63a4a495bf086cc4bfvboxsync common/string/RTStrCopyP.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/string/strformat.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/string/strformatrt.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/string/strformattype.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/string/strprintf.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/string/strtonum.o \
e91f2a55ed5a30342ec79ce273f3f4bad8283336vboxsync common/table/avlpv.o \
bec9452711598b56e648192360cab88a6c3535e8vboxsync common/time/time.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync generic/RTAssertShouldPanic-generic.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync generic/RTLogWriteStdErr-stub-generic.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync generic/RTLogWriteStdOut-stub-generic.o \
111813bde8cc78d626b8d6fb3f6db67bd1b76da3vboxsync generic/RTMpGetCoreCount-generic.o \
683eff3070b1b86fe71b71af7fda82766ea19d17vboxsync generic/RTSemEventWait-2-ex-generic.o \
683eff3070b1b86fe71b71af7fda82766ea19d17vboxsync generic/RTSemEventWaitNoResume-2-ex-generic.o \
d1c36fd86d36726777e3d6f9d040573e0aaf30devboxsync generic/RTSemEventMultiWait-2-ex-generic.o \
d1c36fd86d36726777e3d6f9d040573e0aaf30devboxsync generic/RTSemEventMultiWaitNoResume-2-ex-generic.o \
ab455939477d81b7bb500586f88029d3a3c0b34cvboxsync generic/errvars-generic.o \
111813bde8cc78d626b8d6fb3f6db67bd1b76da3vboxsync generic/mppresent-generic.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync VBox/log-vbox.o \
d94da006d266643454eaeeb7e54c7c4a06bff515vboxsync VBox/logbackdoor.o
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsyncifeq ($(BUILD_TARGET_ARCH),x86)
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncMOD_OBJS += \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/math/gcc/divdi3.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/math/gcc/moddi3.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/math/gcc/udivdi3.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/math/gcc/umoddi3.o \
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsync common/math/gcc/qdivrem.o
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsyncendif
d67d8d3162b0d9cac99842fc7da74e8371453046vboxsyncifeq ($(BUILD_TARGET_ARCH),amd64)
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncMOD_OBJS += common/alloc/heapsimple.o
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsyncendif
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync
2f655f58f4f10aed9b9b07d1379093ef469ba682vboxsyncMOD_DEFS = -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST \
2f655f58f4f10aed9b9b07d1379093ef469ba682vboxsync -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST \
2f655f58f4f10aed9b9b07d1379093ef469ba682vboxsync -DVBOX_WITH_HGCM
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncifeq ($(BUILD_TARGET_ARCH),amd64)
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsync MOD_DEFS += -DRT_ARCH_AMD64
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncelse
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsync MOD_DEFS += -DRT_ARCH_X86
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsyncendif
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncifeq ($(BUILD_TARGET_ARCH),amd64)
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsync MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsyncendif
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncMOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncMOD_INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxguest,/ /include /r0drv/linux)
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsync
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsyncifneq ($(wildcard $(KBUILD_EXTMOD)/vboxguest),)
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsync MANGLING := $(KBUILD_EXTMOD)/vboxguest/include/VBox/VBoxGuestMangling.h
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsyncelse
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsync MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h
b39c3fa81cadaec00ebb2e7170a8db96998b7032vboxsyncendif
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncifeq ($(KERN_VERSION),24)
2f655f58f4f10aed9b9b07d1379093ef469ba682vboxsync ## @todo move to MOD_DEFS when we have finished refactoring
2f655f58f4f10aed9b9b07d1379093ef469ba682vboxsync MOD_CFLAGS = -DEXPORT_SYMTAB
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsyncelse
317afd8ab14633faf6af4cfc0074b7476ba636c2vboxsync MOD_CFLAGS = -Wno-declaration-after-statement -include $(MANGLING)
f1630a6818621238c9c2338394b44995e318e108vboxsyncendif
f1630a6818621238c9c2338394b44995e318e108vboxsync
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncMOD_CLEAN = . linux r0drv generic r0drv/linux r0drv/generic VBox \
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsync common/alloc common/err common/log common/math/gcc common/misc \
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsync common/string common/time
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsyncinclude $(obj)/Makefile.include.footer
37136b5ecb07042e5ba50f86849a79d1cba5d5f1vboxsync
c14daac2bac51584dd4b94bf9ab51ed5b6f654aavboxsynccheck: $(MOD_NAME)
715e49c31b15c23c17a9ce3be42a75e7c48d4b78vboxsync @if ! readelf -p __ksymtab_strings vboxguest.ko | grep -E "\[.*\] *(RT|g_..*RT.*)"; then \
715e49c31b15c23c17a9ce3be42a75e7c48d4b78vboxsync echo "All exported IPRT symbols are properly renamed!"; \
715e49c31b15c23c17a9ce3be42a75e7c48d4b78vboxsync else \
715e49c31b15c23c17a9ce3be42a75e7c48d4b78vboxsync echo "error: Some exported IPRT symbols was not properly renamed! See above." >&2; \
715e49c31b15c23c17a9ce3be42a75e7c48d4b78vboxsync false; \
715e49c31b15c23c17a9ce3be42a75e7c48d4b78vboxsync fi