direct-io.hg

view extras/mini-os/Makefile @ 5517:10e9028c8e3d

bitkeeper revision 1.1718.1.10 (42b7b19aqOS_1M8I4pIOFjiTPYWV-g)

Merge bk://xenbits.xensource.com/xen-unstable.bk
into spot.cl.cam.ac.uk:C:/Documents and Settings/iap10/xen-unstable.bk
author iap10@spot.cl.cam.ac.uk
date Tue Jun 21 06:20:10 2005 +0000 (2005-06-21)
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 $@