debuggers.hg

view tools/firmware/vmxassist/Makefile @ 6644:29808fef9148

merge?
author cl349@firebug.cl.cam.ac.uk
date Sat Sep 03 18:24:46 2005 +0000 (2005-09-03)
parents ed474440decd f27205ea60ef
children b6c98fe62e1a
line source
1 #
2 # Makefile
3 #
4 # Leendert van Doorn, leendert@watson.ibm.com
5 # Copyright (c) 2005, International Business Machines Corporation.
6 #
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms and conditions of the GNU General Public License,
9 # version 2, as published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 # more details.
15 #
16 # You should have received a copy of the GNU General Public License along with
17 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 # Place - Suite 330, Boston, MA 02111-1307 USA.
19 #
21 XEN_ROOT = ../../..
22 include $(XEN_ROOT)/tools/Rules.mk
24 # The emulator code lives in ROM space
25 TEXTADDR=0x000D0000
27 DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR}
28 XENINC=-I$(XEN_ROOT)/xen/include -I$(XEN_ROOT)/tools/libxc
29 #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
30 #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
32 LD = ld
33 CC = gcc
34 CPP = cpp -P
35 OBJCOPY = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
36 CFLAGS = ${DEFINES} -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
37 CFLAGS += -m32 -march=i686
38 LDFLAGS = -m elf_i386
40 OBJECTS = head.o trap.o vm86.o setup.o util.o
42 all: vmxloader
44 vmxloader: roms.h vmxloader.c acpi.h
45 ${CC} ${CFLAGS} ${DEFINES} -c vmxloader.c
46 $(CC) -o vmxloader.tmp -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,0x100000 vmxloader.o
47 objcopy --change-addresses=0xC0000000 vmxloader.tmp vmxloader
48 rm -f vmxloader.tmp
50 vmxassist.bin: vmxassist.ld ${OBJECTS}
51 ${CPP} ${DEFINES} vmxassist.ld > vmxassist.tmp
52 ${LD} -o vmxassist ${LDFLAGS} -nostdlib --fatal-warnings -N -T vmxassist.tmp ${OBJECTS}
53 nm -n vmxassist > vmxassist.sym
54 ${OBJCOPY} vmxassist vmxassist.tmp
55 dd if=vmxassist.tmp of=vmxassist.bin ibs=512 conv=sync
56 rm -f vmxassist.tmp
58 head.o: machine.h head.S
59 ${CC} ${CFLAGS} -D__ASSEMBLY__ ${DEFINES} -c head.S
61 trap.o: machine.h offsets.h trap.S
62 ${CC} ${CFLAGS} -D__ASSEMBLY__ ${DEFINES} -c trap.S
64 vm86.o: machine.h vm86.c
65 ${CC} ${CFLAGS} -c vm86.c
67 setup.o: machine.h setup.c
68 ${CC} ${CFLAGS} -c setup.c
70 util.o: machine.h util.c
71 ${CC} ${CFLAGS} -c util.c
73 roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin vmxassist.bin
74 ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
75 ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
76 ./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
77 ./mkhex vmxassist vmxassist.bin >> roms.h
79 acpi.h: ../acpi/acpi.bin
80 ./mkhex acpi ../acpi/acpi.bin > acpi.h
82 offsets.h: gen
83 ./gen > offsets.h
85 gen: gen.c
86 ${CC} ${CFLAGS} -o gen gen.c
88 clean:
89 rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s roms.h acpi.h
90 rm -f vmxloader vmxloader.tmp vmxloader.o ${OBJECTS}
91 rm -f gen gen.o offsets.h