Skip to content

Commit

Permalink
[plugin/tts] Standalone build script
Browse files Browse the repository at this point in the history
  • Loading branch information
hgy29 committed May 30, 2017
1 parent f1a80a5 commit d7ac830
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions plugins/tts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#Standalone build definitions
GIDEROS_SDK="/c/Program Files (x86)/Gideros/Sdk"
NDKBUILD=cmd //c /c/Applications/android-ndk-r14b/ndk-build.cmd

#Compute plugin name and build paths
PLUGIN:=$(lastword $(subst /, ,$(dir $(PWD)/$(strip $(MAKEFILE_LIST)))))
PROOT:=$(patsubst %/,%,$(dir $(strip $(MAKEFILE_LIST))))
CURDIR:=$(PWD)
PBUILD=$(PROOT)/Build

#Standalone build
standalone:
rm -rf $(PBUILD)
mkdir -p $(PBUILD)
cp -r $(GIDEROS_SDK) $(PBUILD)
@cd source; BDIR=../..; if [ -d "Android" ]; then BDIR=../$$BDIR; cd Android; fi;\
GIDEROS_SDK=$$BDIR/$(PBUILD)/Sdk $(NDKBUILD);\
rm -f libs/armeabi/libgideros.so libs/armeabi/liblua.so libs/armeabi/libgvfs.so;\
rm -f libs/armeabi-v7a/libgideros.so libs/armeabi-v7a/liblua.so libs/armeabi-v7a/libgvfs.so;\
rm -f libs/x86/libgideros.so libs/x86/liblua.so libs/x86/libgvfs.so
@mkdir -p $(PBUILD)/$(PLUGIN)/bin/Android
@cd source; \
if [ -d "Android" ]; then cd Android; fi; \
cp -r libs $(CURDIR)/$(PBUILD)/$(PLUGIN)/bin/Android/; \
if [ -d "res" ]; then \
cp -r res $(CURDIR)/$(PBUILD)/$(PLUGIN)/bin/Android/; \
fi;\
if [ -d "assets" ]; then \
cp -r assets $(CURDIR)/$(PBUILD)/$(PLUGIN)/bin/Android/; \
fi;\
if [ -d "src" ]; then \
cp -r src $(CURDIR)/$(PBUILD)/$(PLUGIN)/bin/Android/; \
fi;
cp -r $(PROOT)/source $(PBUILD)/$(PLUGIN)
if [ -d "doc" ]; then \
cp -r $(PROOT)/doc $(PBUILD)/$(PLUGIN); \
fi;
rm -rf $(PBUILD)/$(PLUGIN)/source/Android
cp $(PROOT)/$(PLUGIN).gplugin $(PBUILD)/$(PLUGIN)

#Gideros source tree build
gideros:
rm -rf $(PBUILD)
mkdir -p $(PBUILD)
$(MAKE) -f scripts/Makefile.gid ../$(PROOT).androidplugin
$(MAKE) -f scripts/Makefile.gid ../$(PROOT).androidplugin.install
cp -r Build.Win/All\ Plugins/$(PLUGIN) $(PBUILD)
cp -r $(PROOT)/source $(PBUILD)/$(PLUGIN)
#cp -r $(PROOT)/doc $(PBUILD)/$(PLUGIN)
rm -rf $(PBUILD)/$(PLUGIN)/source/Android
cp $(PROOT)/$(PLUGIN).gplugin $(PBUILD)/$(PLUGIN)
rm -rf Build.Win/All\ Plugins/$(PLUGIN)
cp -r $(PBUILD)/$(PLUGIN) Build.Win/All\ Plugins

#Cleanup
clean:
rm -rf $(PBUILD)
rm -rf $(PROOT)/source/Android/obj
rm -rf $(PROOT)/source/Android/libs

2 changes: 1 addition & 1 deletion plugins/tts/source/Android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LOCAL_ARM_MODE := arm
LOCAL_CFLAGS := -O2
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(GIDEROS_SDK)/include $(LOCAL_PATH)/.. $(LOCAL_PATH)/../../Common
LOCAL_SRC_FILES := gtts-android.cpp ../../Common/gttsbinder.cpp
LOCAL_LDLIBS := -ldl -llog
LOCAL_LDLIBS := -ldl -llog -latomic
LOCAL_SHARED_LIBRARIES := gvfs lua gideros

include $(BUILD_SHARED_LIBRARY)

0 comments on commit d7ac830

Please sign in to comment.