ia64/xen-unstable

view extras/mini-os/Makefile @ 10784:97cc7ed90061

[IA64] fix merge error with xen-unstable.hg

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Tue Jul 25 12:39:01 2006 -0600 (2006-07-25)
parents 414dabe82a31
children ec4979587156
line source
1 debug ?= y
2 pae ?= n
4 XEN_ROOT = ../..
5 include $(XEN_ROOT)/Config.mk
7 # Set TARGET_ARCH
8 override TARGET_ARCH := $(XEN_TARGET_ARCH)
10 # NB. '-Wcast-qual' is nasty, so I omitted it.
11 CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
12 CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
14 override CPPFLAGS := -Iinclude $(CPPFLAGS)
15 ASFLAGS = -D__ASSEMBLY__
17 LDLIBS = -L. -lminios
18 LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
20 ifeq ($(TARGET_ARCH),x86_32)
21 CFLAGS += -m32 -march=i686
22 LDFLAGS += -m elf_i386
23 endif
25 ifeq ($(TARGET_ARCH)$(pae),x86_32y)
26 CFLAGS += -DCONFIG_X86_PAE=1
27 ASFLAGS += -DCONFIG_X86_PAE=1
28 endif
30 ifeq ($(TARGET_ARCH),x86_64)
31 CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
32 CFLAGS += -fno-asynchronous-unwind-tables
33 LDFLAGS += -m elf_x86_64
34 endif
36 ifeq ($(debug),y)
37 CFLAGS += -g
38 else
39 CFLAGS += -O3
40 endif
42 TARGET := mini-os
44 HEAD := $(TARGET_ARCH).o
45 OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
46 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
47 OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
48 OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
50 HDRS := $(wildcard include/*.h)
51 HDRS += $(wildcard include/xen/*.h)
53 .PHONY: default
54 default: $(TARGET)
56 .PHONY: links
57 links:
58 [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
60 libminios.a: links $(OBJS) $(HEAD)
61 $(AR) r libminios.a $(HEAD) $(OBJS)
63 $(TARGET): libminios.a $(HEAD)
64 $(LD) $(LDFLAGS) $(HEAD) $(LDLIBS) -o $@.elf
65 gzip -f -9 -c $@.elf >$@.gz
67 .PHONY: clean
68 clean:
69 find . -type f -name '*.o' | xargs rm -f
70 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
71 rm -f libminios.a
72 find . -type l | xargs rm -f
74 %.o: %.c $(HDRS) Makefile
75 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
77 %.o: %.S $(HDRS) Makefile
78 $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
80 define all_sources
81 ( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
82 endef
84 .PHONY: cscope
85 cscope:
86 $(all_sources) > cscope.files
87 cscope -k -b -q