[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Makefile fixes. mbootpack dependencies now work properly.



ChangeSet 1.1436, 2005/04/02 21:18:09+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Makefile fixes. mbootpack dependencies now work properly.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 Config.mk                     |    9 -------
 tools/misc/mbootpack/Makefile |   52 +++++++++++-------------------------------
 xen/Rules.mk                  |    6 ----
 3 files changed, 15 insertions(+), 52 deletions(-)


diff -Nru a/Config.mk b/Config.mk
--- a/Config.mk 2005-04-03 05:03:00 -04:00
+++ b/Config.mk 2005-04-03 05:03:00 -04:00
@@ -10,9 +10,7 @@
 override COMPILE_ARCH    := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
 override TARGET_ARCH     := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
 
-#
-# Tool configuration Makefile fragment
-#
+# Tools to run on system hosting the build
 HOSTCC     = gcc
 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
 
@@ -26,7 +24,6 @@
 OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJDUMP    = $(CROSS_COMPILE)objdump
 
-
 ifneq ($(EXTRA_PREFIX),)
 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
 EXTRA_LIB += $(EXTRA_PREFIX)/lib
@@ -34,7 +31,3 @@
 
 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
-
-CFLAGS += -g
-
-
diff -Nru a/tools/misc/mbootpack/Makefile b/tools/misc/mbootpack/Makefile
--- a/tools/misc/mbootpack/Makefile     2005-04-03 05:03:00 -04:00
+++ b/tools/misc/mbootpack/Makefile     2005-04-03 05:03:00 -04:00
@@ -8,56 +8,36 @@
 XEN_ROOT=../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-CFLAGS   += -Wall -Werror -O3 
-
-INCLUDES += -I $(XEN_XC)
-INCLUDES += -I $(XEN_LIBXC)
-CFLAGS   += $(INCLUDES)
-
-HDRS     = $(wildcard *.h)
-
-TARGETS  = mbootpack
-
-INSTALL_BIN  = mbootpack
-INSTALL_SBIN =
-
 all: build
-build: $(TARGETS)
+build: mbootpack
 
 install: build
-       $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
-
-#
-#  What object files need building for the program
-#
+       $(INSTALL_PROG) mbootpack $(DESTDIR)/usr/bin
 
-OBJS   := mbootpack.o buildimage.o
-DEPS   := mbootpack.d buildimage.d
-
-# 
 #  Tools etc.
-#
-
 RM     := rm -f
 GDB    := gdb
 INCS   := -I. -I-
 DEFS   := 
 LDFLAGS        := 
 CC     := gcc
-CFLAGS         := -W -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format
+CFLAGS         := -Wall -Wpointer-arith -Wcast-qual -Wno-unused -Wno-format
 CFLAGS += -Wmissing-prototypes
 #CFLAGS        += -pipe -g -O0 -Wcast-align
 CFLAGS += -pipe -O3 
 
-#
-#  Rules
-#
+#  What object files need building for the program
+OBJS   := mbootpack.o buildimage.o
+
+# Get gcc to generate the dependencies for us.
+DEPFLAGS = -Wp,-MD,.$(@F).d
+DEPS     = .*.d
 
 mbootpack: $(OBJS)
        $(CC) -o $@ $(filter-out %.a, $^) $(LDFLAGS)
 
-clean: FRC
-       $(RM) mbootpack *.o *.d bootsect setup bzimage_header.c bin2c
+clean:
+       $(RM) mbootpack *.o $(DEPS) bootsect setup bzimage_header.c bin2c
 
 bootsect: bootsect.S
        $(CC) $(CFLAGS) $(INCS) $(DEFS) -D__MB_ASM -c bootsect.S -o bootsect.o
@@ -78,16 +58,12 @@
        @
 
 %.o: %.S
-       $(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
+       $(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
 
 %.o: %.c
-       $(CC) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
-
-%.d: %.c
-       $(CC) $(CFLAGS) $(INCS) $(DEFS) -M $< > $@
+       $(CC) $(DEPFLAGS) $(CFLAGS) $(INCS) $(DEFS) -c $< -o $@
 
-FRC: 
-.PHONY:: all FRC clean gdb
+.PHONY: all clean gdb
 .PRECIOUS: $(OBJS) $(OBJS:.o=.c) $(DEPS)
 .SUFFIXES: 
 
diff -Nru a/xen/Rules.mk b/xen/Rules.mk
--- a/xen/Rules.mk      2005-04-03 05:03:00 -04:00
+++ b/xen/Rules.mk      2005-04-03 05:03:00 -04:00
@@ -9,12 +9,6 @@
 
 include $(BASEDIR)/../Config.mk
 
-# Set ARCH/SUBARCH appropriately.
-override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
-override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
-override COMPILE_ARCH    := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
-override TARGET_ARCH     := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
-
 TARGET  := $(BASEDIR)/xen
 HDRS    := $(wildcard $(BASEDIR)/include/xen/*.h)
 HDRS    += $(wildcard $(BASEDIR)/include/public/*.h)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.