ia64/xen-unstable

changeset 3488:4c5d9524b934

bitkeeper revision 1.1159.223.15 (41f2c43e5U8GurDCsAUaiGJ2VOmnUQ)

Description: Use proper targets in makefiles
A rule in make should produce only what it's target allows. When it
produces side-effects, things like ctrl-c and parallellism break it
oddly.

From Adam Heath <doogie@brainfood.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@labyrinth.cl.cam.ac.uk
date Sat Jan 22 21:23:10 2005 +0000 (2005-01-22)
parents 834cba8761c6
children 78a95a35e3f1
files xen/Makefile xen/arch/x86/Makefile xen/common/Makefile xen/drivers/acpi/Makefile xen/drivers/char/Makefile xen/drivers/pci/Makefile
line diff
     1.1 --- a/xen/Makefile	Sat Jan 22 17:10:17 2005 +0000
     1.2 +++ b/xen/Makefile	Sat Jan 22 21:23:10 2005 +0000
     1.3 @@ -9,14 +9,15 @@ export BASEDIR          := $(shell pwd)
     1.4  
     1.5  include Rules.mk
     1.6  
     1.7 -default: $(TARGET)
     1.8 -	gzip -f -9 < $(TARGET) > $(TARGET).gz
     1.9 +default: $(TARGET).gz
    1.10 +$(TARGET).gz: $(TARGET)
    1.11 +	gzip -f -9 < $< > $@.new
    1.12 +	mv $@.new $@
    1.13  
    1.14  debug:	
    1.15  	objdump -D -S $(TARGET)-syms > $(TARGET).s
    1.16  
    1.17 -install: $(TARGET)
    1.18 -	gzip -f -9 < $(TARGET) > $(TARGET).gz
    1.19 +install: $(TARGET).gz
    1.20  	mkdir -p $(prefix)/boot
    1.21  	install -m0644 $(TARGET).gz $(prefix)/boot
    1.22  	install -m0644 $(TARGET)-syms $(prefix)/boot
     2.1 --- a/xen/arch/x86/Makefile	Sat Jan 22 17:10:17 2005 +0000
     2.2 +++ b/xen/arch/x86/Makefile	Sat Jan 22 21:23:10 2005 +0000
     2.3 @@ -12,11 +12,17 @@ OBJS += $(patsubst %.c,%.o,$(wildcard mt
     2.4  
     2.5  OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS))
     2.6  
     2.7 -default: boot/$(TARGET_SUBARCH).o $(OBJS) boot/mkelf32
     2.8 -	$(LD) $(LDFLAGS) -r -o arch.o $(OBJS)
     2.9 +default: $(TARGET)
    2.10 +
    2.11 +$(TARGET): $(TARGET)-syms boot/mkelf32
    2.12 +	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000
    2.13 +
    2.14 +$(CURDIR)/arch.o: $(OBJS)
    2.15 +	$(LD) $(LDFLAGS) -r -o $@ $(OBJS)
    2.16 +
    2.17 +$(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(TARGET_SUBARCH)/xen.lds
    2.18  	$(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \
    2.19 -	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $(TARGET)-syms
    2.20 -	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000
    2.21 +	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@
    2.22  
    2.23  asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
    2.24  	$(CC) $(CFLAGS) -S -o $@ $<
     3.1 --- a/xen/common/Makefile	Sat Jan 22 17:10:17 2005 +0000
     3.2 +++ b/xen/common/Makefile	Sat Jan 22 21:23:10 2005 +0000
     3.3 @@ -21,7 +21,8 @@ ifneq ($(trace),y)
     3.4  OBJS := $(subst trace.o,,$(OBJS))
     3.5  endif
     3.6  
     3.7 -default: $(OBJS)
     3.8 +default: common.o
     3.9 +common.o: $(OBJS)
    3.10  	$(LD) $(LDFLAGS) -r -o common.o $(OBJS)
    3.11  
    3.12  clean:
     4.1 --- a/xen/drivers/acpi/Makefile	Sat Jan 22 17:10:17 2005 +0000
     4.2 +++ b/xen/drivers/acpi/Makefile	Sat Jan 22 21:23:10 2005 +0000
     4.3 @@ -6,7 +6,8 @@ include $(BASEDIR)/Rules.mk
     4.4  
     4.5  OBJS := acpi_ksyms.o tables.o
     4.6  
     4.7 -default: $(OBJS)
     4.8 +default: driver.o
     4.9 +driver.o: $(OBJS)
    4.10  	$(LD) $(LDFLAGS) -r -o driver.o $(OBJS)
    4.11  
    4.12  clean:
     5.1 --- a/xen/drivers/char/Makefile	Sat Jan 22 17:10:17 2005 +0000
     5.2 +++ b/xen/drivers/char/Makefile	Sat Jan 22 21:23:10 2005 +0000
     5.3 @@ -1,7 +1,8 @@
     5.4  
     5.5  include $(BASEDIR)/Rules.mk
     5.6  
     5.7 -default: $(OBJS)
     5.8 +default: driver.o
     5.9 +driver.o: $(OBJS)
    5.10  	$(LD) $(LDFLAGS) -r -o driver.o $(OBJS)
    5.11  
    5.12  clean:
     6.1 --- a/xen/drivers/pci/Makefile	Sat Jan 22 17:10:17 2005 +0000
     6.2 +++ b/xen/drivers/pci/Makefile	Sat Jan 22 21:23:10 2005 +0000
     6.3 @@ -28,7 +28,8 @@ OBJS := pci.o quirks.o compat.o names.o 
     6.4  #obj-y += syscall.o
     6.5  #endif
     6.6  
     6.7 -default: $(OBJS)
     6.8 +default: driver.o
     6.9 +driver.o: $(OBJS)
    6.10  	$(LD) $(LDFLAGS) -r -o driver.o $(OBJS)
    6.11  
    6.12  clean: