ia64/xen-unstable

view xen/Rules.mk @ 3781:1d13ed9582e0

bitkeeper revision 1.1172.1.1 (420ba344y-TLJ8cFOVA_8bN7wd3dMw)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
author kaf24@scramble.cl.cam.ac.uk
date Thu Feb 10 18:09:08 2005 +0000 (2005-02-10)
parents 415d774d6ee7 e03bd6b89965
children 0cd8803a1553
line source
2 verbose ?= n
3 debug ?= n
4 debugger ?= n
5 perfc ?= n
6 trace ?= n
7 optimize ?= y
8 crash_debug ?= n
10 # Currently supported architectures: x86_32, x86_64
11 COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/)
12 TARGET_ARCH ?= $(COMPILE_ARCH)
14 # Set ARCH/SUBARCH appropriately.
15 override COMPILE_SUBARCH := $(COMPILE_ARCH)
16 override TARGET_SUBARCH := $(TARGET_ARCH)
17 override COMPILE_ARCH := $(patsubst x86%,x86,$(COMPILE_ARCH))
18 override TARGET_ARCH := $(patsubst x86%,x86,$(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 # 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 ($(crash_debug),y)
58 CFLAGS += -g -DCRASH_DEBUG
59 ifeq ($(debugger),y)
60 error Crash debugger conflicts with PDB
61 endif
62 endif
64 ifeq ($(perfc),y)
65 CFLAGS += -DPERF_COUNTERS
66 endif
68 ifeq ($(trace),y)
69 CFLAGS += -DTRACE_BUFFER
70 endif
72 CFLAGS := $(strip $(CFLAGS))
74 %.o: %.c $(HDRS) Makefile
75 $(CC) $(CFLAGS) -c $< -o $@
77 %.o: %.S $(HDRS) Makefile
78 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@