# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/20 15:50:57-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # Config.mk can eventually be provided by a configuration tool (e.g. autoconf). # # BitKeeper/etc/logging_ok # 2005/03/20 15:50:57-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +1 -0 # Logging to logging@xxxxxxxxxxxxxxx accepted # # Config.mk # 2005/03/20 15:50:31-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +41 -0 # # xen/tools/figlet/Makefile # 2005/03/20 15:50:31-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +2 -2 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # Use HOSTCC to build executables to be run during build. # # xen/arch/x86/Rules.mk # 2005/03/20 15:50:31-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +3 -6 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # # xen/Rules.mk # 2005/03/20 15:50:31-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +2 -6 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # # tools/xentrace/Makefile # 2005/03/20 15:50:31-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +0 -1 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # # Config.mk # 2005/03/20 15:50:31-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +0 -0 # BitKeeper file /home/mostrows/xen/xeno-unstable.bk/Config.mk # # tools/misc/Makefile # 2005/03/20 15:50:30-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +0 -1 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # # tools/libxutil/Makefile # 2005/03/20 15:50:30-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +0 -2 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # # tools/libxc/Makefile # 2005/03/20 15:50:30-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +1 -1 # Add LDFLAGS to link commands. # # tools/Rules.mk # 2005/03/20 15:50:30-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +2 -3 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # # Makefile # 2005/03/20 15:50:30-05:00 mostrows@xxxxxxxxxxxxxxxxxxxxx +1 -0 # Definitions common to all build steps (e.g. toolchain specification) placed in Config.mk. # diff -Nru a/Config.mk b/Config.mk --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Config.mk 2005-03-20 16:15:03 -05:00 @@ -0,0 +1,33 @@ +# -*- mode: Makefile; -*- +# Currently supported architectures: x86_32, x86_64 +XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/) +XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) + +# +# Tool configuration Makefile fragment +# +HOSTCC = gcc +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer + +AS = $(CROSS_COMPILE)as +LD = $(CROSS_COMPILE)ld +CC = $(CROSS_COMPILE)gcc +CPP = $(CROSS_COMPILE)$(CC) -E +AR = $(CROSS_COMPILE)ar +NM = $(CROSS_COMPILE)nm +STRIP = $(CROSS_COMPILE)strip +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump + + +ifneq ($(EXTRA_PREFIX),) +EXTRA_INCLUDES += $(EXTRA_PREFIX)/include +EXTRA_LIB += $(EXTRA_PREFIX)/lib +endif + +LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) +CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i)) + +CFLAGS += -g + + diff -Nru a/Makefile b/Makefile --- a/Makefile 2005-03-20 16:15:03 -05:00 +++ b/Makefile 2005-03-20 16:15:03 -05:00 @@ -27,6 +27,7 @@ export XEN_TARGET_ARCH SUBARCH endif +include Config.mk include buildconfigs/Rules.mk .PHONY: all dist install xen tools kernels docs world clean mkpatches mrproper diff -Nru a/tools/Rules.mk b/tools/Rules.mk --- a/tools/Rules.mk 2005-03-20 16:15:03 -05:00 +++ b/tools/Rules.mk 2005-03-20 16:15:03 -05:00 @@ -1,11 +1,10 @@ # -*- mode: Makefile; -*- +include $(XEN_ROOT)/Config.mk + XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc XEN_LIBXC = $(XEN_ROOT)/tools/libxc XEN_LIBXUTIL = $(XEN_ROOT)/tools/libxutil - -XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/) -XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) ifeq ($(XEN_TARGET_ARCH),x86_32) CFLAGS += -m32 -march=i686 diff -Nru a/tools/libxc/Makefile b/tools/libxc/Makefile --- a/tools/libxc/Makefile 2005-03-20 16:15:03 -05:00 +++ b/tools/libxc/Makefile 2005-03-20 16:15:03 -05:00 @@ -105,6 +105,6 @@ ln -sf $< $@ libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS) - $(CC) $(CFLAGS) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz -include $(DEPS) diff -Nru a/tools/libxutil/Makefile b/tools/libxutil/Makefile --- a/tools/libxutil/Makefile 2005-03-20 16:15:03 -05:00 +++ b/tools/libxutil/Makefile 2005-03-20 16:15:03 -05:00 @@ -7,8 +7,6 @@ include $(XEN_ROOT)/tools/Rules.mk -CC = gcc - LIB_SRCS := LIB_SRCS += allocate.c LIB_SRCS += enum.c diff -Nru a/tools/misc/Makefile b/tools/misc/Makefile --- a/tools/misc/Makefile 2005-03-20 16:15:03 -05:00 +++ b/tools/misc/Makefile 2005-03-20 16:15:03 -05:00 @@ -5,7 +5,6 @@ XEN_ROOT=../.. include $(XEN_ROOT)/tools/Rules.mk -CC = gcc CFLAGS += -Wall -Werror -O3 INCLUDES += -I $(XEN_XC) diff -Nru a/tools/xentrace/Makefile b/tools/xentrace/Makefile --- a/tools/xentrace/Makefile 2005-03-20 16:15:03 -05:00 +++ b/tools/xentrace/Makefile 2005-03-20 16:15:03 -05:00 @@ -6,7 +6,6 @@ XEN_ROOT=../.. include $(XEN_ROOT)/tools/Rules.mk -CC = gcc CFLAGS += -Wall -Werror -O3 CFLAGS += -I $(XEN_XC) diff -Nru a/xen/Rules.mk b/xen/Rules.mk --- a/xen/Rules.mk 2005-03-20 16:15:03 -05:00 +++ b/xen/Rules.mk 2005-03-20 16:15:03 -05:00 @@ -7,9 +7,7 @@ domu_debug ?= n crash_debug ?= n -# Currently supported architectures: x86_32, x86_64 -XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/) -XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) +include $(BASEDIR)/../Config.mk # Set ARCH/SUBARCH appropriately. override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH) @@ -39,10 +37,8 @@ ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o -HOSTCC = gcc -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1)) +test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1)) include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk diff -Nru a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk --- a/xen/arch/x86/Rules.mk 2005-03-20 16:15:03 -05:00 +++ b/xen/arch/x86/Rules.mk 2005-03-20 16:15:03 -05:00 @@ -1,10 +1,7 @@ ######################################## # x86-specific definitions -CC := gcc -LD := ld - -CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing +CFLAGS += -nostdinc -fno-builtin -fno-common -fno-strict-aliasing CFLAGS += -iwithprefix include -Wall -Werror -Wno-format -pipe CFLAGS += -I$(BASEDIR)/include -Wno-pointer-arith -Wredundant-decls @@ -24,13 +21,13 @@ ifeq ($(TARGET_SUBARCH),x86_32) CFLAGS += -m32 -march=i686 -LDFLAGS := -m elf_i386 +LDFLAGS += -m elf_i386 endif ifeq ($(TARGET_SUBARCH),x86_64) CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks CFLAGS += -fno-asynchronous-unwind-tables -LDFLAGS := -m elf_x86_64 +LDFLAGS += -m elf_x86_64 endif # Test for at least GCC v3.2.x. diff -Nru a/xen/tools/figlet/Makefile b/xen/tools/figlet/Makefile --- a/xen/tools/figlet/Makefile 2005-03-20 16:15:03 -05:00 +++ b/xen/tools/figlet/Makefile 2005-03-20 16:15:03 -05:00 @@ -1,8 +1,8 @@ -CC := gcc +include ../../Config.mk figlet: figlet.c - $(CC) -o $@ $< + $(HOSTCC) -o $@ $< clean: rm -f *.o figlet