ia64/xen-unstable

view xen/Rules.mk @ 4166:aeccd691af4c

bitkeeper revision 1.1236.34.7 (423735acABhfn7rysHwGJkcVOLD6GA)

XCS cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 15 19:21:16 2005 +0000 (2005-03-15)
parents 3236c27b9832
children 8ba8ae4eba9b
line source
2 verbose ?= n
3 debug ?= n
4 perfc ?= n
5 trace ?= n
6 optimize ?= y
7 domu_debug ?= n
8 crash_debug ?= n
10 # Currently supported architectures: x86_32, x86_64
11 XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/)
12 XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH)
14 # Set ARCH/SUBARCH appropriately.
15 override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
16 override TARGET_SUBARCH := $(XEN_TARGET_ARCH)
17 override COMPILE_ARCH := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
18 override TARGET_ARCH := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
20 TARGET := $(BASEDIR)/xen
21 HDRS := $(wildcard $(BASEDIR)/include/xen/*.h)
22 HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
23 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
24 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
25 # Do not depend on auto-generated header files.
26 HDRS := $(subst $(BASEDIR)/include/asm-$(TARGET_ARCH)/asm-offsets.h,,$(HDRS))
27 HDRS := $(subst $(BASEDIR)/include/xen/banner.h,,$(HDRS))
28 HDRS := $(subst $(BASEDIR)/include/xen/compile.h,,$(HDRS))
30 C_SRCS := $(wildcard *.c)
31 S_SRCS := $(wildcard *.S)
32 OBJS := $(patsubst %.S,%.o,$(S_SRCS))
33 OBJS += $(patsubst %.c,%.o,$(C_SRCS))
35 # Note that link order matters!
36 ALL_OBJS := $(BASEDIR)/common/common.o
37 ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
38 ALL_OBJS += $(BASEDIR)/drivers/acpi/driver.o
39 ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
40 ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
42 HOSTCC = gcc
43 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
45 test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1))
47 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
49 ifneq ($(debug),y)
50 CFLAGS += -DNDEBUG
51 ifeq ($(verbose),y)
52 CFLAGS += -DVERBOSE
53 endif
54 else
55 CFLAGS += -DVERBOSE
56 endif
58 ifeq ($(domu_debug),y)
59 CFLAGS += -DDOMU_DEBUG
60 endif
62 ifeq ($(crash_debug),y)
63 CFLAGS += -g -DCRASH_DEBUG
64 endif
66 ifeq ($(perfc),y)
67 CFLAGS += -DPERF_COUNTERS
68 endif
70 ifeq ($(trace),y)
71 CFLAGS += -DTRACE_BUFFER
72 endif
74 CFLAGS := $(strip $(CFLAGS))
76 %.o: %.c $(HDRS) Makefile
77 $(CC) $(CFLAGS) -c $< -o $@
79 %.o: %.S $(HDRS) Makefile
80 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@