[Android] [PATCH 2/2] maintain Makefile to build libVLV with compile.Sh

Geoffrey Métais geoffrey.metais at gmail.com
Thu Nov 13 19:11:59 CET 2014


---
 Makefile   | 31 +++++++++++++++++--------------
 compile.sh |  8 ++++----
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index 4fa0141..465a032 100644
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,11 @@ export ANDROID_HOME=$(ANDROID_SDK)
 
 ARCH = $(ANDROID_ABI)
 
-SRC=vlc-android
-JAVA_SOURCES=$(shell find $(SRC)/src/org/videolan -name "*.java" -o -name "*.aidl")
-JAVA_SOURCES+=$(shell find $(SRC)/res -name "*.xml" -o -name "*.png") 
+SRC=libVLC
+APP_SRC=vlc-android
+JAVA_SOURCES=$(shell find $(APP_SRC)/src/org/videolan -name "*.java" -o -name "*.aidl")
+JAVA_SOURCES+=$(shell find $(SRC)/src/org/videolan -name "*.java" -o -name "*.aidl")
+JAVA_SOURCES+=$(shell find $(APP_SRC)/res -name "*.xml" -o -name "*.png") 
 JNI_SOURCES=$(SRC)/jni/*.c $(SRC)/jni/*.h
 LIBVLC_LIBS = libvlcjni
 
@@ -38,11 +40,11 @@ endif
 
 ifeq ($(RELEASE),1)
 ANT_TARGET = release
-VLC_APK=$(SRC)/bin/VLC-release-unsigned.apk
+VLC_APK=$(APP_SRC)/bin/VLC-release-unsigned.apk
 NDK_DEBUG=0
 else
 ANT_TARGET = debug
-VLC_APK=$(SRC)/bin/VLC-debug.apk
+VLC_APK=$(APP_SRC)/bin/VLC-debug.apk
 NDK_DEBUG=1
 endif
 
@@ -50,11 +52,11 @@ define build_apk
 	@echo
 	@echo "=== Building $(VLC_APK) for $(ARCH) ==="
 	@echo
-	date +"%Y-%m-%d" > $(SRC)/assets/builddate.txt
-	echo `id -u -n`@`hostname` > $(SRC)/assets/builder.txt
-	git rev-parse --short HEAD > $(SRC)/assets/revision.txt
-	./gen-env.sh $(SRC)
-	$(VERBOSE)cd $(SRC) && ant $(ANT_OPTS) $(ANT_TARGET)
+	date +"%Y-%m-%d" > $(APP_SRC)/assets/builddate.txt
+	echo `id -u -n`@`hostname` > $(APP_SRC)/assets/builder.txt
+	git rev-parse --short HEAD > $(APP_SRC)/assets/revision.txt
+	./gen-env.sh $(APP_SRC)
+	$(VERBOSE)cd $(APP_SRC) && ant $(ANT_OPTS) $(ANT_TARGET)
 endef
 
 $(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES)
@@ -114,11 +116,12 @@ apkclean:
 	rm -f $(VLC_APK)
 
 lightclean:
-	cd $(SRC) && rm -rf libs obj bin $(VLC_APK)
+	cd $(SRC) && rm -rf libs obj
+	cd $(APP_SRC) && rm -rf bin $(VLC_APK)
 	rm -f $(PRIVATE_LIBDIR)/*.so $(PRIVATE_LIBDIR)/*.c
 
 clean: lightclean
-	rm -rf $(SRC)/gen java-libs/*/gen java-libs/*/bin .sdk vlc-sdk/ vlc-sdk.7z
+	rm -rf $(APP_SRC)/gen java-libs/*/gen java-libs/*/bin .sdk vlc-sdk/ vlc-sdk.7z
 
 jniclean: lightclean
 	rm -f $(LIBVLCJNI) $(LIBVLCJNI_H)
@@ -156,9 +159,9 @@ vlc-sdk.7z: .sdk
 
 .sdk:
 	mkdir -p vlc-sdk/libs
-	cd vlc-android; cp -r libs/* ../vlc-sdk/libs
+	cd libVLC; cp -r libs/* ../vlc-sdk/libs
 	mkdir -p vlc-sdk/src/org/videolan
-	cp -r vlc-android/src/org/videolan/libvlc vlc-sdk/src/org/videolan
+	cp -r libVLC/src/org/videolan/libvlc vlc-sdk/src/org/videolan
 	touch $@
 
 .PHONY: lightclean clean jniclean distclean distclean-run apkclean apkclean-run install run build-and-run
diff --git a/compile.sh b/compile.sh
index ab5527b..13c8be4 100755
--- a/compile.sh
+++ b/compile.sh
@@ -2,7 +2,7 @@
 
 # Read the Android Wiki http://wiki.videolan.org/AndroidCompile
 # Setup all that stuff correctly.
-# Get the latest Android SDK Platform or modify numbers in configure.sh and vlc-android/default.properties.
+# Get the latest Android SDK Platform or modify numbers in configure.sh and libVLC/default.properties.
 
 set -e
 
@@ -63,11 +63,11 @@ if [ `set -- ${ANDROID_ABI}; echo $#` -gt 1 ]; then
             NO_FPU=$NO_FPU NO_ARMV6=$NO_ARMV6 ANDROID_ABI=$i \
             ./compile.sh $* --jni || { echo "$i build KO"; exit 1; }
         mkdir -p obj/
-        cp -r vlc-android/libs/$i obj
+        cp -r libVLC/libs/$i obj
         echo "$i build OK"
     done
     for i in ${ANDROID_ABI_LIST}; do
-        cp -r obj/$i vlc-android/libs/
+        cp -r obj/$i libVLC/libs/
         rm -rf obj/$i
     done
     if [ "$JNI" = 0 ];then
@@ -348,7 +348,7 @@ cd ../.. && mkdir -p build-android-${TARGET_TUPLE} && cd build-android-${TARGET_
 
 if [ "$JNI" = 1 ]; then
     CLEAN="jniclean"
-    TARGET="vlc-android/obj/local/${ANDROID_ABI}/libvlcjni.so"
+    TARGET="libVLC/obj/local/${ANDROID_ABI}/libvlcjni.so"
 else
     CLEAN="distclean"
     TARGET=
-- 
1.9.1



More information about the Android mailing list