ia64/xen-unstable

view xen/Rules.mk @ 3017:d0006e7baa9a

bitkeeper revision 1.1159.170.41 (419b5697bEIXHXiSbTxwpjfvjHraWw)

Reassert 2.1-devel after push to 2.0 tree.
author kaf24@freefall.cl.cam.ac.uk
date Wed Nov 17 13:48:07 2004 +0000 (2004-11-17)
parents fa4a637449cb
children cf2447c5a0c6 f1210445f1f9 dee91b44a753 0dc3b8b8c298
line source
2 verbose ?= n
3 debug ?= n
4 debugger ?= n
5 perfc ?= n
6 trace ?= n
7 optimize ?= y
9 # Currently supported architectures:
10 # {COMPILE,TARGET}_ARCH := x86
11 # {COMPILE,TARGET}_SUBARCH := x86_32 | x86_64
12 COMPILE_ARCH := x86
13 COMPILE_SUBARCH := $(shell uname -m | sed -e s/i.86/x86_32/)
15 TARGET_ARCH ?= $(COMPILE_ARCH)
16 TARGET_SUBARCH ?= $(COMPILE_SUBARCH)
18 TARGET := $(BASEDIR)/xen
19 HDRS := $(wildcard $(BASEDIR)/include/xen/*.h)
20 HDRS += $(wildcard $(BASEDIR)/include/scsi/*.h)
21 HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
22 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
23 HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
24 # compile.h is always regenerated, but other files shouldn't be rebuilt
25 HDRS := $(subst $(BASEDIR)/include/xen/compile.h,,$(HDRS))
27 C_SRCS := $(wildcard *.c)
28 S_SRCS := $(wildcard *.S)
29 OBJS := $(patsubst %.S,%.o,$(S_SRCS))
30 OBJS += $(patsubst %.c,%.o,$(C_SRCS))
32 # Note that link order matters!
33 ALL_OBJS := $(BASEDIR)/common/common.o
34 ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
35 ALL_OBJS += $(BASEDIR)/drivers/acpi/driver.o
36 ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
37 ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
39 HOSTCC = gcc
40 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
42 test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1))
44 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
46 ifneq ($(debug),y)
47 CFLAGS += -DNDEBUG
48 ifeq ($(verbose),y)
49 CFLAGS += -DVERBOSE
50 endif
51 else
52 CFLAGS += -DVERBOSE
53 endif
55 ifeq ($(debugger),y)
56 CFLAGS += -DXEN_DEBUGGER
57 endif
59 ifeq ($(perfc),y)
60 CFLAGS += -DPERF_COUNTERS
61 endif
63 ifeq ($(trace),y)
64 CFLAGS += -DTRACE_BUFFER
65 endif
67 CFLAGS := $(strip $(CFLAGS))
69 %.o: %.c $(HDRS) Makefile
70 $(CC) $(CFLAGS) -c $< -o $@
72 %.o: %.S $(HDRS) Makefile
73 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@