| 1 |
AM_CXXFLAGS = -std=c++11 -Wno-write-strings -Wall |
| 2 |
# Cf. (autoconf.info)Installation Directory Variables: |
| 3 |
# Don't use DATADIR, it conflicts with something in MinGW |
| 4 |
AM_CPPFLAGS = -DBUILD_DATA_DIR=\"$(datadir)\" |
| 5 |
|
| 6 |
# Gnulib: |
| 7 |
# includes generated files from top_builddir (not only top_srcdir) |
| 8 |
AM_CPPFLAGS += -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib |
| 9 |
LDADD = $(top_builddir)/gnulib/lib/libgnu.a |
| 10 |
|
| 11 |
# gettext: |
| 12 |
# Relative locale dir for woe/android |
| 13 |
if WOE |
| 14 |
AM_CPPFLAGS += -DLOCALEDIR=\"freedink/locale\" |
| 15 |
else |
| 16 |
if ANDROID |
| 17 |
AM_CPPFLAGS += -DLOCALEDIR=\"freedink/locale\" |
| 18 |
else |
| 19 |
AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" |
| 20 |
endif |
| 21 |
endif |
| 22 |
LDADD += @LIBINTL@ |
| 23 |
AM_CPPFLAGS += -I$(top_srcdir)/intl -I$(top_builddir)/intl |
| 24 |
|
| 25 |
LIBS += -lm |
| 26 |
|
| 27 |
COMMON_OBJS = app.cpp app.h bgm.cpp bgm.h BgTilesetsManager.cpp \ |
| 28 |
BgTilesetsManager.h dinkini.cpp dinkini.h DMod.cpp DMod.h \ |
| 29 |
fastfile.cpp fastfile.h str_util.cpp str_util.h io_util.cpp \ |
| 30 |
io_util.h EditorMap.cpp EditorMap.h editor_screen.cpp \ |
| 31 |
editor_screen.h gfx.cpp gfx.h gfx_tiles.cpp gfx_tiles.h \ |
| 32 |
gfx_palette.cpp gfx_palette.h gfx_fonts.cpp gfx_fonts.h \ |
| 33 |
hardness_tiles.cpp hardness_tiles.h ImageLoader.cpp \ |
| 34 |
ImageLoader.h IOGfxDisplay.cpp IOGfxDisplay.h \ |
| 35 |
IOGfxDisplayGL2.cpp IOGfxDisplayGL2.h IOGfxGLFuncs.cpp \ |
| 36 |
IOGfxGLFuncs.h IOGfxDisplaySW.cpp IOGfxDisplaySW.h \ |
| 37 |
IOGfxSurface.cpp IOGfxSurface.h IOGfxSurfaceGL2.cpp \ |
| 38 |
IOGfxSurfaceGL2.h IOGfxSurfaceSW.cpp IOGfxSurfaceSW.h \ |
| 39 |
IOGfxPrimitivesSW.cpp IOGfxPrimitives.h live_screen.cpp \ |
| 40 |
live_screen.h live_sprite.cpp live_sprite.h \ |
| 41 |
live_sprites_manager.cpp live_sprites_manager.h rect.cpp \ |
| 42 |
rect.h resources.cpp resources.h input.cpp input.h \ |
| 43 |
freedink_xpm.cpp freedink_xpm.h paths.cpp paths.h log.cpp \ |
| 44 |
log.h gfx_sprites.cpp gfx_sprites.h vgasys_fon.cpp \ |
| 45 |
vgasys_fon.h SDL_android_main.c sfx.cpp sfx.h |
| 46 |
if ANDROID |
| 47 |
# Build .so JNI libs rather than executables |
| 48 |
# Define here rather than configure.ac, otherwise config.h gets confused |
| 49 |
AM_CFLAGS = -fPIC |
| 50 |
freedink_LDFLAGS = -shared |
| 51 |
LIBS += -llog |
| 52 |
endif |
| 53 |
|
| 54 |
bin_PROGRAMS = freedink freedinkedit |
| 55 |
freedink_SOURCES = $(COMMON_OBJS) AppFreeDink.cpp AppFreeDink.h \ |
| 56 |
IOTouchDragAnywhere.cpp IOTouchDragAnywhere.h freedink.cpp \ |
| 57 |
freedink.h freedink_main.cpp update_frame.cpp update_frame.h \ |
| 58 |
brains.h brain.cpp brain.h brain_bounce.cpp brain_button.cpp \ |
| 59 |
brain_diagonal.cpp brain_duck.cpp brain_keyboard.cpp \ |
| 60 |
brain_lateral.cpp brain_missile.cpp brain_mouse.cpp \ |
| 61 |
brain_none.cpp brain_onetime.cpp brain_people.cpp \ |
| 62 |
brain_pig.cpp brain_repeat.cpp brain_scale.cpp \ |
| 63 |
brain_shadow.cpp brain_text.cpp dinkc_bindings.cpp \ |
| 64 |
dinkc_bindings.h dinkc.cpp dinkc.h dinkc_console.cpp \ |
| 65 |
dinkc_console.h dinkc_console_renderer.cpp \ |
| 66 |
dinkc_console_renderer.h debug.cpp debug.h debug_renderer.cpp \ |
| 67 |
debug_renderer.h game_choice.cpp game_choice.h \ |
| 68 |
game_choice_renderer.cpp game_choice_renderer.h \ |
| 69 |
game_engine.cpp game_engine.h game_state.cpp game_state.h \ |
| 70 |
i18n.cpp i18n.h inventory.cpp inventory.h meminfo.cpp \ |
| 71 |
meminfo.h savegame.cpp savegame.h status.cpp status.h \ |
| 72 |
text.cpp text.h |
| 73 |
freedinkedit_SOURCES = $(COMMON_OBJS) AppFreeDinkedit.h \ |
| 74 |
freedinkedit.cpp |
| 75 |
nodist_freedink_SOURCES = $(WOERES) |
| 76 |
nodist_freedinkedit_SOURCES = $(WOERES) |
| 77 |
|
| 78 |
EXTRA_DIST = media/freedink.ico media/system.sfd media/README |
| 79 |
|
| 80 |
resdir=$(top_srcdir)/share/freedink |
| 81 |
install-exec-hook: |
| 82 |
if HAVE_UPX |
| 83 |
# UPX compression |
| 84 |
# Not using --best because it takes much more time and the result is |
| 85 |
# only a little bit smaller |
| 86 |
# Needs to be done before bundling resources |
| 87 |
-$(UPX) "$(DESTDIR)$(bindir)/freedink$(EXEEXT)" |
| 88 |
-$(UPX) "$(DESTDIR)$(bindir)/freedinkedit$(EXEEXT)" |
| 89 |
endif |
| 90 |
# Add 'dink' and 'dinkedit' aliases, to please 3rd-party tools |
| 91 |
$(LN_S) -f "freedink$(EXEEXT)" "$(DESTDIR)$(bindir)/dink$(EXEEXT)" |
| 92 |
$(LN_S) -f "freedinkedit$(EXEEXT)" "$(DESTDIR)$(bindir)/dinkedit$(EXEEXT)" |
| 93 |
|
| 94 |
uninstall-hook: |
| 95 |
rm -f "$(DESTDIR)$(bindir)/dink$(EXEEXT)" |
| 96 |
rm -f "$(DESTDIR)$(bindir)/dinkedit$(EXEEXT)" |
| 97 |
|
| 98 |
|
| 99 |
# help2man-generated manpages |
| 100 |
# Inspiration from (automake-1.10.info.gz)distcleancheck |
| 101 |
dist_man_MANS = freedink.6 freedinkedit.6 dink.6 dinkedit.6 |
| 102 |
freedink.6: app.cpp $(top_srcdir)/configure.ac Makefile.am |
| 103 |
$(MAKE) $(AM_MAKEFLAGS) freedink$(EXEEXT) |
| 104 |
-$(HELP2MAN) -s6 -n "adventure and role-playing game (engine)" \ |
| 105 |
--no-info --output=freedink.6 ./freedink$(EXEEXT) |
| 106 |
freedinkedit.6: app.cpp $(top_srcdir)/configure.ac Makefile.am |
| 107 |
$(MAKE) $(AM_MAKEFLAGS) freedinkedit$(EXEEXT) |
| 108 |
-$(HELP2MAN) -s6 -n "adventure and role-playing game (editor)" \ |
| 109 |
--no-info --output=freedinkedit.6 ./freedinkedit$(EXEEXT) |
| 110 |
distclean-local: |
| 111 |
rm -f freedink.6 freedinkedit.6 |
| 112 |
|
| 113 |
|
| 114 |
# Woe icon and app infos |
| 115 |
# Also check http://fragglet.livejournal.com/4448.html |
| 116 |
.rc.o: |
| 117 |
$(WINDRES) -i $< -o $@ |
| 118 |
|
| 119 |
# How do we handle resources embedded in the executable binary? |
| 120 |
if HAVE_WINDRES |
| 121 |
WOERES=woeres.rc |
| 122 |
else |
| 123 |
WOERES= |
| 124 |
endif |
| 125 |
|
| 126 |
|
| 127 |
if HAVE_TESTS |
| 128 |
check_PROGRAMS = test_str_util test_io_util TestEditorMap \ |
| 129 |
test_editor_screen test_dinkini test_dinkc test_dinkc_console \ |
| 130 |
test_dinkc_bindings test_live_sprites_manager test_brain_text \ |
| 131 |
test_text test_gfx_fonts TestIOGfxDisplay \ |
| 132 |
TestIOTouchDragAnywhere test_integration |
| 133 |
.cxx.cpp: |
| 134 |
$(CXXTESTGEN) --error-printer \ |
| 135 |
--include test_android_workaround.h \ |
| 136 |
--include config.h --include SDL.h \ |
| 137 |
-o $@ $< |
| 138 |
EXTRA_DIST += test_android_workaround.h \ |
| 139 |
$(patsubst %$(EXEEXT),%.cxx,$(check_PROGRAMS)) |
| 140 |
test_str_util_SOURCES = str_util.cpp test_str_util.cpp |
| 141 |
test_io_util_SOURCES = io_util.cpp test_io_util.cpp |
| 142 |
TestEditorMap_SOURCES = $(COMMON_OBJS) brain.cpp brain.h \ |
| 143 |
brain_bounce.cpp brain_button.cpp brain_diagonal.cpp \ |
| 144 |
brain_duck.cpp brain_keyboard.cpp brain_lateral.cpp \ |
| 145 |
brain_missile.cpp brain_mouse.cpp brain_none.cpp \ |
| 146 |
brain_onetime.cpp brain_people.cpp brain_pig.cpp \ |
| 147 |
brain_repeat.cpp brain_scale.cpp brain_shadow.cpp \ |
| 148 |
brain_text.cpp dinkc_bindings.cpp dinkc_bindings.h dinkc.cpp \ |
| 149 |
dinkc.h dinkc_console.cpp dinkc_console.h freedink.cpp \ |
| 150 |
game_engine.cpp game_engine.h game_choice.cpp game_choice.h \ |
| 151 |
game_state.cpp game_state.h i18n.cpp i18n.h inventory.cpp \ |
| 152 |
inventory.h meminfo.cpp meminfo.h savegame.cpp savegame.h \ |
| 153 |
status.cpp status.h text.cpp text.h TestEditorMap.cpp |
| 154 |
test_dinkini_SOURCES = dinkini.cpp rect.cpp gfx_sprites.cpp \ |
| 155 |
ImageLoader.cpp fastfile.cpp str_util.cpp io_util.cpp \ |
| 156 |
paths.cpp log.cpp test_dinkini.cpp |
| 157 |
test_dinkc_SOURCES = dinkc.cpp str_util.cpp paths.cpp io_util.cpp \ |
| 158 |
i18n.cpp test_dinkc.cpp |
| 159 |
test_dinkc_console_SOURCES = test_dinkc_console.cpp dinkc_console.cpp \ |
| 160 |
str_util.cpp |
| 161 |
test_editor_screen_SOURCES = $(COMMON_OBJS) brain.cpp brain.h \ |
| 162 |
brain_bounce.cpp brain_button.cpp brain_diagonal.cpp \ |
| 163 |
brain_duck.cpp brain_keyboard.cpp brain_lateral.cpp \ |
| 164 |
brain_missile.cpp brain_mouse.cpp brain_none.cpp \ |
| 165 |
brain_onetime.cpp brain_people.cpp brain_pig.cpp \ |
| 166 |
brain_repeat.cpp brain_scale.cpp brain_shadow.cpp \ |
| 167 |
brain_text.cpp dinkc_bindings.cpp dinkc_bindings.h dinkc.cpp \ |
| 168 |
dinkc.h dinkc_console.cpp dinkc_console.h freedink.cpp \ |
| 169 |
game_engine.cpp game_engine.h game_choice.cpp game_choice.h \ |
| 170 |
game_state.cpp game_state.h i18n.cpp i18n.h inventory.cpp \ |
| 171 |
inventory.h meminfo.cpp meminfo.h savegame.cpp savegame.h \ |
| 172 |
status.cpp status.h text.cpp text.h test_editor_screen.cpp |
| 173 |
test_dinkc_bindings_SOURCES = $(COMMON_OBJS) brain.cpp brain.h \ |
| 174 |
brain_bounce.cpp brain_button.cpp brain_diagonal.cpp \ |
| 175 |
brain_duck.cpp brain_keyboard.cpp brain_lateral.cpp \ |
| 176 |
brain_missile.cpp brain_mouse.cpp brain_none.cpp \ |
| 177 |
brain_onetime.cpp brain_people.cpp brain_pig.cpp \ |
| 178 |
brain_repeat.cpp brain_scale.cpp brain_shadow.cpp \ |
| 179 |
brain_text.cpp dinkc_bindings.cpp dinkc_bindings.h dinkc.cpp \ |
| 180 |
dinkc.h dinkc_console.cpp dinkc_console.h freedink.cpp \ |
| 181 |
game_choice.cpp game_choice.h game_engine.cpp game_engine.h \ |
| 182 |
game_state.cpp game_state.h i18n.cpp i18n.h inventory.cpp \ |
| 183 |
inventory.h meminfo.cpp meminfo.h savegame.cpp savegame.h \ |
| 184 |
status.cpp status.h text.cpp text.h test_dinkc_bindings.cpp |
| 185 |
test_live_sprites_manager_SOURCES = live_sprites_manager.cpp rect.cpp \ |
| 186 |
test_live_sprites_manager.cpp |
| 187 |
test_brain_text_SOURCES = $(COMMON_OBJS) brain.cpp brain.h \ |
| 188 |
brain_bounce.cpp brain_button.cpp brain_diagonal.cpp \ |
| 189 |
brain_duck.cpp brain_keyboard.cpp brain_lateral.cpp \ |
| 190 |
brain_missile.cpp brain_mouse.cpp brain_none.cpp \ |
| 191 |
brain_onetime.cpp brain_people.cpp brain_pig.cpp \ |
| 192 |
brain_repeat.cpp brain_scale.cpp brain_shadow.cpp \ |
| 193 |
brain_text.cpp dinkc_bindings.cpp dinkc_bindings.h dinkc.cpp \ |
| 194 |
dinkc.h dinkc_console.cpp freedink.cpp game_choice.cpp \ |
| 195 |
game_choice.h game_engine.cpp game_engine.h game_state.cpp \ |
| 196 |
game_state.h i18n.cpp i18n.h inventory.cpp inventory.h \ |
| 197 |
meminfo.cpp meminfo.h savegame.cpp savegame.h status.cpp \ |
| 198 |
status.h text.cpp text.h test_brain_text.cpp |
| 199 |
test_text_SOURCES = test_text.cpp text.cpp live_sprites_manager.cpp \ |
| 200 |
dinkini.cpp live_sprite.cpp rect.cpp gfx_sprites.cpp \ |
| 201 |
ImageLoader.cpp str_util.cpp io_util.cpp fastfile.cpp \ |
| 202 |
paths.cpp |
| 203 |
test_gfx_fonts_SOURCES = test_gfx_fonts.cpp test_gfx_fonts_libe.h \ |
| 204 |
gfx_fonts.cpp rect.cpp ImageLoader.cpp str_util.cpp \ |
| 205 |
io_util.cpp paths.cpp resources.cpp gfx_palette.cpp \ |
| 206 |
FakeIOGfxDisplay.cpp FakeIOGfxDisplay.h IOGfxDisplay.cpp \ |
| 207 |
freedink_xpm.cpp |
| 208 |
TestIOTouchDragAnywhere_SOURCES = TestIOTouchDragAnywhere.cpp \ |
| 209 |
IOTouchDragAnywhere.cpp |
| 210 |
test_integration_SOURCES = $(COMMON_OBJS) brain.cpp brain.h \ |
| 211 |
brain_bounce.cpp brain_button.cpp brain_diagonal.cpp \ |
| 212 |
brain_duck.cpp brain_keyboard.cpp brain_lateral.cpp \ |
| 213 |
brain_missile.cpp brain_mouse.cpp brain_none.cpp \ |
| 214 |
brain_onetime.cpp brain_people.cpp brain_pig.cpp \ |
| 215 |
brain_repeat.cpp brain_scale.cpp brain_shadow.cpp \ |
| 216 |
brain_text.cpp dinkc_bindings.cpp dinkc_bindings.h dinkc.cpp \ |
| 217 |
dinkc.h dinkc_console.cpp dinkc_console.h freedink.cpp \ |
| 218 |
game_engine.cpp game_engine.h game_choice.cpp game_choice.h \ |
| 219 |
game_state.cpp game_state.h i18n.cpp i18n.h inventory.cpp \ |
| 220 |
inventory.h meminfo.cpp meminfo.h savegame.cpp savegame.h \ |
| 221 |
status.cpp status.h text.cpp text.h test_integration.cpp |
| 222 |
TestIOGfxDisplay_SOURCES = TestIOGfxDisplay.cpp IOGfxDisplayGL2.cpp \ |
| 223 |
IOGfxDisplaySW.cpp IOGfxDisplay.cpp IOGfxSurfaceGL2.cpp \ |
| 224 |
IOGfxSurfaceSW.cpp IOGfxSurface.cpp IOGfxGLFuncs.cpp \ |
| 225 |
ImageLoader.cpp gfx_palette.cpp paths.cpp io_util.cpp \ |
| 226 |
str_util.cpp log.cpp freedink_xpm.cpp SDL_android_main.c |
| 227 |
# Tests to run |
| 228 |
TESTS = $(check_PROGRAMS) |
| 229 |
|
| 230 |
clean-local: |
| 231 |
rm -f $(patsubst %$(EXEEXT),%.cpp,$(check_PROGRAMS)) |
| 232 |
rm -rf tmp_ts/ |
| 233 |
|
| 234 |
if ANDROID |
| 235 |
# Use ugly work-around |
| 236 |
LOG_DRIVER = $(SHELL) $(top_srcdir)/android/remote-test-driver |
| 237 |
# Needs graphics, will be marked as SKIP (driver detects 'shared') |
| 238 |
# Can be tested manually by replacing libmain.so with it |
| 239 |
TestIOGfxDisplay_LDFLAGS = -shared |
| 240 |
else |
| 241 |
# need to redefine it explicitely because we modified it for ANDROID :/ |
| 242 |
LOG_DRIVER = $(SHELL) $(top_srcdir)/autotools/test-driver |
| 243 |
endif |
| 244 |
|
| 245 |
if WOE |
| 246 |
# Outside of wine stdout/stderr is not working unless explicitely redirected with > and 2> |
| 247 |
TestIOGfxDisplay_LDFLAGS = -mconsole |
| 248 |
endif |
| 249 |
|
| 250 |
endif |