ia64/xen-unstable

view tools/firmware/hvmloader/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 ac3a4fc11e3e
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 HVM loader is started in 32-bit mode at the address below:
29 LOADADDR = 0x100000
31 DEFINES =-DDEBUG
32 XENINC =-I$(XEN_ROOT)/tools/libxc
34 OBJECTS = hvmloader.o acpi_madt.o
36 # Disable PIE/SSP if GCC supports them. They can break us.
37 CFLAGS += $(call test-gcc-flag,$(CC),-nopie)
38 CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector)
39 CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all)
41 OBJCOPY = objcopy
42 CFLAGS += $(DEFINES) -I. $(XENINC) -fno-builtin -O2 -msoft-float
43 LDFLAGS = -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
45 .PHONY: all
46 all: hvmloader
48 hvmloader: roms.h hvmloader.c acpi_madt.c
49 $(CC) $(CFLAGS) -c hvmloader.c acpi_madt.c
50 $(CC) $(LDFLAGS) -o hvmloader.tmp hvmloader.o acpi_madt.o
51 $(OBJCOPY) hvmloader.tmp hvmloader
52 rm -f hvmloader.tmp
54 roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin
55 ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
56 ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
57 ./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
58 ./mkhex vmxassist ../vmxassist/vmxassist.bin >> roms.h
59 ./mkhex acpi ../acpi/acpi.bin >> roms.h
61 .PHONY: clean
62 clean:
63 rm -f roms.h acpi.h
64 rm -f hvmloader hvmloader.tmp hvmloader.o $(OBJECTS)