diff --git a/build.gradle b/build.gradle index e48593810c..76451613a7 100644 --- a/build.gradle +++ b/build.gradle @@ -262,6 +262,20 @@ publishing { type "a" extension "a" } + + if (buildOption == "-lzma") { + artifact("${nativeBuildDir}/libavian-lzma.a") { + name "libavian-lzma" + type "a" + extension "a" + } + + artifact("${nativeBuildDir}/lzma/lzma") { + name "lzma" + type publishBinSuffix + extension binSuffix + } + } } } } diff --git a/makefile b/makefile index 72b9079e30..ebd837340e 100755 --- a/makefile +++ b/makefile @@ -1409,6 +1409,8 @@ ifneq ($(lzma),) $(call generator-c-objects,$(lzma-encoder-lzma-sources),$(lzma)/C,$(build)) lzma-loader = $(build)/lzma/load.o + + lzma-library = $(build)/libavian-lzma.a endif generator-cpp-objects = \ @@ -1586,11 +1588,11 @@ test-args = $(test-flags) $(input) .PHONY: build ifneq ($(supports_avian_executable),false) -build: $(static-library) $(executable) $(dynamic-library) $(lzma-loader) \ +build: $(static-library) $(executable) $(dynamic-library) $(lzma-library) \ $(lzma-encoder) $(executable-dynamic) $(classpath-dep) $(test-dep) \ $(test-extra-dep) $(embed) $(build)/classpath.jar else -build: $(static-library) $(dynamic-library) $(lzma-loader) \ +build: $(static-library) $(dynamic-library) $(lzma-library) \ $(lzma-encoder) $(classpath-dep) $(test-dep) \ $(test-extra-dep) $(embed) $(build)/classpath.jar endif @@ -1920,6 +1922,21 @@ $(lzma-encoder-objects): $(build)/lzma/%.o: $(src)/lzma/%.cpp $(lzma-encoder): $(lzma-encoder-objects) $(lzma-encoder-lzma-objects) $(build-cc) $(^) -g -o $(@) +$(lzma-library): $(lzma-loader) $(lzma-decode-objects) + @echo "creating $(@)" + @rm -rf $(build)/libavian-lzma + @mkdir -p $(build)/libavian-lzma + rm -rf $(@) + for x in $(^); \ + do cp $${x} $(build)/libavian-lzma/$$(echo $${x} | sed s:/:_:g); \ + done +ifdef ms_cl_compiler + $(ar) $(arflags) $(build)/libavian-lzma/*.o -out:$(@) +else + $(ar) cru $(@) $(build)/libavian-lzma/*.o + $(ranlib) $(@) +endif + $(lzma-loader): $(src)/lzma/load.cpp $(compile-object)