ia64/xen-unstable

changeset 17213:fea44c1d3e41

Clean up blktap Makefiles.

Signed-off-by: Bastian Blank <waldi@debian.org>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Mar 17 10:57:59 2008 +0000 (2008-03-17)
parents bf8a3fc79093
children e534d7c9029c
files tools/blktap/drivers/Makefile tools/blktap/lib/Makefile
line diff
     1.1 --- a/tools/blktap/drivers/Makefile	Mon Mar 17 10:45:24 2008 +0000
     1.2 +++ b/tools/blktap/drivers/Makefile	Mon Mar 17 10:57:59 2008 +0000
     1.3 @@ -1,26 +1,24 @@
     1.4  XEN_ROOT = ../../..
     1.5  include $(XEN_ROOT)/tools/Rules.mk
     1.6  
     1.7 -INCLUDES += -I.. -I../lib -I$(XEN_INCLUDE)
     1.8 -
     1.9  IBIN         = blktapctrl tapdisk
    1.10  QCOW_UTIL    = img2qcow qcow2raw qcow-create
    1.11  LIBAIO_DIR   = ../../libaio/src
    1.12  
    1.13  CFLAGS   += -Werror
    1.14  CFLAGS   += -Wno-unused
    1.15 -CFLAGS   += $(CFLAGS_libxenctrl) -I $(LIBAIO_DIR)
    1.16 -CFLAGS   += $(INCLUDES) -I. -I../../xenstore 
    1.17 +CFLAGS   += -I../lib
    1.18 +CFLAGS   += $(CFLAGS_libxenctrl)
    1.19 +CFLAGS   += $(CFLAGS_libxenstore)
    1.20 +CFLAGS   += -I $(LIBAIO_DIR)
    1.21  CFLAGS   += -D_GNU_SOURCE
    1.22  
    1.23  # Get gcc to generate the dependencies for us.
    1.24  CFLAGS   += -Wp,-MD,.$(@F).d
    1.25  DEPS      = .*.d
    1.26  
    1.27 -LIBS      := -L. -L.. -L../lib
    1.28 -LIBS      += -Wl,-rpath-link,$(XEN_XENSTORE)
    1.29 -
    1.30 -LIBS_IMG  := $(LIBAIO_DIR)/libaio.a -lcrypto -lpthread -lz
    1.31 +LDFLAGS_blktapctrl := $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenstore) -L../lib -lblktap
    1.32 +LDFLAGS_img := $(LIBAIO_DIR)/libaio.a -lcrypto -lpthread -lz
    1.33  
    1.34  BLK-OBJS-y  := block-aio.o
    1.35  BLK-OBJS-y  += block-sync.o
    1.36 @@ -34,17 +32,17 @@ BLK-OBJS-$(CONFIG_Linux) += blk_linux.c
    1.37  
    1.38  all: $(IBIN) qcow-util
    1.39  
    1.40 -blktapctrl: blktapctrl.c
    1.41 -	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) -lblktap $(LDFLAGS_libxenctrl)
    1.42 +blktapctrl: blktapctrl.o
    1.43 +	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDFLAGS_blktapctrl)
    1.44  
    1.45 -tapdisk: tapdisk.c $(BLK-OBJS-y) tapdisk.c
    1.46 -	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_IMG)
    1.47 +tapdisk: tapdisk.o $(BLK-OBJS-y)
    1.48 +	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDFLAGS_img)
    1.49  
    1.50  .PHONY: qcow-util
    1.51  qcow-util: img2qcow qcow2raw qcow-create
    1.52  
    1.53 -img2qcow qcow2raw qcow-create: %: $(BLK-OBJS-y)
    1.54 -	$(CC) $(CFLAGS) -o $* $(BLK-OBJS-y) $*.c $(LDFLAGS) $(LIBS_IMG)
    1.55 +img2qcow qcow2raw qcow-create: %: %.o $(BLK-OBJS-y)
    1.56 +	$(CC) $(CFLAGS) -o $* $^ $(LDFLAGS) $(LDFLAGS_img)
    1.57  
    1.58  install: all
    1.59  	$(INSTALL_PROG) $(IBIN) $(QCOW_UTIL) $(VHD_UTIL) $(DESTDIR)$(SBINDIR)
     2.1 --- a/tools/blktap/lib/Makefile	Mon Mar 17 10:45:24 2008 +0000
     2.2 +++ b/tools/blktap/lib/Makefile	Mon Mar 17 10:57:59 2008 +0000
     2.3 @@ -5,8 +5,9 @@ MAJOR    = 3.0
     2.4  MINOR    = 0
     2.5  SONAME   = libblktap.so.$(MAJOR)
     2.6  
     2.7 -INCLUDES += -I. -I.. -I $(XEN_LIBXC) -I$(XEN_INCLUDE) $(CFLAGS_libxenstore)
     2.8 -
     2.9 +CFLAGS   += -I.
    2.10 +CFLAGS   += $(CFLAGS_libxenctrl)
    2.11 +CFLAGS   += $(CFLAGS_libxenstore)
    2.12  LDFLAGS  += $(LDFLAGS_libxenstore)
    2.13  
    2.14  SRCS     :=
    2.15 @@ -20,23 +21,18 @@ CFLAGS   += -D _GNU_SOURCE
    2.16  
    2.17  # Get gcc to generate the dependencies for us.
    2.18  CFLAGS   += -Wp,-MD,.$(@F).d
    2.19 -CFLAGS   += $(INCLUDES) 
    2.20  DEPS     = .*.d
    2.21  
    2.22 -OBJS     = $(patsubst %.c,%.o,$(SRCS))
    2.23 +OBJS     = $(SRCS:.c=.o)
    2.24 +OBJS_PIC = $(SRCS:.c=.opic)
    2.25  IBINS   :=
    2.26  
    2.27  LIB      = libblktap.a libblktap.so.$(MAJOR).$(MINOR)
    2.28  
    2.29  .PHONY: all
    2.30 -all: build
    2.31 +all: $(LIB)
    2.32  
    2.33 -.PHONY: build
    2.34 -build: libblktap.a
    2.35 -
    2.36 -.PHONY: libblktap
    2.37 -libblktap: libblktap.a
    2.38 -
    2.39 +.PHONY: install
    2.40  install: all
    2.41  	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
    2.42  	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
    2.43 @@ -45,19 +41,20 @@ install: all
    2.44  	ln -sf libblktap.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libblktap.so
    2.45  	$(INSTALL_DATA) blktaplib.h $(DESTDIR)$(INCLUDEDIR)
    2.46  
    2.47 +.PHONY: clean
    2.48  clean:
    2.49  	rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
    2.50  
    2.51 -libblktap.a: $(OBJS) 
    2.52 +libblktap.so.$(MAJOR).$(MINOR): $(OBJS_PIC) 
    2.53  	$(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_CFLAGS) \
    2.54 -	      -L$(XEN_XENSTORE) $(LDFLAGS)                                 \
    2.55 -	      -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
    2.56 +	      $(LDFLAGS) -o $@ $^
    2.57  	ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
    2.58  	ln -sf libblktap.so.$(MAJOR) libblktap.so
    2.59 -	$(AR) rc $@ libblktap.so
    2.60  
    2.61 -.PHONY: TAGS all build clean install libblktap
    2.62 +libblktap.a: $(OBJS) 
    2.63 +	$(AR) rc $@ $^
    2.64  
    2.65 +.PHONY: TAGS
    2.66  TAGS:
    2.67  	etags -t $(SRCS) *.h
    2.68