Commit d993d418 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

Makefile: be verbose, simplify, add PHONY

parent 4351a4d2
......@@ -8,7 +8,8 @@ LIBVLCJNI_H=vlc-android/jni/libvlcjni.h
# Verbose level: -q -v or nothing (default)
VERBOSE ?= -v
all: vlc.apk
$(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES) vlc-android/local.properties
cd vlc-android && ant $(VERBOSE) debug
VLC_MODULES=`find $(VLC_BUILD_DIR)/modules -name 'lib*_plugin.a'|grep -v stats|tr \\\\n \ `
......@@ -30,15 +31,16 @@ $(LIBVLCJNI): $(JNI_SOURCES) $(LIBVLCJNI_H)
@if [ -z "$(VLC_BUILD_DIR)" ]; then echo "VLC_BUILD_DIR not defined" ; exit 1; fi
@if [ -z "$(ANDROID_NDK)" ]; then echo "ANDROID_NDK not defined" ; exit 1; fi
@echo "=== Building libvlcjni with$${NO_NEON:+out} neon ==="
@if [ -z "$(VLC_SRC_DIR)" ] ; then VLC_SRC_DIR=./vlc; fi ; \
@echo
if [ -z "$(VLC_SRC_DIR)" ] ; then VLC_SRC_DIR=./vlc; fi ; \
if [ -z "$(VLC_CONTRIB)" ] ; then VLC_CONTRIB="$$VLC_SRC_DIR/contrib/arm-linux-androideabi"; fi ; \
vlc_modules="$(VLC_MODULES)" ; \
if [ `echo "$(VLC_BUILD_DIR)" | head -c 1` != "/" ] ; then \
vlc_modules="`echo $$vlc_modules|sed \"s|$(VLC_BUILD_DIR)|../$(VLC_BUILD_DIR)|g\"`" ; \
VLC_BUILD_DIR="../$(VLC_BUILD_DIR)"; \
fi ; \
if [ `echo "$$VLC_CONTRIB" | head -c 1` != "/" ] ; then VLC_CONTRIB="../$$VLC_CONTRIB"; fi ; \
if [ `echo "$$VLC_SRC_DIR" | head -c 1` != "/" ] ; then VLC_SRC_DIR="../$$VLC_SRC_DIR"; fi ; \
[ `echo "$$VLC_CONTRIB" | head -c 1` != "/" ] && VLC_CONTRIB="../$$VLC_CONTRIB"; \
[ `echo "$$VLC_SRC_DIR" | head -c 1` != "/" ] && VLC_SRC_DIR="../$$VLC_SRC_DIR"; \
$(ANDROID_NDK)/ndk-build -C vlc-android \
VLC_SRC_DIR="$$VLC_SRC_DIR" \
VLC_CONTRIB="$$VLC_CONTRIB" \
......@@ -46,35 +48,25 @@ $(LIBVLCJNI): $(JNI_SOURCES) $(LIBVLCJNI_H)
VLC_MODULES="$$vlc_modules"
vlc-android/local.properties:
@echo "=== Preparing Ant ==="
@if [ -z "$$ANDROID_SDK" ]; then echo "ANDROID_SDK not defined" ; exit 1; fi
@printf "# Auto-generated file. Do not edit.\nsdk.dir=$$ANDROID_SDK" > $@
$(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES) vlc-android/local.properties
@echo "=== Building APK =="
@cd vlc-android && ant $(VERBOSE) debug
libvlcjni: $(LIBVLCJNI)
vlc.apk: libvlcjni $(VLC_APK)
printf "# Auto-generated file. Do not edit.\nsdk.dir=$$ANDROID_SDK" > $@
clean:
rm -rf vlc-android/libs
rm -rf vlc-android/obj
rm -rf vlc-android/bin
cd vlc-android && rm -rf libs obj bin $(VLC_APK)
distclean: clean
rm -f $(LIBVLCJNI_H)
rm -f vlc-android/local.properties
rm -f $(LIBVLCJNI) $(LIBVLCJNI_H) vlc-android/local.properties
install: vlc.apk
@echo "=== Installing APK on a remote device ==="
@echo "Waiting for a device to be ready..." && adb wait-for-device
@echo "Installing package" && adb install -r $(VLC_APK)
install: $(VLC_APK)
@echo "=== Installing VLC on device ==="
adb wait-for-device
adb install -r $(VLC_APK)
run:
@echo "=== Running application on device ==="
@adb wait-for-device && adb shell monkey -p org.videolan.vlc.android -s 0 1
@echo "=== Running VLC on device ==="
adb wait-for-device
adb shell monkey -p org.videolan.vlc.android -s 0 1
build-and-run: install run
build-and-run: vlc.apk install run
@echo "=== Application is running ==="
.PHONY: clean distclean install run build-and-run
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