ia64/xen-unstable

view extras/mini-os/Makefile @ 4146:f2d61710e4d9

bitkeeper revision 1.1236.25.24 (42366e9aQ71LQ8uCB-Y1IwVNqx5eqA)

Merge djm@kirby.fc.hp.com://home/djm/src/xen/xeno-unstable-ia64.bk
into sportsman.spdomain:/home/djm/xeno-unstable-ia64.bk
author djm@sportsman.spdomain
date Tue Mar 15 05:11:54 2005 +0000 (2005-03-15)
parents 2d4c4c4574f2
children 189c87adf876 1883ec07708b
line source
2 CC := gcc
3 LD := ld
5 TARGET_ARCH := $(shell uname -m | sed -e s/i.86/x86_32/)
7 # NB. '-Wcast-qual' is nasty, so I omitted it.
8 CFLAGS := -fno-builtin -O3 -Wall -Ih/ -Wredundant-decls -Wno-format
9 CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
11 ifeq ($(TARGET_ARCH),x86_32)
12 CFLAGS += -m32 -march=i686
13 LDFLAGS := -m elf_i386
14 endif
16 ifeq ($(TARGET_ARCH),x86_64)
17 CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
18 CFLAGS += -fno-asynchronous-unwind-tables
19 LDFLAGS := -m elf_x86_64
20 endif
22 TARGET := mini-os
24 OBJS := $(TARGET_ARCH).o
25 OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
26 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
28 OBJS := $(subst events.o,,$(OBJS))
29 OBJS := $(subst hypervisor.o,,$(OBJS))
30 OBJS := $(subst time.o,,$(OBJS))
32 HDRS := $(wildcard h/*.h)
33 HDRS += $(wildcard h/xen-public/*.h)
35 default: $(TARGET)
37 xen-public:
38 [ -e h/xen-public ] || ln -sf ../../../xen/include/public h/xen-public
40 $(TARGET): xen-public $(OBJS)
41 $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
42 gzip -f -9 -c $@.elf >$@.gz
44 clean:
45 find . -type f -name '*.o' | xargs rm -f
46 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
47 find . -type l | xargs rm -f
49 %.o: %.c $(HDRS) Makefile
50 $(CC) $(CFLAGS) -c $< -o $@
52 %.o: %.S $(HDRS) Makefile
53 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@