source: trunk/packages/xen-3.1/xen-3.1/tools/vnet/vnet-module/Makefile @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 2.4 KB
Line 
1# -*- mode: Makefile; -*-
2#============================================================================
3#
4# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by the
8# Free Software Foundation; either version 2 of the License, or (at your
9# option) any later version.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free software Foundation, Inc.,
18# 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
19#============================================================================
20
21ifndef VNET_ROOT
22export VNET_ROOT = $(shell cd .. && pwd)
23include $(VNET_ROOT)/Make.env
24endif
25
26#============================================================================
27ifeq ($(src),)
28
29include Makefile-$(LINUX_SERIES)
30
31#============================================================================
32else
33#============================================================================
34# This section is for the 2.6 kbuild.
35
36#$(warning KBUILD_EXTMOD $(KBUILD_EXTMOD))
37#$(warning src $(src))
38#$(warning obj $(obj))
39
40include $(src)/Makefile.vnet
41
42obj-m = vnet_module.o
43vnet_module-objs = $(VNET_OBJ)
44vnet_module-objs += $(VNET_LIB_OBJ)
45
46#----------------------------------------------------------------------------
47# The fancy stuff in the kernel build defeats 'vpath %.c' so we can't
48# use that to get the lib files compiled.
49# Setup explicit rules for them using the kbuild C compile rule.
50
51# File names in the lib dir.
52remote_srcs = $(foreach file,$(VNET_LIB_SRC),$(LIBXUTIL_DIR)/$(file))
53
54# Equivalent file names here.
55local_srcs = $(foreach file,$(VNET_LIB_SRC),$(src)/$(file))
56
57# Objects for the local names.
58local_objs = $(local_srcs:.c=.o)
59
60# Make the local objects depend on compiling the remote sources.
61$(local_objs): $(src)/%.o: $(LIBXUTIL_DIR)/%.c
62        $(call if_changed_rule,cc_o_c)
63#----------------------------------------------------------------------------
64
65vpath %.h $(LIBXUTIL_DIR)
66EXTRA_CFLAGS += -I $(LIBXUTIL_DIR)
67EXTRA_CFLAGS += -I $(src)
68
69endif
70#============================================================================
71
Note: See TracBrowser for help on using the repository browser.