Ignore:
Timestamp:
Jul 26, 2013 9:16:37 AM (11 years ago)
Author:
nanang
Message:

JNI projects:

  • separate makefile for Android and desktop/development
  • simplify build process for Android (upload pregenerated SWIG interface)
  • removed main loop for Android sample app
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/jni/pjsip-apps/src/jni/jni/Android.mk

    r4574 r4575  
    1818endif 
    1919 
    20 # OS specific 
    21 ifeq ($(OS),Windows_NT) 
    22 MY_JNI_LDFLAGS   = -L$(MY_JDK)/lib -Wl,--kill-at 
    23 MY_JNI_LIB       = $(MY_PACKAGE_BIN)/pjsua.dll 
    24 else 
    2520MY_JNI_LDFLAGS   = -L$(MY_JDK)/lib -Wl,-soname,pjsua.so 
    2621MY_JNI_LIB       = $(MY_PACKAGE_BIN)/libpjsua.so 
    2722MY_JNI_CFLAGS    := -fPIC 
    28 endif 
    2923 
    3024# Env settings, e.g: path to SWIG, JDK, java(.exe), javac(.exe) 
     
    4438MY_OUT_DIR       = jni/output 
    4539MY_SWIG_IF       = $(MY_OUT_DIR)/pjsua.i 
    46 MY_SWIG_FLAG     = -c++ -I$(MY_OUT_DIR) # -debug-tmsearch -debug-tmused # -Wall 
     40MY_SWIG_FLAG     = -c++ -I$(MY_OUT_DIR) 
    4741MY_SWIG_WRAPPER  = $(MY_OUT_DIR)/pjsua_wrap 
    4842MY_PACKAGE_SRC   = src/$(subst .,/,$(MY_PACKAGE)) 
     
    6559 
    6660clean: 
    67         rm -rf $(MY_OUT_DIR) 
     61        rm -rf $(MY_SWIG_WRAPPER).* 
    6862        rm -rf $(MY_PACKAGE_SRC) 
    69  
    70 $(MY_SWIG_IF).tmp: jni/swig_gen.py 
    71         @mkdir -p $(MY_OUT_DIR) 
    72         python jni/swig_gen.py > $(MY_SWIG_IF).tmp 
    73  
    74 $(MY_SWIG_IF): jni/header.i $(MY_SWIG_IF).tmp 
    75         cat jni/header.i > $(MY_SWIG_IF) 
    76         cat $(MY_SWIG_IF).tmp >> $(MY_SWIG_IF) 
    7763 
    7864$(MY_SWIG_WRAPPER).cpp: $(MY_SWIG_IF) jni/callbacks.i jni/my_typemaps.i 
     
    8167        @mkdir -p $(MY_PACKAGE_SRC) 
    8268        $(MY_SWIG) $(MY_SWIG_FLAG) -o $(MY_SWIG_WRAPPER).cpp -package $(MY_PACKAGE) \ 
    83                 -outdir $(MY_PACKAGE_SRC) -java $(MY_SWIG_IF) > $(MY_SWIG_WRAPPER)-tm.log 
     69                -outdir $(MY_PACKAGE_SRC) -java $(MY_SWIG_IF) 
    8470 
    8571$(MY_JNI_LIB): $(MY_SWIG_WRAPPER).cpp 
     
    8874                $(MY_CFLAGS) $(MY_LDFLAGS) 
    8975 
    90 java: $(TEST_SRC)/hello.java 
    91         @mkdir -p $(MY_PACKAGE_BIN) 
    92         $(MY_JAVAC) -d $(MY_PACKAGE_BIN) $(MY_PACKAGE_SRC)/*.java 
    93         $(MY_JAVAC) -d $(MY_PACKAGE_BIN) -classpath "$(MY_PACKAGE_BIN)" $(TEST_SRC)/hello.java 
    94  
    95 test: $(MY_PACKAGE_BIN)/hello.class 
    96         @# Need to specify classpath and library path, alternatively, they can be set via 
    97         @# CLASSPATH and java.library.path env settings 
    98         $(MY_JAVA) -cp $(MY_PACKAGE_BIN) -Djava.library.path="$(MY_PACKAGE_BIN)" hello 
    99  
    10076$(LOCAL_PATH)/$(MY_SWIG_WRAPPER).cpp: $(MY_SWIG_WRAPPER).cpp 
    10177 
Note: See TracChangeset for help on using the changeset viewer.