debuggers.hg

view xen/Rules.mk @ 3629:96a5638d65e5

bitkeeper revision 1.1159.212.58 (41fb7bc3vOj1TsfbXqfUKqcc2wjisA)

Merge viper.(none):/home/kaf24/xen-2.0-testing.bk
into viper.(none):/home/kaf24/xen-unstable.bk
author kaf24@viper.(none)
date Sat Jan 29 12:04:19 2005 +0000 (2005-01-29)
parents 30ee9c427a5b 48cc820f2cff
children bbe8541361dd 4294cfa9fad3
line source
2 verbose ?= n
3 debug ?= n
4 debugger ?= n
5 perfc ?= n
6 trace ?= n
7 optimize ?= y
9 # Currently supported architectures: x86_32, x86_64
10 COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/)
11 TARGET_ARCH ?= $(COMPILE_ARCH)
13 # Set ARCH/SUBARCH appropriately.
14 override COMPILE_SUBARCH := $(COMPILE_ARCH)
15 override TARGET_SUBARCH := $(TARGET_ARCH)
16 override COMPILE_ARCH := $(patsubst x86%,x86,$(COMPILE_ARCH))
17 override TARGET_ARCH := $(patsubst x86%,x86,$(TARGET_ARCH))
19 TARGET := $(BASEDIR)/xen
20 HDRS := $(wildcard $(BASEDIR)/include/xen/*.h)
21 HDRS += $(wildcard $(BASEDIR)/include/scsi/*.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 # compile.h is always regenerated, but other files shouldn't be rebuilt
26 HDRS := $(subst $(BASEDIR)/include/xen/banner.h,,$(HDRS))
27 HDRS := $(subst $(BASEDIR)/include/xen/compile.h,,$(HDRS))
29 C_SRCS := $(wildcard *.c)
30 S_SRCS := $(wildcard *.S)
31 OBJS := $(patsubst %.S,%.o,$(S_SRCS))
32 OBJS += $(patsubst %.c,%.o,$(C_SRCS))
34 # Note that link order matters!
35 ALL_OBJS := $(BASEDIR)/common/common.o
36 ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
37 ALL_OBJS += $(BASEDIR)/drivers/acpi/driver.o
38 ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
39 ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
41 HOSTCC = gcc
42 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
44 test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1))
46 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
48 ifneq ($(debug),y)
49 CFLAGS += -DNDEBUG
50 ifeq ($(verbose),y)
51 CFLAGS += -DVERBOSE
52 endif
53 else
54 CFLAGS += -DVERBOSE
55 endif
57 ifeq ($(debugger),y)
58 CFLAGS += -DXEN_DEBUGGER
59 endif
61 ifeq ($(perfc),y)
62 CFLAGS += -DPERF_COUNTERS
63 endif
65 ifeq ($(trace),y)
66 CFLAGS += -DTRACE_BUFFER
67 endif
69 CFLAGS := $(strip $(CFLAGS))
71 %.o: %.c $(HDRS) Makefile
72 $(CC) $(CFLAGS) -c $< -o $@
74 %.o: %.S $(HDRS) Makefile
75 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@