Changeset 2577


Ignore:
Timestamp:
Mar 10, 2013, 1:05:17 PM (7 years ago)
Author:
sam
Message:

build: fail the Android build upon error and make it idempotent.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r2298 r2577  
    1616.deps
    1717.dirstamp
     18.*.androiddir
     19.*.androidstamp
    1820Makefile
    1921Makefile.in
  • trunk/build/autotools/common.am

    r2576 r2577  
    108108all-local: all-local-android
    109109clean-local: clean-local-android
     110
    110111if USE_ANDROID
    111 all-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), $($(p)_DATA))
    112         $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), \
    113             rm -rf "android-$(p)"; \
    114             $(MKDIR_P) "android-$(p)" $(sort $(foreach f, $($(p)_DATA), "android-$(p)/assets/$(dir $(f))")); \
    115             $(foreach f, $($(p)_DATA), $(LN_S) "$(abs_srcdir)/$(f)" "android-$(p)/assets/$(f)";) \
    116             $(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/AndroidManifest.xml" > "android-$(p)/AndroidManifest.xml"; \
    117             $(MKDIR_P) "android-$(p)/src/net/lolengine"; \
    118             $(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/LolActivity.java" > "android-$(p)/src/net/lolengine/LolActivity.java"; \
    119             $(MKDIR_P) "android-$(p)/res/values"; \
    120             $(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/strings.xml" > "android-$(p)/res/values/strings.xml"; \
    121             $(MKDIR_P) "android-$(p)/res/drawable"; \
    122             cp "$(top_srcdir)/build/android/icon.png" "android-$(p)/res/drawable/"; \
    123             $(MKDIR_P) "android-$(p)/libs/armeabi"; \
    124             $(LN_S) "$(abs_builddir)/$(p).so" "android-$(p)/libs/armeabi/lib$(p).so"; \
    125             $(LN_S) "$${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so" "android-$(p)/libs/armeabi"; \
    126             android update project -t android-8 -p "android-$(p)"; \
    127             ant debug -f "android-$(p)/build.xml"; \
    128         )
     112all-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), .$(p).androidstamp)
     113.%.androidstamp: %$(EXEEXT)
     114        $(eval p := $(^:%$(EXEEXT)=%))
     115        $(eval d := .$(p).androiddir)
     116        rm -rf "$(d)"
     117        $(MKDIR_P) "$(d)" $(sort $(foreach f, $($(p)_DATA), "$(d)/assets/$(dir $(f))"))
     118        $(foreach f, $($(p)_DATA), $(LN_S) "$(abs_srcdir)/$(f)" "$(d)/assets/$(f)" &&) true
     119        $(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/AndroidManifest.xml" > "$(d)/AndroidManifest.xml"
     120        $(MKDIR_P) "$(d)/src/net/lolengine"
     121        $(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/LolActivity.java" > "$(d)/src/net/lolengine/LolActivity.java"
     122        $(MKDIR_P) "$(d)/res/values"
     123        $(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/strings.xml" > "$(d)/res/values/strings.xml"
     124        $(MKDIR_P) "$(d)/res/drawable"
     125        cp "$(top_srcdir)/build/android/icon.png" "$(d)/res/drawable/"
     126        $(MKDIR_P) "$(d)/libs/armeabi"
     127        $(LN_S) "$(abs_builddir)/$(p)$(EXEEXT)" "$(d)/libs/armeabi/lib$(p).so"
     128        $(LN_S) "$${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so" "$(d)/libs/armeabi"
     129        android update project -t android-8 -p "$(d)"
     130        ant debug -f "$(d)/build.xml"
     131        touch $@
    129132else
    130133all-local-android:
    131134endif
     135
    132136clean-local-android:
    133         $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf "android-$(p)";)
     137        $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf ".$(p).androiddir";)
     138        $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -f ".$(p).androidstamp";)
    134139
    135140
Note: See TracChangeset for help on using the changeset viewer.