From: zkabelac@sourceware.org
To: dm-cvs@sourceware.org, dm-devel@redhat.com
Subject: dmraid/lib Makefile.in
Date: 28 May 2010 12:35:02 -0000 [thread overview]
Message-ID: <20100528123502.18489.qmail@sourceware.org> (raw)
CVSROOT: /cvs/dm
Module name: dmraid
Changes by: zkabelac@sourceware.org 2010-05-28 12:35:02
Modified files:
lib : Makefile.in
Log message:
Reworked installation of libraries and plugins
Using relpath.awk for path between usrlibdir and libdir
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/dmraid/lib/Makefile.in.diff?cvsroot=dm&r1=1.11&r2=1.12
--- dmraid/lib/Makefile.in 2010/05/28 09:17:25 1.11
+++ dmraid/lib/Makefile.in 2010/05/28 12:35:01 1.12
@@ -47,18 +47,19 @@
format/partition/dos.c
ifeq ("@STATIC_LINK@", "no")
- SOURCES += register/dmreg.c
# Dynamic linker library
-LIBS += -ldl
+ LIBS += -ldl
+ SOURCES += register/dmreg.c
endif
SOURCES2 = events/$(LIB_EVENTS_NAME).c
-LIB_STATIC=$(top_builddir)/lib/libdmraid.a
-LIB_EVENTS_NAME=libdmraid-events-isw
+LIB_STATIC = $(top_builddir)/lib/libdmraid.a
+LIB_EVENTS_NAME = libdmraid-events-isw
+USRLIB_RELPATH = $(shell echo $(abspath $(usrlibdir) $(libdir)) | \
+ $(AWK) -f $(top_srcdir)/tools/relpath.awk)
-TARGETS=$(LIB_STATIC)
-INSTALL_TARGETS=$(LIB_STATIC)
+TARGETS = $(LIB_STATIC)
include $(top_builddir)/make.tmpl
@@ -67,43 +68,40 @@
LIB_SHARED=$(top_builddir)/lib/libdmraid.so
LIB_EVENTS_SHARED=$(LIB_EVENTS_NAME).so
TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED)
- INSTALL_TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED)
endif
endif
all: $(TARGETS)
- @echo $(TARGETS) $(INSTALL_TARGETS)
$(LIB_EVENTS_SHARED): $(OBJECTS2)
$(CC) -o $@ $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(OBJECTS2) \
-shared -Wl,-soname,$(notdir $@).$(DMRAID_LIB_VERSION) \
$(LIB_SHARED) -ldevmapper-event -lpthread
-.PHONY: install_dmraid_libs remove_dmraid_libs
+.PHONY: $(addprefix install_,$(TARGETS)) $(addprefix remove_,$(TARGETS))
+
+install_$(LIB_EVENTS_SHARED): $(LIB_EVENTS_SHARED)
+ $(INSTALL_PROGRAM) -D $< $(DESTDIR)$(libdir)/device-mapper/$(<F)
+ $(LN_S) -f device-mapper/$(<F) $(DESTDIR)$(libdir)/$(<F)
+
+remove_$(LIB_EVENTS_SHARED):
+ $(RM) $(DESTDIR)$(libdir)/device-mapper/$(notdir $(LIB_EVENTS_SHARED))
+ $(RM) $(DESTDIR)$(libdir)/$(notdir $(LIB_EVENTS_SHARED))
+
+install_$(LIB_SHARED): $(LIB_SHARED)
+ $(INSTALL_PROGRAM) -D $< $(DESTDIR)$(libdir)/$(<F).$(DMRAID_LIB_VERSION)
+ $(INSTALL_DIR) $(DESTDIR)$(usrlibdir)
+ $(LN_S) -f $(USRLIB_RELPATH)$(<F).$(DMRAID_LIB_VERSION) $(DESTDIR)$(usrlibdir)/$(<F)
+
+remove_$(LIB_SHARED):
+ $(RM) $(DESTDIR)$(libdir)/$(notdir $(LIB_SHARED)).$(DMRAID_LIB_VERSION)
+ $(RM) $(DESTDIR)$(usrlibdir)/$(notdir $(LIB_SHARED))
+
+install_$(LIB_STATIC): $(LIB_STATIC)
+ $(INSTALL_DATA) -D $< $(DESTDIR)$(usrlibdir)/$(LIB_STATIC)
-install_dmraid_libs: $(INSTALL_TARGETS)
- @echo "Installing $(INSTALL_TARGETS) in $(DESTDIR)$(libdir)"; \
- $(INSTALL_DIR) $(DESTDIR)$(libdir); \
- for f in $(INSTALL_TARGETS); \
- do \
- n=$$(basename $${f}) ; \
- if [[ "$$n" =~ .so$$ ]]; then \
- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(libdir)/$${n}.$(DMRAID_LIB_VERSION); \
- $(LN_S) -f $${n}.$(DMRAID_LIB_VERSION) $(DESTDIR)$(libdir)/$${n}; \
- else \
- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(libdir)/$${n}; \
- fi \
- done
-
-install: install_dmraid_libs
-
-remove_dmraid_libs:
- @echo "Removing $(INSTALL_TARGETS) from $(libdir)"; \
- for f in $(INSTALL_TARGETS); \
- do \
- n=$$(basename $${f}) ; \
- $(RM) $(DESTDIR)$(libdir)/$${n}.$(DMRAID_LIB_VERSION); \
- $(RM) $(DESTDIR)$(libdir)/$${n}; \
- done
+remove_$(LIB_STATIC):
+ $(RM) $(DESTDIR)$(usrlibdir)/$(notdir $(LIB_STATIC))
-remove: remove_dmraid_libs
+install: $(addprefix install_,$(TARGETS))
+remove: $(addprefix remove_,$(TARGETS))
next reply other threads:[~2010-05-28 12:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 12:35 zkabelac [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-05-30 22:21 dmraid/lib Makefile.in zkabelac
2010-05-30 17:41 zkabelac
2010-05-28 8:46 zkabelac
2010-05-27 19:47 zkabelac
2009-09-16 11:51 heinzm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100528123502.18489.qmail@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=dm-cvs@sourceware.org \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox