ia64/xen-unstable

changeset 4444:7ee105259e13

bitkeeper revision 1.1236.1.200 (424efe01yAPteHQ-fOPSaM_1yE9IfA)

Makefile fixes. mbootpack dependencies now work properly.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Apr 02 20:18:09 2005 +0000 (2005-04-02)
parents e7f3366cfafd
children 7e49a7314748
files Config.mk tools/misc/mbootpack/Makefile xen/Rules.mk
line diff
     1.1 --- a/Config.mk	Sat Apr 02 19:39:22 2005 +0000
     1.2 +++ b/Config.mk	Sat Apr 02 20:18:09 2005 +0000
     1.3 @@ -10,9 +10,7 @@ override TARGET_SUBARCH  := $(XEN_TARGET
     1.4  override COMPILE_ARCH    := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
     1.5  override TARGET_ARCH     := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
     1.6  
     1.7 -#
     1.8 -# Tool configuration Makefile fragment
     1.9 -#
    1.10 +# Tools to run on system hosting the build
    1.11  HOSTCC     = gcc
    1.12  HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
    1.13  
    1.14 @@ -26,7 +24,6 @@ STRIP      = $(CROSS_COMPILE)strip
    1.15  OBJCOPY    = $(CROSS_COMPILE)objcopy
    1.16  OBJDUMP    = $(CROSS_COMPILE)objdump
    1.17  
    1.18 -
    1.19  ifneq ($(EXTRA_PREFIX),)
    1.20  EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
    1.21  EXTRA_LIB += $(EXTRA_PREFIX)/lib
    1.22 @@ -34,7 +31,3 @@ endif
    1.23  
    1.24  LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
    1.25  CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
    1.26 -
    1.27 -CFLAGS += -g
    1.28 -
    1.29 -
     2.1 --- a/tools/misc/mbootpack/Makefile	Sat Apr 02 19:39:22 2005 +0000
     2.2 +++ b/tools/misc/mbootpack/Makefile	Sat Apr 02 20:18:09 2005 +0000
     2.3 @@ -8,56 +8,36 @@ INSTALL_DIR	= $(INSTALL) -d -m0755
     2.4  XEN_ROOT=../../..
     2.5  include $(XEN_ROOT)/tools/Rules.mk
     2.6  
     2.7 -CFLAGS   += -Wall -Werror -O3 
     2.8 -
     2.9 -INCLUDES += -I $(XEN_XC)
    2.10 -INCLUDES += -I $(XEN_LIBXC)
    2.11 -CFLAGS   += $(INCLUDES)
    2.12 -
    2.13 -HDRS     = $(wildcard *.h)
    2.14 -
    2.15 -TARGETS  = mbootpack
    2.16 -
    2.17 -INSTALL_BIN  = mbootpack
    2.18 -INSTALL_SBIN =
    2.19 -
    2.20  all: build
    2.21 -build: $(TARGETS)
    2.22 +build: mbootpack
    2.23  
    2.24  install: build
    2.25 -	$(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
    2.26 -
    2.27 -#
    2.28 -#  What object files need building for the program
    2.29 -#
    2.30 +	$(INSTALL_PROG) mbootpack $(DESTDIR)/usr/bin
    2.31  
    2.32 -OBJS	:= mbootpack.o buildimage.o
    2.33 -DEPS	:= mbootpack.d buildimage.d
    2.34 -
    2.35 -# 
    2.36  #  Tools etc.
    2.37 -#
    2.38 -
    2.39  RM 	:= rm -f
    2.40  GDB	:= gdb
    2.41  INCS	:= -I. -I-
    2.42  DEFS	:= 
    2.43  LDFLAGS	:= 
    2.44  CC	:= gcc
    2.45 -CFLAGS 	:= -W -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format
    2.46 +CFLAGS 	:= -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format
    2.47  CFLAGS	+= -Wmissing-prototypes
    2.48  #CFLAGS	+= -pipe -g -O0 -Wcast-align
    2.49  CFLAGS	+= -pipe -O3 
    2.50  
    2.51 -#
    2.52 -#  Rules
    2.53 -#
    2.54 +#  What object files need building for the program
    2.55 +OBJS	:= mbootpack.o buildimage.o
    2.56 +
    2.57 +# Get gcc to generate the dependencies for us.
    2.58 +DEPFLAGS = -Wp,-MD,.$(@F).d
    2.59 +DEPS     = .*.d
    2.60  
    2.61  mbootpack: $(OBJS)
    2.62  	$(CC) -o $@ $(filter-out %.a, $^) $(LDFLAGS)
    2.63  
    2.64 -clean: FRC
    2.65 -	$(RM) mbootpack *.o *.d bootsect setup bzimage_header.c bin2c
    2.66 +clean:
    2.67 +	$(RM) mbootpack *.o $(DEPS) bootsect setup bzimage_header.c bin2c
    2.68  
    2.69  bootsect: bootsect.S
    2.70  	$(CC) $(CFLAGS) $(INCS) $(DEFS) -D__MB_ASM -c bootsect.S -o bootsect.o
    2.71 @@ -78,16 +58,12 @@ buildimage.c: bzimage_header.c
    2.72  	@
    2.73  
    2.74  %.o: %.S
    2.75 -	$(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
    2.76 +	$(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
    2.77  
    2.78  %.o: %.c
    2.79 -	$(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
    2.80 +	$(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
    2.81  
    2.82 -%.d: %.c
    2.83 -	$(CC) $(CFLAGS) $(INCS) $(DEFS) -M $< > $@
    2.84 -
    2.85 -FRC: 
    2.86 -.PHONY:: all FRC clean gdb
    2.87 +.PHONY: all clean gdb
    2.88  .PRECIOUS: $(OBJS) $(OBJS:.o=.c) $(DEPS)
    2.89  .SUFFIXES: 
    2.90  
     3.1 --- a/xen/Rules.mk	Sat Apr 02 19:39:22 2005 +0000
     3.2 +++ b/xen/Rules.mk	Sat Apr 02 20:18:09 2005 +0000
     3.3 @@ -9,12 +9,6 @@ crash_debug ?= n
     3.4  
     3.5  include $(BASEDIR)/../Config.mk
     3.6  
     3.7 -# Set ARCH/SUBARCH appropriately.
     3.8 -override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
     3.9 -override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
    3.10 -override COMPILE_ARCH    := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
    3.11 -override TARGET_ARCH     := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
    3.12 -
    3.13  TARGET  := $(BASEDIR)/xen
    3.14  HDRS    := $(wildcard $(BASEDIR)/include/xen/*.h)
    3.15  HDRS    += $(wildcard $(BASEDIR)/include/public/*.h)