ia64/xen-unstable

view tools/firmware/vmxassist/Makefile @ 9716:3a9d0c29ed72

Trivial patch to fix x86_64 builds in which XEN_TARGET_ARCH
is specified on the make command line, e.g.:
make XEN_TARGET_ARCH=x86_64

This busted the vmxassist and hvmloader builds, which must
be done -m32. Using "override" in the vmxassist/hvmloader
Makefiles fixes the problem by not allowing this to be
overridden from the command line.

Signed-off-by: Dave Lively <dlively@virtualiron.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Apr 14 14:18:39 2006 +0100 (2006-04-14)
parents b454a09cddb1
children 307e5ed9657e
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 override XEN_TARGET_ARCH = x86_32
25 XEN_ROOT = ../../..
26 include $(XEN_ROOT)/Config.mk
28 # The emulator code lives in ROM space
29 TEXTADDR=0x000D0000
31 DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR)
32 XENINC=-I$(XEN_ROOT)/tools/libxc
34 # Disable PIE/SSP if GCC supports them. They can break us.
35 CFLAGS += $(call test-gcc-flag,$(CC),-nopie)
36 CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector)
37 CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
39 CPP = cpp -P
40 OBJCOPY = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
41 CFLAGS += $(DEFINES) -I. $(XENINC) -fno-builtin -O2 -msoft-float
42 LDFLAGS = -m elf_i386
44 OBJECTS = head.o trap.o vm86.o setup.o util.o
46 .PHONY: all
47 all: vmxassist.bin
49 vmxassist.bin: vmxassist.ld $(OBJECTS)
50 $(CPP) $(DEFINES) vmxassist.ld > vmxassist.tmp
51 $(LD) -o vmxassist $(LDFLAGS) -nostdlib --fatal-warnings -N -T vmxassist.tmp $(OBJECTS)
52 nm -n vmxassist > vmxassist.sym
53 $(OBJCOPY) vmxassist vmxassist.tmp
54 dd if=vmxassist.tmp of=vmxassist.bin ibs=512 conv=sync
55 rm -f vmxassist.tmp
57 head.o: machine.h vm86.h head.S
58 $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c head.S
60 trap.o: machine.h vm86.h offsets.h trap.S
61 $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c trap.S
63 vm86.o: machine.h vm86.h vm86.c
64 $(CC) $(CFLAGS) -c vm86.c
66 setup.o: machine.h vm86.h setup.c
67 $(CC) $(CFLAGS) -c setup.c
69 util.o: machine.h vm86.h util.c
70 $(CC) $(CFLAGS) -c util.c
72 offsets.h: gen
73 ./gen > offsets.h
75 gen: vm86.h gen.c
76 $(HOSTCC) $(HOSTCFLAGS) -I. $(XENINC) -o gen gen.c
78 .PHONY: clean
79 clean:
80 rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s
81 rm -f $(OBJECTS)
82 rm -f gen gen.o offsets.h