2
#############################################################
3
# Copyright 2006 VMware, Inc. All rights reserved.
4
#############################################################
6
#### This program is free software; you can redistribute it and/or modify it
7
#### under the terms of the GNU General Public License as published by the
8
#### Free Software Foundation version 2 and no later version.
10
#### This program is distributed in the hope that it will be useful, but
11
#### WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
#### or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
#### for more details.
15
#### You should have received a copy of the GNU General Public License along
16
#### with this program; if not, write to the Free Software Foundation, Inc.,
17
#### 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#### VMware vmblock Makefile to be distributed externally
24
vm_check_build = $(shell if $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
25
$(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
26
-DKBUILD_BASENAME=\"$(DRIVER)\" \
27
-Werror -S -o /dev/null -xc $(1) \
28
> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
30
CC_WARNINGS := -Wall -Wstrict-prototypes
32
CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS)
34
CC_OPTS += -DVMW_USING_KBUILD
37
CC_OPTS += -DVMX86_DEVEL
40
CC_OPTS += -DVMX86_DEBUG
43
INCLUDE := -I$(SRCROOT)/include
45
EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
47
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
48
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, )
49
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/skas1.c, -DVMW_SKAS_MMAP, )
50
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, )
52
# Note: These tests are inverted.
53
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/getsb1.c, , -DVMW_GETSB_2618)
54
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/statfs1.c, , -DVMW_STATFS_2618)
55
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/filldir1.c, , -DVMW_FILLDIR_2618)
59
$(DRIVER)-y := $(subst $(SRCROOT)/, , $(patsubst %.c, %.o, $(wildcard $(SRCROOT)/linux/*.c)))
62
rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \
63
Module.symvers Modules.symvers \
64
$(foreach dir,./ linux/,$(addprefix $(dir),.*.cmd .*.o.flags *.o)))