diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-02-07 17:20:15 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-02-07 17:20:17 +0100 |
commit | 29cd4c35515961734d13d2f4dad5b1f12eae3b51 (patch) | |
tree | 4b44cf4aeb33d45b9fd8e3744f1fe0097435c8f4 | |
parent | 41fe063d0735cf0bef1301ccf9efe5f37d9fdc91 (diff) | |
download | liba2i-29cd4c35515961734d13d2f4dad5b1f12eae3b51.tar.gz |
share/mk/: install-lib-static: Install the static library with a separate target
Most distributions don't use static libraries. Allow installing without
the static library, by moving it to a separate target.
Suggested-by: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | GNUmakefile | 3 | ||||
-rw-r--r-- | share/mk/install-dev.mk | 7 | ||||
-rw-r--r-- | share/mk/install-lib.mk | 10 |
3 files changed, 13 insertions, 7 deletions
diff --git a/GNUmakefile b/GNUmakefile index 8765c11..02afec8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -58,8 +58,9 @@ help: $(info check Check the built library) $(info ) $(info install Wrapper for install-* targets) - $(info install-dev Install development files (.h, .a, .pc)) + $(info install-dev Install development files (.h, .pc)) $(info install-lib Install shared library (.so)) + $(info install-lib-static Install static library (.a)) $(info install-man Install manual pages) $(info ) $(info installcheck Check the installed library) diff --git a/share/mk/install-dev.mk b/share/mk/install-dev.mk index a6ffd5e..1e39f3f 100644 --- a/share/mk/install-dev.mk +++ b/share/mk/install-dev.mk @@ -14,7 +14,6 @@ include $(MAKEFILEDIR)/src.mk _tu_h := $(patsubst $(INCLUDEDIR)/%,$(_includedir)/%,$(TU_h)) -_lib_a := $(patsubst $(builddir)/%,$(_libdir)/%,$(_LIB_a)) _lib_pc := $(patsubst $(builddir)/%,$(_pcdir)/%,$(_LIB_pc)) @@ -22,17 +21,13 @@ $(_tu_h): $(_includedir)/%: $(INCLUDEDIR)/% $(MK) | $$(@D)/ $(info INSTALL $@) $(INSTALL_DATA) -T $< $@ -$(_lib_a): $(_libdir)/%: $(builddir)/% $(MK) | $$(@D)/ - $(info INSTALL $@) - $(INSTALL_DATA) -T $< $@ - $(_lib_pc): $(_pcdir)/%: $(builddir)/% $(MK) | $$(@D)/ $(info INSTALL $@) $(INSTALL_DATA) -T $< $@ .PHONY: install-dev -install-dev: $(_tu_h) $(_lib_a) $(_lib_pc) +install-dev: $(_tu_h) $(_lib_pc) @: diff --git a/share/mk/install-lib.mk b/share/mk/install-lib.mk index 7124702..381e0ba 100644 --- a/share/mk/install-lib.mk +++ b/share/mk/install-lib.mk @@ -15,6 +15,7 @@ include $(MAKEFILEDIR)/src.mk _lib_so := $(_libdir)/$(libname).so _lib_so_v := $(patsubst $(builddir)/%,$(_libdir)/%,$(_LIB_so_v)) +_lib_a := $(patsubst $(builddir)/%,$(_libdir)/%,$(_LIB_a)) $(_lib_so_v): $(_libdir)/%: $(builddir)/% $(MK) | $$(@D)/ @@ -25,10 +26,19 @@ $(_lib_so): $(_lib_so_v) $(info LN $@) $(LN) -sfT $@.$(MAJOR_VERSION) $@ +$(_lib_a): $(_libdir)/%: $(builddir)/% $(MK) | $$(@D)/ + $(info INSTALL $@) + $(INSTALL_DATA) -T $< $@ + .PHONY: install-lib install-lib: $(_lib_so_v) $(_lib_so) @: +.PHONY: install-lib-static +install-lib-static: $(_lib_a) + @: + + endif # include guard |