ia64/xen-unstable

changeset 11840:be8039f8bc14

Introduce Makefile config fragments for OS-specific differences.

Signed-off-by: John Levon <john.levon@sun.com>
author kfraser@localhost.localdomain
date Tue Oct 17 16:48:05 2006 +0100 (2006-10-17)
parents fb9f7ac2fc54
children f4b7b8aefc05
files Config.mk Makefile buildconfigs/Rules.mk config/Linux.mk config/SunOS.mk config/x86_64.mk xen/Rules.mk
line diff
     1.1 --- a/Config.mk	Tue Oct 17 16:13:13 2006 +0100
     1.2 +++ b/Config.mk	Tue Oct 17 16:48:05 2006 +0100
     1.3 @@ -4,43 +4,19 @@
     1.4  debug ?= n
     1.5  
     1.6  XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
     1.7 -                                              -e s/ppc/powerpc/)
     1.8 +                         -e s/ppc/powerpc/ -e s/i86pc/x86_32/)
     1.9  XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
    1.10  XEN_TARGET_X86_PAE  ?= n
    1.11 +XEN_OS              ?= $(shell uname -s)
    1.12  
    1.13  # Tools to run on system hosting the build
    1.14  HOSTCC     = gcc
    1.15  HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
    1.16  
    1.17 -AS         = $(CROSS_COMPILE)as
    1.18 -LD         = $(CROSS_COMPILE)ld
    1.19 -CC         = $(CROSS_COMPILE)gcc
    1.20 -CPP        = $(CROSS_COMPILE)gcc -E
    1.21 -AR         = $(CROSS_COMPILE)ar
    1.22 -RANLIB     = $(CROSS_COMPILE)ranlib
    1.23 -NM         = $(CROSS_COMPILE)nm
    1.24 -STRIP      = $(CROSS_COMPILE)strip
    1.25 -OBJCOPY    = $(CROSS_COMPILE)objcopy
    1.26 -OBJDUMP    = $(CROSS_COMPILE)objdump
    1.27 -
    1.28  DISTDIR     ?= $(XEN_ROOT)/dist
    1.29  DESTDIR     ?= /
    1.30  
    1.31 -INSTALL      = install
    1.32 -INSTALL_DIR  = $(INSTALL) -d -m0755
    1.33 -INSTALL_DATA = $(INSTALL) -m0644
    1.34 -INSTALL_PROG = $(INSTALL) -m0755
    1.35 -
    1.36 -ifneq ($(debug),y)
    1.37 -# Optimisation flags are overridable
    1.38 -CFLAGS    ?= -O2 -fomit-frame-pointer
    1.39 -CFLAGS    += -DNDEBUG
    1.40 -else
    1.41 -# Less than -O1 produces bad code and large stack frames
    1.42 -CFLAGS    ?= -O1 -fno-omit-frame-pointer
    1.43 -CFLAGS    += -g
    1.44 -endif
    1.45 -
    1.46 +include $(XEN_ROOT)/config/$(XEN_OS).mk
    1.47  include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
    1.48  
    1.49  ifneq ($(EXTRA_PREFIX),)
    1.50 @@ -50,6 +26,12 @@ endif
    1.51  
    1.52  test-gcc-flag = $(shell $(1) -v --help 2>&1 | grep -q " $(2) " && echo $(2))
    1.53  
    1.54 +ifneq ($(debug),y)
    1.55 +CFLAGS += -DNDEBUG
    1.56 +else
    1.57 +CFLAGS += -g
    1.58 +endif
    1.59 +
    1.60  CFLAGS += -Wall -Wstrict-prototypes
    1.61  
    1.62  # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
    1.63 @@ -62,9 +44,6 @@ CFLAGS     += $(call test-gcc-flag,$(CC)
    1.64  LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
    1.65  CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
    1.66  
    1.67 -# Choose the best mirror to download linux kernel
    1.68 -KERNEL_REPO = http://www.kernel.org
    1.69 -
    1.70  # If ACM_SECURITY = y, then the access control module is compiled
    1.71  # into Xen and the policy type can be set by the boot policy file
    1.72  #        y - Build the Xen ACM framework
     2.1 --- a/Makefile	Tue Oct 17 16:13:13 2006 +0100
     2.2 +++ b/Makefile	Tue Oct 17 16:48:05 2006 +0100
     2.3 @@ -2,11 +2,6 @@
     2.4  # Grand Unified Makefile for Xen.
     2.5  #
     2.6  
     2.7 -KERNELS ?= linux-2.6-xen
     2.8 -# You may use wildcards in the above e.g. KERNELS=*2.6*
     2.9 -
    2.10 -XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
    2.11 -
    2.12  # Export target architecture overrides to Xen and Linux sub-trees.
    2.13  ifneq ($(XEN_TARGET_ARCH),)
    2.14  SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
     3.1 --- a/buildconfigs/Rules.mk	Tue Oct 17 16:13:13 2006 +0100
     3.2 +++ b/buildconfigs/Rules.mk	Tue Oct 17 16:48:05 2006 +0100
     3.3 @@ -3,6 +3,9 @@ include Config.mk
     3.4  
     3.5  export DESTDIR
     3.6  
     3.7 +# Choose the best mirror to download linux kernel
     3.8 +KERNEL_REPO = http://www.kernel.org
     3.9 +
    3.10  ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
    3.11  ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
    3.12  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/config/Linux.mk	Tue Oct 17 16:48:05 2006 +0100
     4.3 @@ -0,0 +1,34 @@
     4.4 +# -*- mode: Makefile; -*-
     4.5 +
     4.6 +AS         = $(CROSS_COMPILE)as
     4.7 +LD         = $(CROSS_COMPILE)ld
     4.8 +CC         = $(CROSS_COMPILE)gcc
     4.9 +CPP        = $(CROSS_COMPILE)gcc -E
    4.10 +AR         = $(CROSS_COMPILE)ar
    4.11 +RANLIB     = $(CROSS_COMPILE)ranlib
    4.12 +NM         = $(CROSS_COMPILE)nm
    4.13 +STRIP      = $(CROSS_COMPILE)strip
    4.14 +OBJCOPY    = $(CROSS_COMPILE)objcopy
    4.15 +OBJDUMP    = $(CROSS_COMPILE)objdump
    4.16 +
    4.17 +INSTALL      = install
    4.18 +INSTALL_DIR  = $(INSTALL) -d -m0755
    4.19 +INSTALL_DATA = $(INSTALL) -m0644
    4.20 +INSTALL_PROG = $(INSTALL) -m0755
    4.21 +
    4.22 +LIB64DIR = lib64
    4.23 +
    4.24 +ifneq ($(debug),y)
    4.25 +# Optimisation flags are overridable
    4.26 +CFLAGS ?= -O2 -fomit-frame-pointer
    4.27 +else
    4.28 +# Less than -O1 produces bad code and large stack frames
    4.29 +CFLAGS ?= -O1 -fno-omit-frame-pointer
    4.30 +endif
    4.31 +
    4.32 +# You may use wildcards, e.g. KERNELS=*2.6*
    4.33 +KERNELS ?= linux-2.6-xen
    4.34 +
    4.35 +XKERNELS := $(foreach kernel, $(KERNELS), \
    4.36 +              $(patsubst buildconfigs/mk.%,%, \
    4.37 +                $(wildcard buildconfigs/mk.$(kernel))) )
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/config/SunOS.mk	Tue Oct 17 16:48:05 2006 +0100
     5.3 @@ -0,0 +1,27 @@
     5.4 +# -*- mode: Makefile; -*-
     5.5 +
     5.6 +AS         = $(CROSS_COMPILE)gas
     5.7 +LD         = $(CROSS_COMPILE)gld
     5.8 +CC         = $(CROSS_COMPILE)gcc
     5.9 +CPP        = $(CROSS_COMPILE)gcc -E
    5.10 +AR         = $(CROSS_COMPILE)gar
    5.11 +RANLIB     = $(CROSS_COMPILE)granlib
    5.12 +NM         = $(CROSS_COMPILE)gnm
    5.13 +STRIP      = $(CROSS_COMPILE)gstrip
    5.14 +OBJCOPY    = $(CROSS_COMPILE)gobjcopy
    5.15 +OBJDUMP    = $(CROSS_COMPILE)gobjdump
    5.16 +
    5.17 +INSTALL      = ginstall
    5.18 +INSTALL_DIR  = $(INSTALL) -d -m0755
    5.19 +INSTALL_DATA = $(INSTALL) -m0644
    5.20 +INSTALL_PROG = $(INSTALL) -m0755
    5.21 +
    5.22 +LIB64DIR = lib/amd64
    5.23 +
    5.24 +ifneq ($(debug),y)
    5.25 +# Optimisation flags are overridable
    5.26 +CFLAGS ?= -O2 -fno-omit-frame-pointer
    5.27 +else
    5.28 +# Less than -O1 produces bad code and large stack frames
    5.29 +CFLAGS ?= -O1 -fno-omit-frame-pointer
    5.30 +endif
     6.1 --- a/config/x86_64.mk	Tue Oct 17 16:13:13 2006 +0100
     6.2 +++ b/config/x86_64.mk	Tue Oct 17 16:48:05 2006 +0100
     6.3 @@ -6,4 +6,4 @@ CONFIG_IOEMU := y
     6.4  
     6.5  CFLAGS += -m64
     6.6  LDFLAGS += -m64
     6.7 -LIBDIR = lib64
     6.8 +LIBDIR = $(LIB64DIR)
     7.1 --- a/xen/Rules.mk	Tue Oct 17 16:13:13 2006 +0100
     7.2 +++ b/xen/Rules.mk	Tue Oct 17 16:48:05 2006 +0100
     7.3 @@ -24,9 +24,11 @@ endif
     7.4  override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
     7.5  override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
     7.6  override COMPILE_ARCH    := $(shell echo $(XEN_COMPILE_ARCH) | \
     7.7 -                              sed -e 's/\(x86\|powerpc\).*/\1/')
     7.8 +                              sed -e 's/x86.*/x86/' \
     7.9 +                                  -e 's/powerpc.*/powerpc/')
    7.10  override TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
    7.11 -                              sed -e 's/\(x86\|powerpc\).*/\1/')
    7.12 +                              sed -e 's/x86.*/x86/' \
    7.13 +                                  -e 's/powerpc.*/powerpc/')
    7.14  
    7.15  TARGET := $(BASEDIR)/xen
    7.16