summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <colomar.6.4.3@gmail.com>2020-04-13 16:09:31 +0200
committerAlejandro Colomar <colomar.6.4.3@gmail.com>2020-04-13 16:09:31 +0200
commit08e41d56c28c3570a595e292fee588208f3e6974 (patch)
tree3cfe4cad711e5bd5b4db35109beb1af53906f2e0
parentdeb550efa44aae46bb670db82bf51b06d9c38e94 (diff)
Link statically everything possible
-rw-r--r--Makefile19
1 files changed, 14 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index aebb858..26a2e35 100644
--- a/Makefile
+++ b/Makefile
@@ -54,11 +54,20 @@ export CFLAGS
################################################################################
# libs
-LIBS = -flto
-LIBS += -fuse-linker-plugin
-LIBS += -Wno-error
-LIBS += `pkg-config --libs libalx-cv`
-LIBS += `pkg-config --libs libalx-base`
+
+LIBS_OPT = -O3
+LIBS_OPT += -flto
+LIBS_OPT += -fuse-linker-plugin
+
+LIBS_PKG_A += `pkg-config --libs --static libalx-base`
+
+LIBS_PKG_SO += `pkg-config --libs libalx-cv`
+
+LIBS_PKG = -Wl,-Bstatic $(LIBS_PKG_A) -Wl,-Bdynamic $(LIBS_PKG_SO)
+
+LIBS = -Wno-error
+LIBS += $(LIBS_OPT)
+LIBS += $(LIBS_PKG)
export LIBS