~n-muench/ubuntu/saucy/open-vm-tools/open-vm-tools.fix-1175295

« back to all changes in this revision

Viewing changes to .pc/0001-kvers.patch/modules/linux/vsock/Makefile

Tags: 2012.12.26-958366-0ubuntu3
* Ubuntu-specific Changes
  - debian/rules: Added LIBS field with -lpthread.
    + Fixes package compile failure for Raring and future Ubuntu Releases.

* Items merged from Debian unstable:
  (From 2:9.2.2-893683-1 release)
  - Adding remote_fs dependency in initscript.
  - Correcting architecture fields in control.

  (From 2:9.2.2-893683-2 release)
  - Removing init order to network.

  (From 2:9.2.2-893683-4 release)
  - Removing init order to network also on start.

  (From 2:9.2.2-893683-5 release)
  - Updating to standards version 3.9.4.
  - Updating year in copyright file.
  - Prefixing patches with 4 digits for consistency.
  - Tightening diff headers in patches.
  - Dropping dpkg-source compression levels.

  (From 2:9.2.2-893683-6 release)
  - Remove all references to Daniel's old email address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
##########################################################
 
3
# Copyright (C) 1998 VMware, Inc. All rights reserved.
 
4
#
 
5
# This program is free software; you can redistribute it and/or modify it
 
6
# under the terms of the GNU General Public License as published by the
 
7
# Free Software Foundation version 2 and no later version.
 
8
#
 
9
# This program is distributed in the hope that it will be useful, but
 
10
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
11
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 
12
# for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License along
 
15
# with this program; if not, write to the Free Software Foundation, Inc.,
 
16
# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
17
#
 
18
##########################################################
 
19
 
 
20
####
 
21
####  VMware kernel module Makefile to be distributed externally
 
22
####
 
23
 
 
24
####
 
25
#### SRCROOT _must_ be a relative path.
 
26
####
 
27
SRCROOT = .
 
28
 
 
29
#
 
30
# open-vm-tools doesn't replicate shared source files for different modules;
 
31
# instead, files are kept in shared locations. So define a few useful macros
 
32
# to be able to handle both cases cleanly.
 
33
#
 
34
INCLUDE      :=
 
35
ifdef OVT_SOURCE_DIR
 
36
AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
 
37
VMLIB_PATH   = $(OVT_SOURCE_DIR)/lib/$(1)
 
38
INCLUDE      += -I$(OVT_SOURCE_DIR)/modules/linux/shared
 
39
INCLUDE      += -I$(OVT_SOURCE_DIR)/lib/include
 
40
else
 
41
AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
 
42
INCLUDE      += -I$(SRCROOT)/shared
 
43
endif
 
44
 
 
45
 
 
46
VM_UNAME = $(shell uname -r)
 
47
 
 
48
# Header directory for the running kernel
 
49
ifdef LINUXINCLUDE
 
50
HEADER_DIR = $(LINUXINCLUDE)
 
51
else
 
52
HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
 
53
endif
 
54
 
 
55
BUILD_DIR = $(HEADER_DIR)/..
 
56
 
 
57
DRIVER := vsock
 
58
PRODUCT := tools-source
 
59
 
 
60
# Grep program
 
61
GREP = /bin/grep
 
62
 
 
63
vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
 
64
        > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
 
65
vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)
 
66
 
 
67
ifndef VM_KBUILD
 
68
VM_KBUILD := no
 
69
ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
 
70
ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes)
 
71
VM_KBUILD := 26
 
72
endif
 
73
endif
 
74
export VM_KBUILD
 
75
endif
 
76
 
 
77
ifndef VM_KBUILD_SHOWN
 
78
ifeq ($(VM_KBUILD), no)
 
79
VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
 
80
else
 
81
ifeq ($(VM_KBUILD), 24)
 
82
VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.")
 
83
else
 
84
VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.")
 
85
endif
 
86
endif
 
87
VM_KBUILD_SHOWN := yes
 
88
export VM_KBUILD_SHOWN
 
89
endif
 
90
 
 
91
ifneq ($(VM_KBUILD), no)
 
92
 
 
93
VMCCVER := $(shell $(CC) -dumpversion)
 
94
 
 
95
# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
 
96
ifeq ($(VERSION),)
 
97
 
 
98
ifeq ($(VM_KBUILD), 24)
 
99
DRIVER_KO := $(DRIVER).o
 
100
else
 
101
DRIVER_KO := $(DRIVER).ko
 
102
endif
 
103
 
 
104
.PHONY: $(DRIVER_KO)
 
105
 
 
106
auto-build: $(DRIVER_KO)
 
107
        cp -f $< $(SRCROOT)/../$(DRIVER).o
 
108
 
 
109
# $(DRIVER_KO) is a phony target, so compare file times explicitly
 
110
$(DRIVER): $(DRIVER_KO)
 
111
        if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
 
112
 
 
113
# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
 
114
VM_CCVER := $(VMCCVER)
 
115
export VM_CCVER
 
116
VM_CC := $(CC)
 
117
export VM_CC
 
118
 
 
119
MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES))
 
120
 
 
121
#
 
122
# Define a setup target that gets built before the actual driver.
 
123
# This target may not be used at all, but if it is then it will be defined
 
124
# in Makefile.kernel
 
125
#
 
126
prebuild:: ;
 
127
postbuild:: ;
 
128
 
 
129
$(DRIVER_KO): prebuild
 
130
        $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
 
131
          MODULEBUILDDIR=$(MODULEBUILDDIR) modules
 
132
        $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
 
133
          MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
 
134
endif
 
135
 
 
136
vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
 
137
        $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
 
138
        $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
 
139
        -DKBUILD_BASENAME=\"$(DRIVER)\" \
 
140
        -Werror -S -o /dev/null -xc $(1) \
 
141
        > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
 
142
 
 
143
CC_WARNINGS := -Wall -Wstrict-prototypes
 
144
CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
 
145
ifdef VMX86_DEVEL
 
146
CC_OPTS += -DVMX86_DEVEL
 
147
endif
 
148
ifdef VMX86_DEBUG
 
149
CC_OPTS += -DVMX86_DEBUG
 
150
endif
 
151
 
 
152
include $(SRCROOT)/Makefile.kernel
 
153
 
 
154
ifdef TOPDIR
 
155
ifeq ($(VM_KBUILD), 24)
 
156
 
 
157
O_TARGET := $(DRIVER).o
 
158
 
 
159
obj-y := $($(DRIVER)-y)
 
160
 
 
161
include $(TOPDIR)/Rules.make
 
162
endif
 
163
endif
 
164
 
 
165
else
 
166
 
 
167
include $(SRCROOT)/Makefile.normal
 
168
 
 
169
endif
 
170
 
 
171
#.SILENT: