ia64/xen-unstable

view tools/firmware/vmxassist/Makefile @ 9115:46a6d9626911

Ignore external (user-provided) CFLAGS when building vmxassist and hvmloader.
They do more harm than good.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 03 10:44:40 2006 +0100 (2006-03-03)
parents e5aba4f62131
children cfee00c6cd88
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 # External CFLAGS can do more harm than good.
22 CFLAGS :=
24 XEN_ROOT = ../../..
25 include $(XEN_ROOT)/Config.mk
27 # The emulator code lives in ROM space
28 TEXTADDR=0x000D0000
30 DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR)
31 XENINC=-I$(XEN_ROOT)/tools/libxc
33 # Disable PIE/SSP if GCC supports them. They can break us.
34 CFLAGS += $(call test-gcc-flag,$(CC),-nopie)
35 CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector)
36 CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
38 CPP = cpp -P
39 OBJCOPY = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
40 CFLAGS += $(DEFINES) -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
41 CFLAGS += -m32 -march=i686
42 LDFLAGS = -m elf_i386
44 OBJECTS = head.o trap.o vm86.o setup.o util.o
46 all: vmxassist.bin
48 vmxassist.bin: vmxassist.ld $(OBJECTS)
49 $(CPP) $(DEFINES) vmxassist.ld > vmxassist.tmp
50 $(LD) -o vmxassist $(LDFLAGS) -nostdlib --fatal-warnings -N -T vmxassist.tmp $(OBJECTS)
51 nm -n vmxassist > vmxassist.sym
52 $(OBJCOPY) vmxassist vmxassist.tmp
53 dd if=vmxassist.tmp of=vmxassist.bin ibs=512 conv=sync
54 rm -f vmxassist.tmp
56 head.o: machine.h head.S
57 $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c head.S
59 trap.o: machine.h offsets.h trap.S
60 $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c trap.S
62 vm86.o: machine.h vm86.c
63 $(CC) $(CFLAGS) -c vm86.c
65 setup.o: machine.h setup.c
66 $(CC) $(CFLAGS) -c setup.c
68 util.o: machine.h util.c
69 $(CC) $(CFLAGS) -c util.c
71 offsets.h: gen
72 ./gen > offsets.h
74 gen: gen.c
75 $(HOSTCC) $(HOSTCFLAGS) -I. $(XENINC) -o gen gen.c
77 clean:
78 rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s
79 rm -f $(OBJECTS)
80 rm -f gen gen.o offsets.h