ia64/xen-unstable

annotate tools/firmware/hvmloader/Makefile @ 12651:9164f836943d

[HVMLOADER] Fix CFLAGS.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Nov 29 11:38:17 2006 +0000 (2006-11-29)
parents 514ed4f0e5da
children c630278d4193
rev   line source
kaf24@8708 1 #
kaf24@8708 2 # Makefile
kaf24@8708 3 #
kaf24@8708 4 # Leendert van Doorn, leendert@watson.ibm.com
kaf24@8708 5 # Copyright (c) 2005, International Business Machines Corporation.
kaf24@8708 6 #
kaf24@8708 7 # This program is free software; you can redistribute it and/or modify it
kaf24@8708 8 # under the terms and conditions of the GNU General Public License,
kaf24@8708 9 # version 2, as published by the Free Software Foundation.
kaf24@8708 10 #
kaf24@8708 11 # This program is distributed in the hope it will be useful, but WITHOUT
kaf24@8708 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kaf24@8708 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
kaf24@8708 14 # more details.
kaf24@8708 15 #
kaf24@8708 16 # You should have received a copy of the GNU General Public License along with
kaf24@8708 17 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
kaf24@8708 18 # Place - Suite 330, Boston, MA 02111-1307 USA.
kaf24@8708 19 #
kaf24@8708 20
kaf24@9115 21 # External CFLAGS can do more harm than good.
kaf24@9115 22 CFLAGS :=
kaf24@9115 23
kaf24@9716 24 override XEN_TARGET_ARCH = x86_32
kaf24@8708 25 XEN_ROOT = ../../..
kaf24@9066 26 include $(XEN_ROOT)/Config.mk
kaf24@8708 27
kaf24@8708 28 # The HVM loader is started in 32-bit mode at the address below:
kaf24@8708 29 LOADADDR = 0x100000
kaf24@8708 30
kaf24@9066 31 # Disable PIE/SSP if GCC supports them. They can break us.
kfraser@11893 32 CFLAGS += $(call cc-option,$(CC),-nopie,)
kfraser@11893 33 CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
kfraser@11893 34 CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
kaf24@9066 35
kaf24@8708 36 OBJCOPY = objcopy
kfraser@12651 37 CFLAGS += -I$(XEN_ROOT)/tools/libxc -I. -fno-builtin -O2 -msoft-float
kfraser@11878 38 LDFLAGS = -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
kaf24@8708 39
kfraser@12634 40 SRCS = hvmloader.c mp_tables.c util.c smbios.c
kfraser@10976 41 OBJS = $(patsubst %.c,%.o,$(SRCS))
kfraser@10976 42
kaf24@9660 43 .PHONY: all
kaf24@8708 44 all: hvmloader
kaf24@8708 45
kaf24@12574 46 hvmloader: roms.h acpi/acpi.a $(SRCS)
kfraser@10976 47 $(CC) $(CFLAGS) -c $(SRCS)
kaf24@12574 48 $(CC) $(CFLAGS) $(LDFLAGS) -o hvmloader.tmp $(OBJS) acpi/acpi.a
kaf24@8708 49 $(OBJCOPY) hvmloader.tmp hvmloader
kaf24@8708 50 rm -f hvmloader.tmp
kaf24@8708 51
kaf24@12574 52 .PHONY: acpi/acpi.a
kaf24@12574 53 acpi/acpi.a:
kaf24@12574 54 $(MAKE) -C acpi
kaf24@12574 55
kfraser@12501 56 roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin
kaf24@10316 57 sh ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
cl349@10217 58 sh ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
cl349@10217 59 sh ./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
cl349@10217 60 sh ./mkhex vmxassist ../vmxassist/vmxassist.bin >> roms.h
kaf24@8708 61
kaf24@9660 62 .PHONY: clean
kaf24@8708 63 clean:
kaf24@8708 64 rm -f roms.h acpi.h
kfraser@12634 65 rm -f hvmloader hvmloader.tmp *.o
kfraser@12057 66 $(MAKE) -C acpi clean