From 437219e27dab4a5cbf8fe27e6ab4e6f7c6291c76 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 5 Oct 2009 13:46:00 +0000 Subject: [PATCH] More makefile cleaning up and fixing. (gentoo) --- daemons/clvmd/Makefile.in | 2 +- daemons/cmirrord/Makefile.in | 2 +- daemons/dmeventd/Makefile.in | 5 ++--- daemons/dmeventd/plugins/mirror/Makefile.in | 3 ++- daemons/dmeventd/plugins/snapshot/Makefile.in | 3 ++- lib/Makefile.in | 3 ++- tools/Makefile.in | 17 +++++++++-------- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/daemons/clvmd/Makefile.in b/daemons/clvmd/Makefile.in index 109a8b0a3..dad568e29 100644 --- a/daemons/clvmd/Makefile.in +++ b/daemons/clvmd/Makefile.in @@ -92,7 +92,7 @@ INSTALL_TARGETS = \ install_clvmd clvmd: $(OBJECTS) $(top_builddir)/lib/liblvm-internal.a - $(CC) -o clvmd $(OBJECTS) $(CFLAGS) $(LDFLAGS) \ + $(CC) $(CFLAGS) $(LDFLAGS) -o clvmd $(OBJECTS) \ $(LVMLIBS) $(LMLIBS) $(LIBS) .PHONY: install_clvmd diff --git a/daemons/cmirrord/Makefile.in b/daemons/cmirrord/Makefile.in index 2bf1e3511..debab2746 100644 --- a/daemons/cmirrord/Makefile.in +++ b/daemons/cmirrord/Makefile.in @@ -32,7 +32,7 @@ LMLIBS += $(CPG_LIBS) $(SACKPT_LIBS) CFLAGS += $(CPG_CFLAGS) $(SACKPT_CFLAGS) cmirrord: $(OBJECTS) $(top_builddir)/lib/liblvm-internal.a - $(CC) -o cmirrord $(OBJECTS) $(LDFLAGS) \ + $(CC) $(CFLAGS) $(LDFLAGS) -o cmirrord $(OBJECTS) \ $(LVMLIBS) $(LMLIBS) $(LIBS) install: $(TARGETS) diff --git a/daemons/dmeventd/Makefile.in b/daemons/dmeventd/Makefile.in index e16b14542..207c0e25b 100644 --- a/daemons/dmeventd/Makefile.in +++ b/daemons/dmeventd/Makefile.in @@ -42,11 +42,10 @@ include ../../make.tmpl all: dmeventd device-mapper: dmeventd $(LIB_STATIC) -LDFLAGS += -ldl -ldevmapper -lpthread -CLDFLAGS += -ldl -ldevmapper -lpthread +LIBS += -ldl -ldevmapper -lpthread dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o - $(CC) -o $@ dmeventd.o $(CFLAGS) $(LDFLAGS) \ + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ dmeventd.o \ -L. -ldevmapper-event $(LIBS) -rdynamic .PHONY: install_dynamic install_static install_include \ diff --git a/daemons/dmeventd/plugins/mirror/Makefile.in b/daemons/dmeventd/plugins/mirror/Makefile.in index 1bc586a3e..581e5ec5d 100644 --- a/daemons/dmeventd/plugins/mirror/Makefile.in +++ b/daemons/dmeventd/plugins/mirror/Makefile.in @@ -18,7 +18,8 @@ top_builddir = @top_builddir@ VPATH = @srcdir@ INCLUDES += -I${top_srcdir}/tools -CLDFLAGS += -L${top_builddir}/tools -ldevmapper @LVM2CMD_LIB@ +CLDFLAGS += -L${top_builddir}/tools +LIBS += -ldevmapper @LIB_PTHREAD@ @LVM2CMD_LIB@ SOURCES = dmeventd_mirror.c diff --git a/daemons/dmeventd/plugins/snapshot/Makefile.in b/daemons/dmeventd/plugins/snapshot/Makefile.in index 27791542a..823ca3fdd 100644 --- a/daemons/dmeventd/plugins/snapshot/Makefile.in +++ b/daemons/dmeventd/plugins/snapshot/Makefile.in @@ -18,7 +18,8 @@ top_builddir = @top_builddir@ VPATH = @srcdir@ INCLUDES += -I${top_srcdir}/tools -CLDFLAGS += -L${top_builddir}/tools -ldevmapper @LVM2CMD_LIB@ +CLDFLAGS += -L${top_builddir}/tools +LIBS += -ldevmapper @LIB_PTHREAD@ @LVM2CMD_LIB@ SOURCES = dmeventd_snapshot.c diff --git a/lib/Makefile.in b/lib/Makefile.in index 9396fb2d0..2bd6fbad9 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -138,7 +138,8 @@ ifeq ("@HAVE_LIBDL@", "yes") endif ifeq ("@DMEVENTD@", "yes") - CLDFLAGS += -ldevmapper-event + CLDFLAGS += -L../daemons/dmeventd + LIBS += -ldevmapper-event endif LIB_NAME = liblvm-internal diff --git a/tools/Makefile.in b/tools/Makefile.in index 7d8e68628..5702f4f96 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -17,6 +17,8 @@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ +LIB_PTHREAD = @LIB_PTHREAD@ + SOURCES =\ dumpconfig.c \ formats.c \ @@ -110,24 +112,23 @@ include ../make.tmpl device-mapper: $(TARGETS_DM) dmsetup: dmsetup.o $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX) - $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) \ - -L$(top_builddir)/libdm -ldevmapper $(LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ dmsetup.o \ + -L$(top_builddir)/libdm -ldevmapper $(LIBS) $(LIB_PTHREAD) dmsetup.static: dmsetup.o $(interfacedir)/libdevmapper.a - $(CC) -o $@ dmsetup.o $(CFLAGS) $(LDFLAGS) -static \ + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ dmsetup.o -static \ -L$(interfacedir) -ldevmapper $(LIBS) \ $(LIB_PTHREAD) all: device-mapper lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a - $(CC) -o $@ $(CFLAGS) $(OBJECTS) lvm.o \ - $(LDFLAGS) $(LVMLIBS) $(LIBS) -rdynamic + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) lvm.o \ + $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic -LIB_PTHREAD = @LIB_PTHREAD@ lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacedir)/libdevmapper.a - $(CC) -o $@ $(CFLAGS) $(OBJECTS) lvm-static.o -static \ - -L$(interfacedir) $(LDFLAGS) $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) lvm-static.o -static \ + -L$(interfacedir) $(LVMLIBS) $(LIBS) $(LIB_PTHREAD) -rdynamic liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o cat $(top_builddir)/lib/liblvm-internal.a > $@ -- 2.43.5