# # Define these variables from the beginning # CLEANFILES = SUFFIXES = EXTRA_DIST = NULL = # # Miscellaneous rules # lol_recursive_rule = \ @if test -n "$(SUBDIRS)"; then for subdir in $(SUBDIRS); do \ if test "$$subdir" != "."; then \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $(patsubst %-recursive, %, $@)) || exit 1; \ fi; done; fi bench: bench-recursive bench-recursive: $(lol_recursive_rule) lolcheck: lolcheck-recursive lolcheck-recursive: $(lol_recursive_rule) # # Make tests verbose # FIXME: this does not seem to work as documented # AM_TESTS_FD_REDIRECT = 9>&2 # # .lolfx build rule # lolfx_gen = $(lolfx_gen_$(V)) lolfx_gen_ = $(lolfx_gen_$(AM_DEFAULT_VERBOSITY)) lolfx_gen_0 = @echo " LOLFX " $@; SUFFIXES += .lolfx .lolfx.o: $(lolfx_gen) $(AM_V_at)(echo "char const *"; \ echo "lolfx_resource_$(basename $(filter %.lolfx, $^))" | $(SED) 's/[^a-zA-Z0-9_]/_/g'; \ echo "="; \ $(SED) 's/"/\\"/g' $(filter %.lolfx, $^) | $(SED) 's/\([^\r]*\).*/"\1\\n"/'; \ echo ";") \ > $@.lolfx.cpp && \ $(CXXCOMPILE) -xc++ -c $@.lolfx.cpp -o $@ && \ exit=0 || exit=1; rm -f $@.lolfx.cpp ; exit "$$exit" # Disable on the fly compilation because emscripten doesn't support it # | $(CXXCOMPILE) -xc++ -c - -o $@ # # Win32 rules # # This is here in case we forget to make clean after a Windows build CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.exe) \ $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) # # Emscripten rules # CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.data) \ $(noinst_PROGRAMS:%$(EXEEXT)=%.data) # # Android rules # all-local: all-local-android clean-local: clean-local-android if LOL_USE_ANDROID 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@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/AndroidManifest.xml" > "$(d)/AndroidManifest.xml" $(MKDIR_P) "$(d)/src/net/lolengine" $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/LolActivity.java" > "$(d)/src/net/lolengine/LolActivity.java" $(MKDIR_P) "$(d)/res/values" $(SED) -e 's,@PROGRAM@,$(subst -,_,$(p)),' "$(lol_srcdir)/build/android/strings.xml" > "$(d)/res/values/strings.xml" $(MKDIR_P) "$(d)/res/drawable" cp "$(lol_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-19 -n "$(p)" -p "$(d)" ant debug -f "$(d)/build.xml" touch $@ else all-local-android: endif clean-local-android: $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -rf ".$(p).androiddir";) $(foreach p, $(PROGRAMS:%$(EXEEXT)=%), rm -f ".$(p).androidstamp";) # # Additional rules # EXTRA_DIST += $(foreach p, $(PROGRAMS), $($(p)_DATA)) .PHONY: bench lolcheck