VirtualBox

Ignore:
Timestamp:
Mar 29, 2011 3:19:19 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70846
Message:

Additions/linux: update kernel module makefile split header and footer in preparation for using them with vboxguest.ko

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/Makefile.include.footer

    r28998 r36462  
    44# (For 2.6.x, the main file must be called 'Makefile'!)
    55#
    6 # Copyright (C) 2006-2007 Oracle Corporation
     6# Copyright (C) 2006-2011 Oracle Corporation
    77#
    88# This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323# MOD_NAME = <name of the module to be built, without extension>
    2424# MOD_OBJS = <list of object files which should be included>
     25# MOD_DEFS = <any additional defines which this module needs>
     26# MOD_INCL = <any additional include paths which this module needs>
    2527# MOD_FLAGS = <any additional CFLAGS which this module needs>
     28# MOD_CLEAN = <list of directories that the clean target should look at>
    2629#
    2730# The kmk kBuild define KBUILD_TARGET_ARCH is available.
     
    121124
    122125 # guess kernel version (24 or 26)
    123  ifeq ($(shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes)
     126# MOD_OBJS = <list of object files which should be included>
     127 ifeq ($(shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes)
    124128  KERN_VERSION := 24
    125129 else
     
    147151  KBUILD_EXTMOD := $(shell pwd)
    148152 endif
    149  INCL    += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     153 INCL    += $(MOD_INCL)
    150154 export INCL
    151155endif
    152 KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 \
    153             -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM \
    154             -DLOG_TO_BACKDOOR -DRT_WITH_VBOX -DIN_MODULE -DIN_GUEST_R0
     156KFLAGS   := -D__KERNEL__ -DMODULE \
     157                -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_MODULE \
     158                -DRT_WITH_VBOX $(MOD_DEFS)
    155159ifeq ($(BUILD_TARGET_ARCH),amd64)
    156160 KFLAGS  += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
     
    167171#
    168172
    169 CFLAGS := -O2 -DVBOX_LINUX_2_4 -DEXPORT_SYMTAB $(INCL) $(KFLAGS) $(KDEBUG)
     173ifeq ($(BUILD_TARGET_ARCH),amd64)
     174 KFLAGS  += -mcmodel=kernel
     175endif
     176
     177CFLAGS := -O2 -DVBOX_LINUX_2_4 -DEXPORT_SYMTAB $(INCL) $(KFLAGS) $(KDEBUG) \
     178                $(MOD_CFLAGS)
    170179MODULE_EXT := o
    171180
     
    188197
    189198# build defs
    190 EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG)
     199EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG) $(MOD_CFLAGS)
    191200
    192201all: $(MODULE)
     
    207216
    208217clean:
    209         for f in . linux r0drv r0drv/linux; do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
     218        for f in $(MOD_CLEAN); do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
    210219        rm -rf .$(MOD_NAME)* .tmp_ver* $(MOD_NAME).* Module.symvers Modules.symvers modules.order
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette