aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/libssh/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/depends/target/libssh/Makefile')
-rw-r--r--tools/depends/target/libssh/Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/depends/target/libssh/Makefile b/tools/depends/target/libssh/Makefile
new file mode 100644
index 0000000000..62b6f74f2f
--- /dev/null
+++ b/tools/depends/target/libssh/Makefile
@@ -0,0 +1,41 @@
+include ../../Makefile.include
+DEPS= ../../Makefile.include Makefile removelegacy.patch android.patch
+
+# lib name, version
+LIBNAME=libssh
+VERSION=0.5.0
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+LIBDYLIB=$(PLATFORM)/build/src/$(LIBNAME).a
+
+all: .installed-$(PLATFORM)
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
+ rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ cd $(PLATFORM); rm -rf build; mkdir -p build
+ cd $(PLATFORM); patch -p0 < ../removelegacy.patch
+ cd $(PLATFORM); patch -p0 < ../android.patch
+ cd $(PLATFORM); patch -p0 < ../md5.patch
+ sed -ie "s|-fstack-protector|-fnostack-protector|" "$(PLATFORM)/cmake/Modules/DefineCompilerFlags.cmake"
+ sed -ie "s|add_subdirectory(examples)||" "$(PLATFORM)/CMakeLists.txt"
+ cd $(PLATFORM)/build; $(CMAKE) -DWITH_STATIC_LIB=1 VERBOSE=1 ..
+
+$(LIBDYLIB): $(PLATFORM)
+ make -j 1 -C $(PLATFORM)/build
+
+.installed-$(PLATFORM): $(LIBDYLIB)
+ make -C $(PLATFORM)/build install
+ rm -f $(PREFIX)/lib/libssh.so $(PREFIX)/lib/libssh.so.4.2.0 $(PREFIX)/lib/libssh.so.4
+ rm -f $(PREFIX)/lib/libssh.*dylib*
+ touch $@
+
+clean:
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)
+
+distclean::
+ rm -rf $(PLATFORM) .installed-$(PLATFORM)