From 2b600eafa7288c3bf483e35072abb385b18a22d7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 24 Apr 2020 21:12:10 +0200 Subject: [PATCH] Build static on Linux. --- Makefile | 14 ++++++++++++-- cscript | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 076a021..8125659 100644 --- a/Makefile +++ b/Makefile @@ -19,19 +19,29 @@ COMMON_DEFINITIONS = \ -DVERSION_MINOR=$(VERSION_MINOR) \ -DVERSION_PATCH=$(VERSION_PATCH) \ -DVERSION=$(VERSION) \ - -DLWEXT4_BUILD_SHARED_LIB=ON \ define generate_common rm -R -f build_$(1) mkdir build_$(1) cd build_$(1) && cmake -G"Unix Makefiles" \ $(COMMON_DEFINITIONS) \ + -DLWEXT4_BUILD_SHARED_LIB=ON \ + $(2) \ + -DCMAKE_TOOLCHAIN_FILE=../toolchain/$(1).cmake .. +endef + +define generate_common_static + rm -R -f build_$(1) + mkdir build_$(1) + cd build_$(1) && cmake -G"Unix Makefiles" \ + $(COMMON_DEFINITIONS) \ + -DLWEXT4_BUILD_SHARED_LIB=OFF \ $(2) \ -DCMAKE_TOOLCHAIN_FILE=../toolchain/$(1).cmake .. endef generic: - $(call generate_common,$@) + $(call generate_common_static,$@) osx: $(call generate_common,$@) diff --git a/cscript b/cscript index 57e7e88..e118e15 100644 --- a/cscript +++ b/cscript @@ -21,7 +21,7 @@ def build(target, options): if target.platform == 'linux': type = 'generic' blockdev = 'linux' - ext = 'so' + ext = 'a' device = 'dev' elif target.platform == 'osx': if target.bits == 64: -- 2.30.2