ia64/xen-unstable

view extras/mini-os/Makefile @ 1237:8b5451a42056

bitkeeper revision 1.829 (4064473cafXxoOK98baBKebIaWblgA)

Merge tetris.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into tetris.cl.cam.ac.uk:/auto/groups/xeno/users/iap10/xeno-clone/xeno.bk
author iap10@tetris.cl.cam.ac.uk
date Fri Mar 26 15:07:40 2004 +0000 (2004-03-26)
parents a235ded07b12
children 109663e1ac8d 369b77bc3884
line source
2 CC := gcc
3 LD := ld
5 # Linker should relocate monitor to this address
6 MONITOR_BASE := 0xE0100000
8 # NB. '-Wcast-qual' is nasty, so I omitted it.
9 CFLAGS := -fno-builtin -O3 -Wall -Ih/ -Wredundant-decls
10 CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline -ansi
12 TARGET := mini-os
14 LOBJS := lib/malloc.o lib/math.o lib/printf.o lib/string.o
15 OBJS := entry.o kernel.o traps.o hypervisor.o mm.o events.o time.o ${LOBJS}
17 HINTF := h/hypervisor-ifs/hypervisor-if.h
18 HDRS := h/os.h h/types.h h/hypervisor.h h/mm.h h/events.h h/time.h h/lib.h
19 HDRS += $(HINTF)
21 default: $(TARGET)
23 hypervisor-ifs:
24 ln -sf ../../../xen/include/hypervisor-ifs h/hypervisor-ifs
26 $(TARGET): hypervisor-ifs head.o $(OBJS)
27 # Image will load at 0xC0000000. First bytes from head.o
28 #$(LD) -N -Ttext 0xC0000000 head.o $(OBJS) -o $@.elf
29 $(LD) -N -T minios.lds head.o $(OBJS) -o $@.elf
30 # Guest OS header -- first 8 bytes are identifier 'XenGuest'.
31 echo -e -n 'XenGuest' >$@
32 # Guest OS header -- next 4 bytes are load address (0xC0000000).
33 echo -e -n '\000\000\000\300' >>$@
34 # Create a raw bag of bytes from the ELF image.
35 objcopy -O binary -R .note -R .comment $@.elf $@.raw
36 # Guest OS header is immediately followed by raw OS image.
37 cat $@.raw >>$@
38 gzip -f -9 -c $@ >$@.gz
40 clean:
41 find . -type f -name '*.o' | xargs rm -f
42 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
43 find . -type l | xargs rm -f
45 %.o: %.c $(HDRS) Makefile
46 $(CC) $(CFLAGS) -c $< -o $@
48 %.o: %.S $(HDRS) Makefile
49 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@