+++ /dev/null
-#!/usr/bin/make -f
-##########################################################
-# Copyright (C) 2006 VMware, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 and no later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-##########################################################
-
-####
-#### VMware vmblock Makefile to be distributed externally
-####
-
-vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
-
-####
-#### DESTDIR is where the module, object files, and dependencies are built
-####
-DESTDIR := driver-$(VM_UNAME)
-
-####
-#### DRIVERNAME should be untouched unless you have a good reason to change
-#### it. The form below is how the scripts expect it.
-####
-DRIVERNAME := $(DRIVER)-xxx-$(VM_UNAME)
-
-ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine)))
-MACHINE := x86_64
-else
-MACHINE := x386
-endif
-
-ifdef QUIET
-ECHO := @true
-else
-ECHO := @echo
-endif
-
-####
-#### You must compile with at least -O level of optimization
-#### or the module won't load.
-#### If desparate, I think that bringing in <linux/bitops.h> might
-#### suffice.
-####
-CC_WARNINGS := -Wall -Wstrict-prototypes
-# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
-CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \
- -fno-common -DKBUILD_MODNAME=$(DRIVER)
-CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \
- -malign-loops=2 -malign-jumps=2 -malign-functions=2)
-CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,)
-ifeq ($(MACHINE),x86_64)
-CC_KFLAGS += -mno-red-zone -mcmodel=kernel
-else
-# Gcc 3.0 deprecates -m486 --hpreg
-CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486)
-endif
-
-CC_OPTS := -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS)
-
-INCLUDE += -I$(SRCROOT)/include
-INCLUDE += -I$(SRCROOT)/linux
-INCLUDE += -I$(SRCROOT)/common
-INCLUDE += -I$(HEADER_DIR)
-
-INCLUDE += $(shell $(CC) $(INCLUDE) -E $(AUTOCONF_DIR)/geninclude.c \
- | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')
-
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/skas1.c, -DVMW_SKAS_MMAP, )
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/epoll.c, -DVMW_HAVE_EPOLL, )
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
-CC_OPTS += -DVMW_KMEMCR_HAS_DTOR
-
-LINUX_OBJS := module.o
-LINUX_OBJS += control.o
-LINUX_OBJS += filesystem.o
-LINUX_OBJS += super.o
-LINUX_OBJS += file.o
-LINUX_OBJS += inode.o
-LINUX_OBJS += dentry.o
-ifndef OVT_SOURCE_DIR
-LINUX_OBJS += block.o
-LINUX_OBJS += stubs.o
-LINUX_OBJS += dbllnklst.o
-endif
-LINUX_DEPS := ${LINUX_OBJS:.o=.d}
-OBJS := $(LINUX_OBJS)
-
-####
-#### Make Targets are beneath here.
-####
-
-driver: setup deps
- $(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) ../$(DRIVER).o \
- INCLUDE_DEPS=1
-
-setup:
- @if [ -d $(DESTDIR) ] ; then true ; else mkdir $(DESTDIR); chmod 755 $(DESTDIR) ; fi
-
-#
-# In open-vm-tools, need to compile the common sources from the lib directory.
-#
-ifdef OVT_SOURCE_DIR
-VMBLOCK_SHARED_PATH := $(OVT_SOURCE_DIR)/modules/shared/vmblock
-LIBMISC_PATH := $(call VMLIB_PATH,misc)
-
-LIBMISC := dbllnklst.o
-
-VMBLOCK_SHARED := block.o
-VMBLOCK_SHARED += stubs.o
-
-INCLUDE += -I$(VMBLOCK_SHARED_PATH)
-
-$(LIBMISC): %.o: $(LIBMISC_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-$(VMBLOCK_SHARED): %.o: $(VMBLOCK_SHARED_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-OBJS += $(LIBMISC)
-OBJS += $(VMBLOCK_SHARED)
-endif
-
-$(DRIVER) $(DRIVER).o ../$(DRIVER).o: $(DRIVERNAME)
- cp -f $< $@
-
-$(DRIVERNAME): $(OBJS)
- $(ECHO) "Building $(DRIVERNAME)"
- ld -r -o $(DRIVERNAME) $^
-
-auto-build:
- $(MAKE) driver QUIET=1
- cp -f $(DESTDIR)/$(DRIVERNAME) $(SRCROOT)/../$(DRIVER).o
-
-$(LINUX_OBJS): %.o: $(SRCROOT)/linux/%.c
- $(ECHO) "Compiling $<"
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-clean:
- rm -rf $(DESTDIR)/
-
-$(LINUX_DEPS): %.d: $(SRCROOT)/linux/%.c
- $(ECHO) "Dependencies for $<"
- $(CC) -MM $(CC_OPTS) $(INCLUDE) $< > $@
-
-deps: setup
- $(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) driver_deps
-
-driver_deps: ${LINUX_DEPS}
-
-ifdef INCLUDE_DEPS
-include ${LINUX_DEPS}
-endif
-
-.SILENT:
+++ /dev/null
-#!/usr/bin/make -f
-##########################################################
-# Copyright (C) 2005 VMware, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 and no later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-##########################################################
-
-####
-#### VMware vmci Makefile to be distributed externally
-####
-
-vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
-
-DRIVERNAME = $(DRIVER)-$(VM_UNAME)
-
-ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine)))
-MACHINE := x86_64
-else
-MACHINE := x386
-endif
-
-####
-#### You must compile with at least -O level of optimization
-#### or the module won't load.
-#### If desparate, I think that bringing in <linux/bitops.h> might
-#### suffice.
-####
-CC_WARNINGS := -Wall -Wstrict-prototypes
-# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
-CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \
- -fno-common -DKBUILD_MODNAME=$(DRIVER)
-CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \
- -malign-loops=2 -malign-jumps=2 -malign-functions=2)
-CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,)
-CC_KFLAGS += -DVMX86_TOOLS
-ifeq ($(MACHINE),x86_64)
-CC_KFLAGS += -mno-red-zone -mcmodel=kernel
-else
-# Gcc 3.0 deprecates -m486 --hpreg
-CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486)
-endif
-
-CC_OPTS := -g3 -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS)
-
-INCLUDE += -I. -I$(HEADER_DIR)
-
-INCLUDE += $(shell $(CC) $(CC_OPTS) $(INCLUDE) \
- -E $(AUTOCONF_DIR)/geninclude.c \
- | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')
-
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/epoll.c, -DVMW_HAVE_EPOLL, )
-
-OBJS := vmci_drv.o
-OBJS += vmciDatagram.o
-OBJS += vmciEvent.o
-OBJS += vmciProcess.o
-OBJS += vmciUtil.o
-OBJS += vmciKernelIf.o
-OBJS += vmciGuestKernelIf.o
-OBJS += vmciQueuePair.o
-OBJS += kernelStubsLinux.o
-OBJS += vmciGuestDs.o
-
-CFLAGS := $(CC_OPTS) $(INCLUDE)
-
-LIBS :=
-
-default: all
-
-#
-# In open-vm-tools, need to compile the common sources from the lib directory.
-#
-ifdef OVT_SOURCE_DIR
-kernelStubsLinux.o: $(OVT_SOURCE_DIR)/modules/linux/shared/kernelStubsLinux.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-else
-kernelStubsLinux.o: shared/kernelStubsLinux.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-endif
-
-all: $(DRIVER).o
-
-$(DRIVERNAME): $(OBJS)
- $(LD) -r -o $@ $^
-
-$(DRIVER) $(DRIVER).o ../$(DRIVER).o: $(DRIVERNAME)
- cp -f $< $@
-
-auto-build: ../$(DRIVER).o
-
-clean:
- rm -f $(DRIVERNAME) ../$(DRIVERNAME) $(DRIVER) $(OBJS)
-
-.SILENT:
+++ /dev/null
-#!/usr/bin/make -f
-##########################################################
-# Copyright (C) 1998 VMware, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 and no later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-##########################################################
-
-####
-#### VMware vmhgfs Makefile to be distributed externally
-####
-
-vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
-
-DRIVERNAME = $(DRIVER)-$(VM_UNAME)
-
-ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine)))
-MACHINE := x86_64
-else
-MACHINE := x386
-endif
-
-####
-#### You must compile with at least -O level of optimization
-#### or the module won't load.
-#### If desparate, I think that bringing in <linux/bitops.h> might
-#### suffice.
-####
-CC_WARNINGS := -Wall -Wstrict-prototypes
-# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
-CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \
- -fno-common -DKBUILD_MODNAME=$(DRIVER)
-CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \
- -malign-loops=2 -malign-jumps=2 -malign-functions=2)
-CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,)
-ifeq ($(MACHINE),x86_64)
-CC_KFLAGS += -mno-red-zone -mcmodel=kernel
-else
-# Gcc 3.0 deprecates -m486 --hpreg
-CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486)
-endif
-
-CC_OPTS := -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS)
-
-INCLUDE += -I. -I$(HEADER_DIR)
-
-INCLUDE += $(shell $(CC) $(INCLUDE) -E $(AUTOCONF_DIR)/geninclude.c \
- | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')
-
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/epoll.c, -DVMW_HAVE_EPOLL, )
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/maxbytes.c, -DVMW_SB_HAS_MAXBYTES, )
-CC_OPTS += -DVMW_KMEMCR_HAS_DTOR
-
-# Core driver components
-OBJS = bdhandler.o
-OBJS += dentry.o
-OBJS += dir.o
-OBJS += file.o
-OBJS += filesystem.o
-OBJS += fsutil.o
-OBJS += inode.o
-OBJS += link.o
-OBJS += module.o
-OBJS += page.o
-OBJS += request.o
-OBJS += stubs.o
-OBJS += super.o
-OBJS += tcp.o
-OBJS += transport.o
-
-# Additional components
-OBJS += backdoor.o
-OBJS += cpName.o
-OBJS += cpNameLinux.o
-OBJS += cpNameLite.o
-OBJS += hgfsBd.o
-OBJS += hgfsEscape.o
-OBJS += hgfsUtil.o
-OBJS += kernelStubsLinux.o
-OBJS += message.o
-OBJS += rpcout.o
-
-ifeq ($(MACHINE),x86_64)
-OBJS += backdoorGcc64.o
-else
-OBJS += backdoorGcc32.o
-endif
-
-CFLAGS := $(CC_OPTS) $(INCLUDE)
-
-LIBS :=
-
-default: all
-
-#
-# In open-vm-tools, need to compile the common sources from the lib directory.
-#
-ifdef OVT_SOURCE_DIR
-LIBBACKDOOR_PATH := $(call VMLIB_PATH,backdoor)
-LIBHGFS_PATH := $(call VMLIB_PATH,hgfs)
-LIBHGFSBD_PATH := $(call VMLIB_PATH,hgfsBd)
-LIBMESSAGE_PATH := $(call VMLIB_PATH,message)
-LIBRPCOUT_PATH := $(call VMLIB_PATH,rpcOut)
-STUBS_PATH := $(OVT_SOURCE_DIR)/modules/linux/shared
-VMHGFS_PATH := $(shell cd $(OVT_SOURCE_DIR)/modules/linux/vmhgfs && pwd)
-
-INCLUDE += -I$(LIBBACKDOOR_PATH)
-INCLUDE += -I$(LIBHGFS_PATH)
-
-LIBBACKDOOR := backdoor.o
-LIBBACKDOOR += backdoorGcc32.o
-LIBBACKDOOR += backdoorGcc64.o
-
-LIBHGFS := cpName.o
-LIBHGFS += cpNameLinux.o
-LIBHGFS += cpNameLite.o
-LIBHGFS += hgfsEscape.o
-LIBHGFS += hgfsUtil.o
-
-LIBHGFSBD := hgfsBd.o
-
-LIBMESSAGE := message.o
-
-LIBRPCOUT := rpcout.o
-
-STUBS := kernelStubsLinux.o
-
-$(LIBBACKDOOR): %.o: $(LIBBACKDOOR_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-$(LIBHGFS): %.o: $(LIBHGFS_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-$(LIBHGFSBD): %.o: $(LIBHGFSBD_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-$(LIBMESSAGE): %.o: $(LIBMESSAGE_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-$(LIBRPCOUT): %.o: $(LIBRPCOUT_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-$(STUBS): %.o: $(STUBS_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-else
-kernelStubsLinux.o: shared/kernelStubsLinux.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-endif
-
-all: ../$(DRIVER).o
-
-$(DRIVERNAME): $(OBJS)
- $(LD) -r -o $@ $^
-
-$(DRIVER) $(DRIVER).o ../$(DRIVER).o: $(DRIVERNAME)
- cp -f $< $@
-
-auto-build: ../$(DRIVER).o
-
-clean:
- rm -f $(DRIVERNAME) ../$(DRIVERNAME) $(DRIVER).o ../$(DRIVER).o $(DRIVER) $(OBJS)
-
-.SILENT:
+++ /dev/null
-#!/usr/bin/make -f
-##########################################################
-# Copyright (C) 1998 VMware, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 and no later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-##########################################################
-
-####
-#### VMware vmmemctl Makefile to be distributed externally
-####
-
-vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) \
- -Werror -S -o /dev/null -xc $(1) \
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
-
-DRIVERNAME = $(DRIVER)-$(VM_UNAME)
-
-ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine)))
-MACHINE := x86_64
-else
-MACHINE := x386
-endif
-
-####
-#### You must compile with at least -O level of optimization
-#### or the module won't load.
-#### If desparate, I think that bringing in <linux/bitops.h> might
-#### suffice.
-####
-CC_WARNINGS := -Wall -Wstrict-prototypes
-# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
-CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \
- -fno-common -DKBUILD_MODNAME=$(DRIVER)
-CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \
- -malign-loops=2 -malign-jumps=2 -malign-functions=2)
-CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,)
-ifeq ($(MACHINE),x86_64)
-CC_KFLAGS += -mno-red-zone -mcmodel=kernel
-else
-# Gcc 3.0 deprecates -m486 --hpreg
-CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486)
-endif
-
-INCLUDE += -I$(HEADER_DIR)
-ifeq ($(USE_SHARED_DIR),1)
-INCLUDE += -I$(call VMLIB_PATH,backdoor)
-endif
-
-
-INCLUDE += $(shell $(CC) $(CC_OPTS) $(INCLUDE) \
- -E $(AUTOCONF_DIR)/geninclude.c \
- | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')
-
-CC_OPTS := -g3 -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS)
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/epoll.c, -DVMW_HAVE_EPOLL, )
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
-
-OBJS += os.o
-OBJS += vmballoon.o
-
-ifeq ($(MACHINE),x86_64)
-OBJS += backdoorGcc64.o
-else
-OBJS += backdoorGcc32.o
-endif
-
-CFLAGS := $(CC_OPTS) $(INCLUDE)
-
-LIBS :=
-
-default: all
-
-#
-# In open-vm-tools, need to compile the common sources from the lib directory.
-#
-ifdef OVT_SOURCE_DIR
-LIBBACKDOOR_PATH := $(call VMLIB_PATH,backdoor)
-
-INCLUDE += -I$(LIBBACKDOOR_PATH)
-
-LIBBACKDOOR := backdoorGcc32.o
-LIBBACKDOOR += backdoorGcc64.o
-
-$(LIBBACKDOOR): %.o: $(LIBBACKDOOR_PATH)/%.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-endif
-
-all: ../$(DRIVER).o
-
-$(DRIVERNAME): $(OBJS)
- $(LD) -r -o $@ $^
-
-$(DRIVER) $(DRIVER).o ../$(DRIVER).o: $(DRIVERNAME)
- cp -f $< $@
-
-auto-build: ../$(DRIVER).o
-
-clean:
- rm -f $(DRIVERNAME) ../$(DRIVERNAME) $(DRIVER) $(DRIVER).o ../$(DRIVER).o $(OBJS)
-
-.SILENT:
+++ /dev/null
-#!/usr/bin/make -f
-##########################################################
-# Copyright (C) 1998 VMware, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 and no later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-##########################################################
-
-####
-#### VMware vmxnet Makefile to be distributed externally
-####
-
-vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
-
-DRIVERNAME = $(DRIVER)-$(VM_UNAME)
-
-ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine)))
-MACHINE := x86_64
-else
-MACHINE := x386
-endif
-
-####
-#### You must compile with at least -O level of optimization
-#### or the module won't load.
-#### If desparate, I think that bringing in <linux/bitops.h> might
-#### suffice.
-####
-CC_WARNINGS := -Wall -Wstrict-prototypes
-# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
-CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \
- -fno-common -DKBUILD_MODNAME=$(DRIVER)
-CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \
- -malign-loops=2 -malign-jumps=2 -malign-functions=2)
-CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,)
-ifeq ($(MACHINE),x86_64)
-CC_KFLAGS += -mno-red-zone -mcmodel=kernel
-else
-# Gcc 3.0 deprecates -m486 --hpreg
-CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486)
-endif
-
-CC_OPTS := -g3 -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS)
-
-INCLUDE += -I$(HEADER_DIR)
-
-INCLUDE += $(shell $(CC) $(CC_OPTS) $(INCLUDE) \
- -E $(AUTOCONF_DIR)/geninclude.c \
- | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')
-
-ifdef OVT_SOURCE_DIR
-INCLUDE += -I$(OVT_SOURCE_DIR)/modules/shared/vmxnet
-endif
-
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/skblin.c, -DVMW_SKB_LINEARIZE_2618, )
-
-OBJS := vmxnet.o
-
-CFLAGS := $(CC_OPTS) $(INCLUDE)
-
-LIBS :=
-
-default: all
-
-all: ../$(DRIVER).o
-
-$(DRIVERNAME): $(OBJS)
- $(LD) -r -o $@ $^
-
-$(DRIVER) ../$(DRIVER).o: $(DRIVERNAME)
- cp -f $< $@
-
-auto-build: ../$(DRIVER).o
-
-clean:
- rm -f $(DRIVERNAME) ../$(DRIVERNAME) $(DRIVER) ../$(DRIVER).o $(DRIVER).o $(OBJS)
-
-.SILENT:
+++ /dev/null
-#!/usr/bin/make -f
-##########################################################
-# Copyright (C) 2007 VMware, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation version 2 and no later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-##########################################################
-
-vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
-
-vm_product_defines = $(if $(findstring tools,$(1)), -DVMX86_TOOLS,)
-
-####
-#### DESTDIR is where the module, object files, and dependencies are built
-####
-DESTDIR := driver-$(VM_UNAME)
-
-####
-#### DRIVERNAME should be untouched unless you have a good reason to change
-#### it. The form below is how the scripts expect it.
-####
-DRIVERNAME := $(DRIVER)-xxx-$(VM_UNAME)
-
-ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine)))
-MACHINE := x86_64
-else
-MACHINE := x386
-endif
-
-ifdef QUIET
-ECHO := @true
-else
-ECHO := @echo
-endif
-
-####
-#### You must compile with at least -O level of optimization
-#### or the module won't load.
-#### If desparate, I think that bringing in <linux/bitops.h> might
-#### suffice.
-####
-CC_WARNINGS := -Wall -Wstrict-prototypes
-# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die
-CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \
- -fno-common -DKBUILD_MODNAME=$(DRIVER)
-CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \
- -malign-loops=2 -malign-jumps=2 -malign-functions=2)
-CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,)
-CC_KFLAGS += $(call vm_product_defines, $(PRODUCT))
-ifeq ($(MACHINE),x86_64)
-CC_KFLAGS += -mno-red-zone -mcmodel=kernel
-else
-# Gcc 3.0 deprecates -m486 --hpreg
-CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486)
-endif
-
-CC_OPTS := -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS)
-
-INCLUDE += -I$(SRCROOT)/include
-INCLUDE += -I$(SRCROOT)/linux
-INCLUDE += -I$(SRCROOT)/common
-INCLUDE += -I$(HEADER_DIR)
-
-INCLUDE += $(shell $(CC) $(INCLUDE) -E $(AUTOCONF_DIR)/geninclude.c \
- | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')
-
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/skas1.c, -DVMW_SKAS_MMAP, )
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/epoll.c, -DVMW_HAVE_EPOLL, )
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
-
-# This test is inverted.
-CC_OPTS += $(call vm_check_build, $(AUTOCONF_DIR)/sk_filter.c,, -DVMW_HAVE_NEW_SKFILTER )
-
-CC_OPTS += -DVMW_KMEMCR_HAS_DTOR
-
-LINUX_OBJS := af_vsock.o
-LINUX_OBJS += vsockAddr.o
-LINUX_OBJS += util.o
-LINUX_OBJS += driverLog.o
-LINUX_DEPS := ${LINUX_OBJS:.o=.d}
-OBJS := $(LINUX_OBJS)
-
-ifdef OVT_SOURCE_PATH
-driverLog.o: $(OVT_SOURCE_DIR)/modules/linux/shared/driverLog.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-else
-driverLog.o: shared/driverLog.c
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-endif
-
-####
-#### Make Targets are beneath here.
-####
-
-driver: setup deps
- $(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) $(DRIVERNAME) \
- INCLUDE_DEPS=1
-
-setup:
- @if [ -d $(DESTDIR) ] ; then true ; else mkdir $(DESTDIR); chmod 755 $(DESTDIR) ; fi
-
-$(DRIVER): $(DRIVERNAME)
- cp -f $< $@
-
-$(DRIVERNAME): $(OBJS)
- $(ECHO) "Building $(DRIVERNAME)"
- ld -r -o $(DRIVERNAME) $^
-
-auto-build:
- $(MAKE) driver QUIET=1
- cp -f $(DESTDIR)/$(DRIVERNAME) $(SRCROOT)/../$(DRIVER).o
-
-$(LINUX_OBJS): %.o: $(SRCROOT)/linux/%.c
- $(ECHO) "Compiling $<"
- $(CC) $(CC_OPTS) $(INCLUDE) -c $<
-
-clean:
- rm -rf $(DESTDIR)/
-
-$(LINUX_DEPS): %.d: $(SRCROOT)/linux/%.c
- $(ECHO) "Dependencies for $<"
- $(CC) -MM $(CC_OPTS) $(INCLUDE) $< > $@
-
-deps: setup
- $(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) driver_deps
-
-driver_deps: ${OBJS:.o=.d}
-
-ifdef INCLUDE_DEPS
-include ${OBJS:.o=.d}
-endif
-
-.SILENT: