-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Replaced setup.sh with target `standalone` in Makefile - Updated documentation accordingly - Updated CMakeLists_standalone to work with it now being used from Make (some path things for libdeepspeech.so) - Fixed some wrongly formatted javadoc in DeepSpeechModel.java
- Loading branch information
TheDutchMC
committed
Jan 19, 2021
1 parent
0fa0f15
commit c4874d2
Showing
7 changed files
with
82 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,71 @@ | ||
.PHONY: clean apk-clean | ||
|
||
include ../definitions.mk | ||
|
||
ARCHS := $(shell grep 'ABI_FILTERS' libdeepspeech/gradle.properties | cut -d'=' -f2 | sed -e 's/;/ /g') | ||
GRADLE ?= ./gradlew | ||
|
||
all: apk | ||
|
||
clean: apk-clean | ||
rm -rf *.java jni/deepspeech_wrap.cpp | ||
|
||
apk-clean: | ||
$(GRADLE) clean | ||
|
||
libs-clean: | ||
rm -fr libdeepspeech/libs/*/libdeepspeech.so | ||
|
||
libdeepspeech/libs/%/libdeepspeech.so: | ||
-mkdir libdeepspeech/libs/$*/ | ||
cp ${TFDIR}/bazel-out/$*-*/bin/native_client/libdeepspeech.so libdeepspeech/libs/$*/ | ||
|
||
apk: apk-clean bindings $(patsubst %,libdeepspeech/libs/%/libdeepspeech.so,$(ARCHS)) | ||
$(GRADLE) build | ||
|
||
maven-bundle: apk | ||
$(GRADLE) uploadArchives | ||
$(GRADLE) zipMavenArtifacts | ||
|
||
bindings: clean ds-swig | ||
$(DS_SWIG_ENV) swig -c++ -java -package org.deepspeech.libdeepspeech -outdir libdeepspeech/src/main/java/org/deepspeech/libdeepspeech/ -o jni/deepspeech_wrap.cpp jni/deepspeech.i | ||
.PHONY: clean apk-clean jre jre-prepare jre-libdeepspeech-jni jre-gradle jre-collect jre-clean apk-prepare | ||
|
||
include ../definitions.mk | ||
|
||
ARCHS := $(shell grep 'ABI_FILTERS' libdeepspeech/gradle.properties | cut -d'=' -f2 | sed -e 's/;/ /g') | ||
GRADLE ?= ./gradlew | ||
|
||
all: apk jre | ||
android: apk | ||
standalone: jre | ||
|
||
clean: apk-clean jre-clean | ||
rm -rf *.java jni/deepspeech_wrap.cpp | ||
|
||
apk-clean: | ||
$(GRADLE) clean | ||
|
||
libs-clean: | ||
rm -fr libdeepspeech/libs/*/libdeepspeech.so | ||
|
||
libdeepspeech/libs/%/libdeepspeech.so: | ||
-mkdir libdeepspeech/libs/$*/ | ||
cp ${TFDIR}/bazel-out/$*-*/bin/native_client/libdeepspeech.so libdeepspeech/libs/$*/ | ||
|
||
apk-prepare: | ||
cp build.gradle.android build.gradle | ||
cp libdeepspeech/build.gradle.android libdeepspeech/build.gradle | ||
cp libdeepspeech/CMakeLists_android.txt libdeepspeech/CMakeLists.txt | ||
|
||
apk: apk-prepare apk-clean bindings $(patsubst %,libdeepspeech/libs/%/libdeepspeech.so,$(ARCHS)) | ||
$(GRADLE) build | ||
|
||
jre: jre-prepare jre-collect jre-restore-makefile jre-clean | ||
jre-prepare: $(patsubst %,libdeepspeech/libs/%/libdeepspeech.so,$(ARCHS)) | ||
cp Makefile Makefile.original | ||
cp build.gradle.standalone build.gradle | ||
cp libdeepspeech/build.gradle.standalone libdeepspeech/build.gradle | ||
cp libdeepspeech/CMakeLists_standalone.txt libdeepspeech/CMakeLists.txt | ||
sed -i 's|__JAVA_HOME__|'${JAVA_HOME}'|g' libdeepspeech/CMakeLists.txt | ||
|
||
jre-libdeepspeech-jni: bindings | ||
cd libdeepspeech; \ | ||
cmake .; \ | ||
$(MAKE) | ||
|
||
jre-gradle: jre-libdeepspeech-jni | ||
$(GRADLE) build | ||
|
||
jre-collect: jre-gradle | ||
mkdir -p build | ||
mv libdeepspeech/libdeepspeech-jni.so build/ | ||
cp libdeepspeech/libs/x86_64/libdeepspeech.so build/ | ||
cp libdeepspeech/build/libs/libdeepspeech.jar build/ | ||
|
||
jre-clean: | ||
rm -f libdeepspeech/CMakeLists.txt | ||
rm -f libdeepspeech/build.gradle | ||
rm -f build.gradle | ||
rm -f jni/deepspeech_wrap.cpp jni/deepspeech_wrap.o | ||
rm -rf libdeepspeech/cmake_install.cmake libdeepspeech/CMakeCache.txt libdeepspeech/Makefile libdeepspeech/CMakeFiles/ | ||
rm -rf libdeepspeech/build/ | ||
|
||
jre-restore-makefile: | ||
mv Makefile.original Makefile | ||
|
||
maven-bundle: apk | ||
$(GRADLE) uploadArchives | ||
$(GRADLE) zipMavenArtifacts | ||
|
||
bindings: clean ds-swig | ||
$(DS_SWIG_ENV) swig -c++ -java -package org.deepspeech.libdeepspeech -outdir libdeepspeech/src/main/java/org/deepspeech/libdeepspeech/ -o jni/deepspeech_wrap.cpp jni/deepspeech.i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters