ia64/xen-unstable

changeset 10953:ea04335d238b

[blktap] Add dependencies to Makefiles and simplify to avoid needless rebuilds.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Thu Aug 03 19:45:14 2006 +0100 (2006-08-03)
parents 646092d50e82
children e47aad0605a3
files tools/blktap/drivers/Makefile tools/blktap/lib/Makefile
line diff
     1.1 --- a/tools/blktap/drivers/Makefile	Thu Aug 03 19:19:27 2006 +0100
     1.2 +++ b/tools/blktap/drivers/Makefile	Thu Aug 03 19:45:14 2006 +0100
     1.3 @@ -49,21 +49,18 @@ all: $(IBIN) qcow-util
     1.4  LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
     1.5  
     1.6  
     1.7 -blktapctrl: 
     1.8 +blktapctrl: blktapctrl.c
     1.9  	$(CC) $(CFLAGS) -o blktapctrl $(LIBS) blktapctrl.c
    1.10  
    1.11 -tapdisk: $(BLK-OBJS)
    1.12 +tapdisk: $(BLK-OBJS) tapdisk.c
    1.13  	$(CC) $(CFLAGS) -o tapdisk $(BLK-OBJS) tapdisk.c \
    1.14  		$(AIOLIBS) $(LIBS)
    1.15  
    1.16 +.PHONY: qcow-util
    1.17 +qcow-util: img2qcow qcow2raw qcow-create
    1.18  
    1.19 -qcow-util: $(BLK-OBJS)
    1.20 -	$(CC) $(CFLAGS) -o img2qcow $(BLK-OBJS) img2qcow.c \
    1.21 -		$(AIOLIBS)  $(LIBS)
    1.22 -	$(CC) $(CFLAGS) -o qcow2raw $(BLK-OBJS) qcow2raw.c  \
    1.23 -		$(AIOLIBS)  $(LIBS)
    1.24 -	$(CC) $(CFLAGS) -o qcow-create $(BLK-OBJS) qcow-create.c  \
    1.25 -		$(AIOLIBS)  $(LIBS)
    1.26 +img2qcow qcow2raw qcow-create: %: $(BLK-OBJS)
    1.27 +	$(CC) $(CFLAGS) -o $* $(BLK-OBJS) $*.c $(AIOLIBS)  $(LIBS)
    1.28  
    1.29  install: all
    1.30  	$(INSTALL_PROG) $(IBIN) $(QCOW_UTIL) $(DESTDIR)$(INSTALL_DIR)
     2.1 --- a/tools/blktap/lib/Makefile	Thu Aug 03 19:19:27 2006 +0100
     2.2 +++ b/tools/blktap/lib/Makefile	Thu Aug 03 19:45:14 2006 +0100
     2.3 @@ -35,10 +35,14 @@ IBINS   :=
     2.4  
     2.5  LIB      = libblktap.a libblktap.so.$(MAJOR).$(MINOR)
     2.6  
     2.7 +.PHONY: all
     2.8  all: build
     2.9  
    2.10 -build:
    2.11 -	$(MAKE) libblktap
    2.12 +.PHONY: build
    2.13 +build: libblktap.a
    2.14 +
    2.15 +.PHONY: libblktap
    2.16 +libblktap: libblktap.a
    2.17  
    2.18  install: all
    2.19  	$(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
    2.20 @@ -51,13 +55,13 @@ install: all
    2.21  clean:
    2.22  	rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
    2.23  
    2.24 -libblktap: $(OBJS) 
    2.25 +libblktap.a: $(OBJS) 
    2.26  	$(CC) $(CFLAGS) -Wl,-soname -Wl,$(SONAME) -shared         \
    2.27  	      -L$(XEN_XENSTORE) -l xenstore                       \
    2.28  	      -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
    2.29  	ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
    2.30 -	ln -sf libblktap.so.$(MAJOR) $@.so
    2.31 -	ar rc libblktap.a $@.so
    2.32 +	ln -sf libblktap.so.$(MAJOR) libblktap.so
    2.33 +	ar rc $@ libblktap.so
    2.34  
    2.35  .PHONY: TAGS all build clean install libblktap
    2.36