From 541be7aa2f9d7d0d94ec868367ab8c843e8329ce Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 5 Apr 2004 20:48:07 +0000 Subject: [PATCH] Combine static/dynamic build. --- dmsetup/Makefile.in | 24 +++++++++++++++++------- lib/Makefile.in | 6 +++--- make.tmpl.in | 4 ---- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/dmsetup/Makefile.in b/dmsetup/Makefile.in index c1feeed..d0e6684 100644 --- a/dmsetup/Makefile.in +++ b/dmsetup/Makefile.in @@ -16,24 +16,34 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ +TARGETS = dmsetup +INSTALL_TYPE = install_dynamic + ifeq ("@STATIC_LINK@", "yes") - TARGET = dmsetup.static -else - TARGET = dmsetup + TARGETS += dmsetup.static + INSTALL_TYPE += install_dynamic endif SOURCES = dmsetup.c -TARGETS = $(TARGET) CLEAN_TARGETS = dmsetup dmsetup.static include ../make.tmpl -$(TARGET): $(OBJECTS) $(interfacedir)/libdevmapper.so \ - $(interfacedir)/libdevmapper.a +dmsetup: $(OBJECTS) $(interfacedir)/libdevmapper.so $(CC) -o $@ $(OBJECTS) $(LD_FLAGS) \ -L$(interfacedir) -L$(DESTDIR)/lib $(LIBS) \ -ldevmapper -install: $(TARGET) +dmsetup.static: $(OBJECTS) $(interfacedir)/libdevmapper.a + $(CC) -o $@ $(OBJECTS) $(LD_FLAGS) -static \ + -L$(interfacedir) -L$(DESTDIR)/lib $(LIBS) \ + -ldevmapper + +install: $(INSTALL_TYPE) + +install_static: $(TARGETS) + $(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$< + +install_dynamic: $(TARGETS) $(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) $< $(sbindir)/$< diff --git a/lib/Makefile.in b/lib/Makefile.in index 9d2a13f..320a5fa 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -29,10 +29,10 @@ include ../make.tmpl .PHONY: install_dynamic install_static \ install_@interface@ install_@interface@_static +INSTALL_TYPE = install_dynamic + ifeq ("@STATIC_LINK@", "yes") - INSTALL_TYPE = install_static -else - INSTALL_TYPE = install_dynamic + INSTALL_TYPE += install_static endif install: $(INSTALL_TYPE) diff --git a/make.tmpl.in b/make.tmpl.in index 05365c7..03f6026 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -71,10 +71,6 @@ endif LD_FLAGS += -L$(interfacedir) -ifeq ("@STATIC_LINK@", "yes") - LD_FLAGS += -static -endif - ifeq ("@COMPAT@", "yes") CFLAGS += -DDM_COMPAT endif -- 2.43.5