summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/Makefile
diff options
context:
space:
mode:
authorfrogbotherer <therealchriswest@hotmail.com>2012-09-08 13:40:44 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-09-08 13:40:44 +0200
commitf4002528321dbb23f92bade00d46ce515dd1bd27 (patch)
treec4c8a91fdbe7f14f4a6d66f59f0b1e8429a553f8 /crawl-ref/source/Makefile
parent58ccbffacfa6feedebee83d6fc22b9037f29bf92 (diff)
downloadcrawl-ref-f4002528321dbb23f92bade00d46ce515dd1bd27.tar.gz
crawl-ref-f4002528321dbb23f92bade00d46ce515dd1bd27.zip
Android port.
2 files are added to the root of the repository: * AndroidAppSettings.cfg: settings file required for Android SDL port. Will change on each minor release to reset configuration. * AndroidBuild.sh: script called by the Android SDL port to commence building the game itself It might be nice to be able to move them elsewhere, but for now, their presence here is required. The build process is documented in docs/develop/android.txt There's a TOUCH_UI compiler flag which sets all the things specific to a touch screen interface. There has been a large amount of changes in the Makefile for redefining where the dat/, saves/, etc. directories go, because the "install" part of the make isn't the final destination for these files under Android - the environment we deploy to is a separate device from the build environment. There is also a number of changes to the tiles interface. Some are specific to the TOUCH_UI, but others are also changed in USE_TILE_LOCAL. Touch only: * 'a'bilities menu goes straight to menu without prompting first * tap menu header to toggle/submit * menu instead of prompt to select which corpse to butcher * same for eating food from the floor (those 2 could go in local tiles too) * show_more defaults to false and less --more-- messages * pickup mode defaults to menu * defaults for tile_layout_priority is different (commands are more important than inventory) * popup for yes/no prompts, level-up stat gain and swapping rings (should be used for all prompts, and probably local tiles too) * spell casting: force selection menu * map mode: left-click rather than right-click for mouse mode; autotravel on left-click removed * remove skills training and memorisation panels Also local tiles (some could also be integrated in webtiles): * commands below description are clickable * clickable shopping menu (uses PrecisionMenu) * split the command panel in 2 (common actions and system commands) * add a map command panel * tapping or left-clicking the player is smarter: * picks up the item if there's one on the tile, otherwise * shows pick-up menu if there's several items on the tile, otherwise * traverses stairs (or enters a portal or shop) if one is present, otherwise * prays if an altar is present, otherwise * waits one turn * right-clicking the map enters map mode and brings the map commands tab to the front; map mode stays until exited rather than upon release of mouse Some more details can be found in android_patch_notes.txt on #5677 (although some TODOs are already obsolete). Signed-off-by: Raphael Langella <raphael.langella@gmail.com>
Diffstat (limited to 'crawl-ref/source/Makefile')
-rw-r--r--crawl-ref/source/Makefile60
1 files changed, 54 insertions, 6 deletions
diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile
index 7d9c283895..1a101d0349 100644
--- a/crawl-ref/source/Makefile
+++ b/crawl-ref/source/Makefile
@@ -58,6 +58,9 @@
# WEBDIR -- place to hold the Webtiles client data. Can be either
# relative to prefix or absolute.
#
+# ANDROID -- perform an Android build (see docs/develop/android.txt)
+# TOUCH_UI -- enable UI behaviour more compatible with touch-screens
+#
#
# Requirements:
# For tile builds, you need pkg-config.
@@ -74,9 +77,9 @@ GAME = crawl
MAKEFLAGS += -rR # This only works for recursive makes, i.e. contribs ...
.SUFFIXES: # ... so zap the suffix list to neutralize most predifined rules, too
-.PHONY: all test install clean clean-contrib clean-rltiles distclean debug debug-lite \
- profile package-source source build-windows package-windows rest docs greet \
- api
+.PHONY: all test install clean clean-contrib clean-rltiles clean-android \
+ distclean debug debug-lite profile package-source source \
+ build-windows package-windows rest docs greet api
include Makefile.obj
@@ -126,7 +129,11 @@ CFWARN_L := -Wundef
DEFINES := $(EXTERNAL_DEFINES)
+ifdef ANDROID
+LDFLAGS := $(EXTERNAL_LDFLAGS) $(LDFLAGS)
+else
LDFLAGS := $(EXTERNAL_LDFLAGS)
+endif
#
# The GCC and GXX variables are set later.
@@ -325,8 +332,10 @@ endif
ifdef WIN32
EXTRA_OBJECTS += icon.o
else
+ifndef ANDROID
EXTRA_LIBS += -pthread
endif
+endif
ifndef TILES
ifdef NEED_LIBW32C
@@ -530,6 +539,14 @@ CFOPTIMIZE += -march=native
endif
endif
+ifdef ANDROID
+ BUILD_LUA=
+ BUILD_SQLITE=
+ BUILD_ZLIB=
+ BUILD_SDL=
+ BUILD_FREETYPE=
+ NO_PKGCONFIG=Y
+else
ifndef BUILD_LUA
ifneq ($(shell $(PKGCONFIG) lua5.1 --exists || echo no),)
ifneq ($(shell $(PKGCONFIG) lua --exists || echo no),)
@@ -571,6 +588,7 @@ ifndef BUILD_ZLIB
else
LIBS += $(LIBZ)
endif
+endif #ANDROID
RLTILES = rltiles
INCLUDES_L += -I$(RLTILES)
@@ -588,6 +606,10 @@ ifdef TILES
DEFINES_L += -DUSE_TILE
DEFINES_L += -DUSE_TILE_LOCAL
+ifdef TOUCH_UI
+DEFINES_L += -DTOUCH_UI
+endif
+
ifdef BUILD_SDL
INCLUDES_L += -Icontrib/install/$(ARCH)/include/SDL
endif
@@ -634,7 +656,9 @@ LIBS += -lSDL_image $(SDL_LDFLAGS) $(FREETYPE_LDFLAGS)
endif # pkg-config
ifdef GLES
+ifndef ANDROID
LIBS += -lSDL_gles -lEGL -lGLES_CM
+endif
else
ifneq ($(uname_S),Darwin)
ifeq (,$(findstring MINGW,$(uname_S)))
@@ -786,11 +810,11 @@ ifneq ($(strip $(DATADIR)),)
endif
endif
CFOTHERS_L += -DDATA_DIR_PATH=\"$(abspath $(DATADIR))/\"
- FONTDIR = $(abspath $(DATADIR))dat/tiles/
+ FONTDIR = $(abspath $(DATADIR))/dat/tiles/
else
ifneq ($(prefix),)
DATADIR := $(strip $(prefix))/$(strip $(DATADIR))
- FONTDIR = $(strip $(prefix))/$(strip $(DATADIR))dat/tiles/
+ FONTDIR = $(strip $(prefix))/$(strip $(DATADIR))/dat/tiles/
else
ifneq ($(DESTDIR),)
FONTDIR = dat/tiles/
@@ -922,7 +946,11 @@ ifdef REPORT
CFOTHERS += -ftime-report
endif
+ifdef ANDROID
+CFLAGS := $(CFOPTIMIZE) $(CFOTHERS) $(CFWARN) $(CFLAGS)
+else
CFLAGS := $(CFOPTIMIZE) $(CFOTHERS) $(CFWARN)
+endif
CFLAGS_L := $(CFOPTIMIZE_L) $(DEFINES_L) $(CFWARN_L) $(INCLUDES_L) $(CFOTHERS_L)
ALL_CFLAGS := $(CFLAGS) $(CFLAGS_L)
YACC_CFLAGS := $(ALL_CFLAGS) -Wno-unused-function -Wno-sign-compare -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0
@@ -1219,6 +1247,14 @@ endif
##########################################################################
# The actual build targets
#
+ifdef ANDROID
+ # during build, data goes in a different directory to when crawl runs!
+ prefix_fp = ../..
+ datadir_fp = ../../AndroidData
+ savedir_fp = ../../AndroidData
+ shareddir_fp =
+endif
+
install: all
ifeq ($(DESTDIR)$(prefix),)
@echo Neither "DESTDIR" nor "prefix" defined -- nowhere to install to, aborting.
@@ -1302,7 +1338,7 @@ ifeq ($(USE_DGAMELAUNCH),)
endif
endif
-clean: clean-rltiles clean-webserver tx-clean
+clean: clean-rltiles clean-webserver clean-android tx-clean
+$(MAKE) -C $(UTIL) clean
$(RM) $(GAME) $(GAME).exe $(GENERATED_FILES) $(EXTRA_OBJECTS) libw32c.o\
libunix.o $(ALL_OBJECTS) $(ALL_OBJECTS:.o=.d) *.ixx \
@@ -1313,6 +1349,11 @@ clean: clean-rltiles clean-webserver tx-clean
clean-contrib:
+$(MAKE) -C contrib clean
+clean-android:
+ $(RM) ../../icon.png ../../libapplication.so
+ $(RM) -r ../../AndroidData
+ $(RM) -r ../../bin
+
distclean: clean clean-contrib clean-rltiles
$(RM) -r morgue saves
$(RM) scores $(GAME) core $(DEPENDENCY_MKF)
@@ -1568,7 +1609,14 @@ tx-sync:
.PHONY: build-rltiles
build-rltiles: .contrib-libs $(RLTILES)/dc-unrand.txt
+ifdef ANDROID
+ # force submake to run properly
+ env -i - bash -l -c "$(MAKE) -C $(RLTILES) all TILES=1 V=1"
+ # prove that tiles were generated properly
+ grep tile_info rltiles/*.cc| head
+else
+$(MAKE) -C $(RLTILES) all ARCH=$(ARCH) TILES=$(TILES)$(WEBTILES)
+endif
$(TILEDEFSRCS) $(TILEDEFHDRS) $(ORIGTILEFILES): build-rltiles