Commit e8a66be2 authored by Geoffrey Métais's avatar Geoffrey Métais

maintain Makefile to build libvlc with compile.sh

parent 110a2ac9
...@@ -4,9 +4,11 @@ export ANDROID_HOME=$(ANDROID_SDK) ...@@ -4,9 +4,11 @@ export ANDROID_HOME=$(ANDROID_SDK)
ARCH = $(ANDROID_ABI) ARCH = $(ANDROID_ABI)
SRC=vlc-android SRC=libvlc
JAVA_SOURCES=$(shell find $(SRC)/src/org/videolan -name "*.java" -o -name "*.aidl") APP_SRC=vlc-android
JAVA_SOURCES+=$(shell find $(SRC)/res -name "*.xml" -o -name "*.png") 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 JNI_SOURCES=$(SRC)/jni/*.c $(SRC)/jni/*.h
LIBVLC_LIBS = libvlcjni LIBVLC_LIBS = libvlcjni
...@@ -38,11 +40,11 @@ endif ...@@ -38,11 +40,11 @@ endif
ifeq ($(RELEASE),1) ifeq ($(RELEASE),1)
ANT_TARGET = release ANT_TARGET = release
VLC_APK=$(SRC)/bin/VLC-release-unsigned.apk VLC_APK=$(APP_SRC)/bin/VLC-release-unsigned.apk
NDK_DEBUG=0 NDK_DEBUG=0
else else
ANT_TARGET = debug ANT_TARGET = debug
VLC_APK=$(SRC)/bin/VLC-debug.apk VLC_APK=$(APP_SRC)/bin/VLC-debug.apk
NDK_DEBUG=1 NDK_DEBUG=1
endif endif
...@@ -50,11 +52,11 @@ define build_apk ...@@ -50,11 +52,11 @@ define build_apk
@echo @echo
@echo "=== Building $(VLC_APK) for $(ARCH) ===" @echo "=== Building $(VLC_APK) for $(ARCH) ==="
@echo @echo
date +"%Y-%m-%d" > $(SRC)/assets/builddate.txt date +"%Y-%m-%d" > $(APP_SRC)/assets/builddate.txt
echo `id -u -n`@`hostname` > $(SRC)/assets/builder.txt echo `id -u -n`@`hostname` > $(APP_SRC)/assets/builder.txt
git rev-parse --short HEAD > $(SRC)/assets/revision.txt git rev-parse --short HEAD > $(APP_SRC)/assets/revision.txt
./gen-env.sh $(SRC) ./gen-env.sh $(APP_SRC)
$(VERBOSE)cd $(SRC) && ant $(ANT_OPTS) $(ANT_TARGET) $(VERBOSE)cd $(APP_SRC) && ant $(ANT_OPTS) $(ANT_TARGET)
endef endef
$(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES) $(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES)
...@@ -114,11 +116,12 @@ apkclean: ...@@ -114,11 +116,12 @@ apkclean:
rm -f $(VLC_APK) rm -f $(VLC_APK)
lightclean: 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 rm -f $(PRIVATE_LIBDIR)/*.so $(PRIVATE_LIBDIR)/*.c
clean: lightclean 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 jniclean: lightclean
rm -f $(LIBVLCJNI) $(LIBVLCJNI_H) rm -f $(LIBVLCJNI) $(LIBVLCJNI_H)
...@@ -156,9 +159,9 @@ vlc-sdk.7z: .sdk ...@@ -156,9 +159,9 @@ vlc-sdk.7z: .sdk
.sdk: .sdk:
mkdir -p vlc-sdk/libs 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 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 $@ touch $@
.PHONY: lightclean clean jniclean distclean distclean-run apkclean apkclean-run install run build-and-run .PHONY: lightclean clean jniclean distclean distclean-run apkclean apkclean-run install run build-and-run
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Read the Android Wiki http://wiki.videolan.org/AndroidCompile # Read the Android Wiki http://wiki.videolan.org/AndroidCompile
# Setup all that stuff correctly. # 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 set -e
...@@ -63,11 +63,11 @@ if [ `set -- ${ANDROID_ABI}; echo $#` -gt 1 ]; then ...@@ -63,11 +63,11 @@ if [ `set -- ${ANDROID_ABI}; echo $#` -gt 1 ]; then
NO_FPU=$NO_FPU NO_ARMV6=$NO_ARMV6 ANDROID_ABI=$i \ NO_FPU=$NO_FPU NO_ARMV6=$NO_ARMV6 ANDROID_ABI=$i \
./compile.sh $* --jni || { echo "$i build KO"; exit 1; } ./compile.sh $* --jni || { echo "$i build KO"; exit 1; }
mkdir -p obj/ mkdir -p obj/
cp -r vlc-android/libs/$i obj cp -r libvlc/libs/$i obj
echo "$i build OK" echo "$i build OK"
done done
for i in ${ANDROID_ABI_LIST}; do for i in ${ANDROID_ABI_LIST}; do
cp -r obj/$i vlc-android/libs/ cp -r obj/$i libvlc/libs/
rm -rf obj/$i rm -rf obj/$i
done done
if [ "$JNI" = 0 ];then if [ "$JNI" = 0 ];then
...@@ -348,7 +348,7 @@ cd ../.. && mkdir -p build-android-${TARGET_TUPLE} && cd build-android-${TARGET_ ...@@ -348,7 +348,7 @@ cd ../.. && mkdir -p build-android-${TARGET_TUPLE} && cd build-android-${TARGET_
if [ "$JNI" = 1 ]; then if [ "$JNI" = 1 ]; then
CLEAN="jniclean" CLEAN="jniclean"
TARGET="vlc-android/obj/local/${ANDROID_ABI}/libvlcjni.so" TARGET="libvlc/obj/local/${ANDROID_ABI}/libvlcjni.so"
else else
CLEAN="distclean" CLEAN="distclean"
TARGET= TARGET=
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project name="libVLC" default="help"> <project name="libvlc" default="help">
<!-- The local.properties file is created and updated by the 'android' tool. <!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into It contains the path to the SDK. It should *NOT* be checked into
......
...@@ -14,4 +14,4 @@ target=android-21 ...@@ -14,4 +14,4 @@ target=android-21
android.library.reference.1=../java-libs/appcompat android.library.reference.1=../java-libs/appcompat
android.library.reference.2=../java-libs/WheelView android.library.reference.2=../java-libs/WheelView
android.library.reference.3=../java-libs/cardview android.library.reference.3=../java-libs/cardview
android.library.reference.4=../libVLC android.library.reference.4=../libvlc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment