source: trunk/packages/xen-common/xen-common/xen/arch/powerpc/Rules.mk @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 1.5 KB
Line 
1HAS_PPC64 := y
2
3CC := $(CROSS_COMPILE)gcc
4LD := $(CROSS_COMPILE)ld
5
6# These are goodess that applies to all source.
7C_WARNINGS := -Wredundant-decls
8
9# _no_ common code can have packed data structures or we are in touble.
10C_WARNINGS += -Wpacked
11
12CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common -fno-strict-aliasing
13CFLAGS += -iwithprefix include -Wall -Werror -pipe
14CFLAGS += -I$(BASEDIR)/include
15CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-generic
16CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-default
17CFLAGS += $(C_WARNINGS)
18CFLAGS += -msoft-float -O2
19CFLAGS-$(debug) += -O0 # last one wins
20CFLAGS-$(papr_vterm) += -DPAPR_VDEVICE -DPAPR_VTERM
21
22LDFLAGS += -m elf64ppc
23
24#
25# command to embed a binary inside a .o
26#
27%.o: %.bin
28        $(CROSS_COMPILE)objcopy --input-target=binary \
29                --output-target=elf64-powerpc \
30                --binary-architecture=powerpc \
31                --redefine-sym _binary_$*_bin_start=$*_start \
32                --redefine-sym _binary_$*_bin_end=$*_end \
33                --redefine-sym _binary_$*_bin_size=$*_size \
34                $< $@
35
36# Test for at least GCC v3.2.x.
37gcc-ver = $(shell $(CC) -dumpversion | sed -e 's/^\(.\)\.\(.\)\.\(.\)/\$(1)/')
38ifeq ($(call gcc-ver,1),1)
39$(error gcc-1.x.x unsupported - upgrade to at least gcc-3.2.x)
40endif
41ifeq ($(call gcc-ver,1),2)
42$(error gcc-2.x.x unsupported - upgrade to at least gcc-3.2.x)
43endif
44ifeq ($(call gcc-ver,1),3)
45ifeq ($(call gcc-ver,2),0)
46$(error gcc-3.0.x unsupported - upgrade to at least gcc-3.2.x)
47endif
48ifeq ($(call gcc-ver,2),1)
49$(error gcc-3.1.x unsupported - upgrade to at least gcc-3.2.x)
50endif
51endif
Note: See TracBrowser for help on using the repository browser.