VirtualBox

Changeset 36462 in vbox for trunk/src/VBox/Additions


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

Location:
trunk/src/VBox/Additions/linux/installer
Files:
3 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
  • trunk/src/VBox/Additions/linux/installer/Makefile.include.header

    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
     
    2626# MOD_NAME = <name of the module to be built, without extension>
    2727# MOD_OBJS = <list of object files which should be included>
     28# MOD_DEFS = <any additional defines which this module needs>
     29# MOD_INCL = <any additional include paths which this module needs>
    2830# MOD_FLAGS = <any additional CFLAGS which this module needs>
     31# MOD_CLEAN = <list of directories that the clean target should look at>
    2932# include $(obj)/Makefile.include.footer
    3033#
     
    6265# While at it, warn about BUILD_* vars found to help with user problems.
    6366#
     67ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
     68 BUILD_TARGET_ARCH_DEF := amd64
     69else
     70 BUILD_TARGET_ARCH_DEF := x86
     71endif
    6472ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
    6573 $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
     
    7381   BUILD_TARGET_ARCH := x86
    7482  else
    75    ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
    76     BUILD_TARGET_ARCH := amd64
    77    else
    78     BUILD_TARGET_ARCH := x86
    79    endif
     83   BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
    8084  endif
    8185 endif
    8286else
    83  $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
     87 ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
     88  $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
     89 endif
    8490endif
    8591
     
    9197 BUILD_TYPE := release
    9298else
    93  $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
     99 ifneq ($(BUILD_TYPE),release)
     100  $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
     101 endif
    94102endif
  • trunk/src/VBox/Additions/linux/installer/Makefile.test.drm

    r32394 r36462  
    1717MOD_NAME = vboxadd_test_drm
    1818MOD_OBJS = test_drm.o
     19MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
     20MOD_CLEAN = . linux r0drv r0drv/linux
    1921# These are present in the shared folders Makefile but not the main one.
    2022# MOD_FLAGS = -DEXPORT_SYMTAB -DVBGL_VBOXGUEST -DRT_WITH_VBOX
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