Procházet zdrojové kódy

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

legacy
Sam Hocevar sam před 11 roky
rodič
revize
a5388b434b
2 změnil soubory, kde provedl 26 přidání a 19 odebrání
  1. +2
    -0
      .gitignore
  2. +24
    -19
      build/autotools/common.am

+ 2
- 0
.gitignore Zobrazit soubor

@@ -15,6 +15,8 @@
.libs
.deps
.dirstamp
.*.androiddir
.*.androidstamp
Makefile
Makefile.in
aclocal.m4


+ 24
- 19
build/autotools/common.am Zobrazit soubor

@@ -107,30 +107,35 @@ CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.exe) \

all-local: all-local-android
clean-local: clean-local-android

if USE_ANDROID
all-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), $($(p)_DATA))
$(foreach p, $(PROGRAMS:%$(EXEEXT)=%), \
rm -rf "android-$(p)"; \
$(MKDIR_P) "android-$(p)" $(sort $(foreach f, $($(p)_DATA), "android-$(p)/assets/$(dir $(f))")); \
$(foreach f, $($(p)_DATA), $(LN_S) "$(abs_srcdir)/$(f)" "android-$(p)/assets/$(f)";) \
$(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/AndroidManifest.xml" > "android-$(p)/AndroidManifest.xml"; \
$(MKDIR_P) "android-$(p)/src/net/lolengine"; \
$(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/LolActivity.java" > "android-$(p)/src/net/lolengine/LolActivity.java"; \
$(MKDIR_P) "android-$(p)/res/values"; \
$(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/strings.xml" > "android-$(p)/res/values/strings.xml"; \
$(MKDIR_P) "android-$(p)/res/drawable"; \
cp "$(top_srcdir)/build/android/icon.png" "android-$(p)/res/drawable/"; \
$(MKDIR_P) "android-$(p)/libs/armeabi"; \
$(LN_S) "$(abs_builddir)/$(p).so" "android-$(p)/libs/armeabi/lib$(p).so"; \
$(LN_S) "$${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so" "android-$(p)/libs/armeabi"; \
android update project -t android-8 -p "android-$(p)"; \
ant debug -f "android-$(p)/build.xml"; \
)
all-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), .$(p).androidstamp)
.%.androidstamp: %$(EXEEXT)
$(eval p := $(^:%$(EXEEXT)=%))
$(eval d := .$(p).androiddir)
rm -rf "$(d)"
$(MKDIR_P) "$(d)" $(sort $(foreach f, $($(p)_DATA), "$(d)/assets/$(dir $(f))"))
$(foreach f, $($(p)_DATA), $(LN_S) "$(abs_srcdir)/$(f)" "$(d)/assets/$(f)" &&) true
$(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/AndroidManifest.xml" > "$(d)/AndroidManifest.xml"
$(MKDIR_P) "$(d)/src/net/lolengine"
$(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/LolActivity.java" > "$(d)/src/net/lolengine/LolActivity.java"
$(MKDIR_P) "$(d)/res/values"
$(SED) -e 's,@PROGRAM@,$(p),' "$(top_srcdir)/build/android/strings.xml" > "$(d)/res/values/strings.xml"
$(MKDIR_P) "$(d)/res/drawable"
cp "$(top_srcdir)/build/android/icon.png" "$(d)/res/drawable/"
$(MKDIR_P) "$(d)/libs/armeabi"
$(LN_S) "$(abs_builddir)/$(p)$(EXEEXT)" "$(d)/libs/armeabi/lib$(p).so"
$(LN_S) "$${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so" "$(d)/libs/armeabi"
android update project -t android-8 -p "$(d)"
ant debug -f "$(d)/build.xml"
touch $@
else
all-local-android:
endif

clean-local-android:
$(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf "android-$(p)";)
$(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf ".$(p).androiddir";)
$(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -f ".$(p).androidstamp";)


#


Načítá se…
Zrušit
Uložit