support for Makefile.am.in -> Makefile.am using plain files with sources
This commit is contained in:
parent
a9f1cbc9d8
commit
3d403f1465
5 changed files with 546 additions and 0 deletions
229
src/Makefile.am.in
Normal file
229
src/Makefile.am.in
Normal file
|
@ -0,0 +1,229 @@
|
|||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
bin_PROGRAMS =
|
||||
|
||||
if GAME
|
||||
bin_PROGRAMS += wesnoth
|
||||
endif
|
||||
|
||||
if SERVER
|
||||
bin_PROGRAMS += wesnothd
|
||||
endif
|
||||
|
||||
if CAMPAIGNSERVER
|
||||
bin_PROGRAMS += campaignd
|
||||
endif
|
||||
|
||||
if TOOLS
|
||||
bin_PROGRAMS += exploder cutter
|
||||
endif
|
||||
|
||||
if EDITOR
|
||||
bin_PROGRAMS += wesnoth_editor
|
||||
endif
|
||||
|
||||
pkgdatadir=$(datadir)/@DATADIR@
|
||||
|
||||
#############################################################################
|
||||
# Wesnoth #
|
||||
#############################################################################
|
||||
|
||||
wesnoth_SOURCES = @wesnoth_common_sources@ @wesnoth_sources@
|
||||
|
||||
#############################################################################
|
||||
# Editor #
|
||||
#############################################################################
|
||||
|
||||
wesnoth_editor_SOURCES = @wesnoth_common_sources@ @wesnoth_editor_sources@
|
||||
|
||||
#############################################################################
|
||||
# Wesnothd Server #
|
||||
#############################################################################
|
||||
|
||||
wesnothd_SOURCES = \
|
||||
server/game.cpp \
|
||||
server/input_stream.cpp \
|
||||
server/metrics.cpp \
|
||||
server/player.cpp \
|
||||
server/server.cpp \
|
||||
config.cpp \
|
||||
filesystem.cpp \
|
||||
game_config.cpp \
|
||||
gettext.cpp \
|
||||
log.cpp \
|
||||
network.cpp \
|
||||
network_worker.cpp \
|
||||
thread.cpp \
|
||||
tstring.cpp \
|
||||
serialization/binary_wml.cpp \
|
||||
serialization/parser.cpp \
|
||||
serialization/string_utils.cpp \
|
||||
serialization/tokenizer.cpp \
|
||||
zipios++/xcoll.cpp \
|
||||
server/game.hpp \
|
||||
server/input_stream.hpp \
|
||||
server/metrics.hpp \
|
||||
server/player.hpp \
|
||||
config.hpp \
|
||||
filesystem.hpp \
|
||||
game_config.hpp \
|
||||
gettext.hpp \
|
||||
log.hpp \
|
||||
network.hpp \
|
||||
network_worker.hpp \
|
||||
thread.hpp \
|
||||
tstring.hpp \
|
||||
serialization/binary_wml.hpp \
|
||||
serialization/string_utils.hpp \
|
||||
zipios++/xcoll.hpp
|
||||
|
||||
wesnothd_LDADD = @SDL_NET_LIBS@ @SDL_LIBS@ $(LIBZIPIOS) $(LIBINTL)
|
||||
|
||||
#############################################################################
|
||||
# Campaign Server #
|
||||
#############################################################################
|
||||
|
||||
campaignd_SOURCES = \
|
||||
campaign_server/campaign_server.cpp \
|
||||
config.cpp \
|
||||
filesystem.cpp \
|
||||
game_config.cpp \
|
||||
gettext.cpp \
|
||||
log.cpp \
|
||||
network.cpp \
|
||||
network_worker.cpp \
|
||||
publish_campaign.cpp \
|
||||
thread.cpp \
|
||||
tstring.cpp \
|
||||
serialization/binary_wml.cpp \
|
||||
serialization/parser.cpp \
|
||||
serialization/string_utils.cpp \
|
||||
serialization/tokenizer.cpp \
|
||||
zipios++/xcoll.cpp \
|
||||
config.hpp \
|
||||
filesystem.hpp \
|
||||
game_config.hpp \
|
||||
gettext.hpp \
|
||||
log.hpp \
|
||||
network.hpp \
|
||||
network_worker.hpp \
|
||||
publish_campaign.hpp \
|
||||
serialization/binary_wml.hpp \
|
||||
serialization/parser.hpp \
|
||||
serialization/preprocessor.hpp \
|
||||
serialization/string_utils.hpp \
|
||||
serialization/tokenizer.hpp \
|
||||
thread.hpp \
|
||||
tstring.hpp \
|
||||
zipios++/xcoll.hpp
|
||||
|
||||
campaignd_LDADD = @SDL_NET_LIBS@ @SDL_LIBS@ $(LIBZIPIOS) $(LIBINTL)
|
||||
|
||||
#############################################################################
|
||||
# Castle building helpers #
|
||||
#############################################################################
|
||||
|
||||
exploder_SOURCES = \
|
||||
tools/exploder.cpp \
|
||||
tools/exploder_utils.cpp \
|
||||
tools/exploder_cutter.cpp \
|
||||
tools/exploder_composer.cpp \
|
||||
tools/dummy_video.cpp \
|
||||
config.cpp \
|
||||
filesystem.cpp \
|
||||
game_config.cpp \
|
||||
sdl_utils.cpp \
|
||||
log.cpp \
|
||||
tstring.cpp \
|
||||
serialization/parser.cpp \
|
||||
serialization/preprocessor.cpp \
|
||||
serialization/string_utils.cpp \
|
||||
serialization/tokenizer.cpp \
|
||||
zipios++/xcoll.cpp \
|
||||
tools/exploder_composer.hpp \
|
||||
tools/exploder_cutter.hpp \
|
||||
tools/exploder_utils.hpp \
|
||||
serialization/parser.hpp \
|
||||
serialization/preprocessor.hpp \
|
||||
serialization/string_utils.hpp \
|
||||
serialization/tokenizer.hpp \
|
||||
zipios++/xcoll.hpp \
|
||||
tstring.hpp \
|
||||
gettext.cpp
|
||||
|
||||
cutter_SOURCES = \
|
||||
tools/cutter.cpp \
|
||||
tools/exploder_utils.cpp \
|
||||
tools/exploder_cutter.cpp \
|
||||
tools/dummy_video.cpp \
|
||||
config.cpp \
|
||||
filesystem.cpp \
|
||||
game_config.cpp \
|
||||
sdl_utils.cpp \
|
||||
log.cpp \
|
||||
tstring.cpp \
|
||||
serialization/parser.cpp \
|
||||
serialization/preprocessor.cpp \
|
||||
serialization/string_utils.cpp \
|
||||
serialization/tokenizer.cpp \
|
||||
zipios++/xcoll.cpp \
|
||||
tools/exploder_composer.hpp \
|
||||
tools/exploder_cutter.hpp \
|
||||
tools/exploder_utils.hpp \
|
||||
serialization/parser.hpp \
|
||||
serialization/preprocessor.hpp \
|
||||
serialization/string_utils.hpp \
|
||||
serialization/tokenizer.hpp \
|
||||
zipios++/xcoll.hpp \
|
||||
tstring.hpp \
|
||||
gettext.cpp
|
||||
|
||||
exploder_LDADD = @SDL_IMAGE_LIBS@ @SDL_LIBS@ $(LIBZIPIOS) $(LIBINTL) $(PNG_LIBS)
|
||||
cutter_LDADD = @SDL_IMAGE_LIBS@ @SDL_LIBS@ $(LIBZIPIOS) $(LIBINTL) $(PNG_LIBS)
|
||||
|
||||
AM_CXXFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
|
||||
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) -DFIFODIR=\"$(fifodir)\"
|
||||
|
||||
AM_CFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
|
||||
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR)
|
||||
|
||||
if X11
|
||||
CXXFLAGS += -D_X11 @X_CFLAGS@
|
||||
CFLAGS += -D_X11 @X_CFLAGS@
|
||||
endif
|
||||
if GCC
|
||||
CXXFLAGS += -fno-omit-frame-pointer
|
||||
CFLAGS += -fno-omit-frame-pointer
|
||||
endif
|
||||
|
||||
CXXLD = $(LDPREFIX) $(CXX)
|
||||
|
||||
|
||||
THELIBS = $(SDL_IMAGE_LIBS) $(SDL_MIXER_LIBS) $(SDL_NET_LIBS) \
|
||||
$(SDL_TTF_LIBS) $(SDL_LIBS) $(LIBZIPIOS) $(FREETYPE_LIBS) $(LIBINTL)
|
||||
|
||||
wesnoth_LDADD = $(THELIBS)
|
||||
wesnoth_editor_LDADD = $(THELIBS)
|
||||
|
||||
if STATIC
|
||||
LDFLAGS += -all-static
|
||||
endif
|
||||
|
||||
#if STATIC
|
||||
#LIBS += -static -L/usr/lib -Wl,-rpath,/usr/lib -L/usr/X11R6/lib -lSDL_image \
|
||||
#-lSDL_mixer -lSDL_net -lSDL_ttf -lSDL -lpthread -ldl -laudio -lXt -lX11 -lXext \
|
||||
#-lSDL_image -lSDL_mixer -lSDL_net -lSDL_ttf -lstdc++ -lm -lSM -lICE -ljpeg \
|
||||
#-lpng -lz -lvorbisfile -lvorbis -logg -lsmpeg -lfreetype
|
||||
#endif
|
||||
|
||||
if SERVER
|
||||
install-exec-hook:
|
||||
mkdir -p -m 0700 $(DESTDIR)$(fifodir)
|
||||
chown $(serveruid):$(servergid) $(DESTDIR)$(fifodir)
|
||||
|
||||
uninstall-hook:
|
||||
rm -rf $(DESTDIR)$(fifodir)
|
||||
else
|
||||
install-exec-hook:
|
||||
uninstall-hook:
|
||||
endif
|
153
src/wesnoth_common_sources
Normal file
153
src/wesnoth_common_sources
Normal file
|
@ -0,0 +1,153 @@
|
|||
about.cpp
|
||||
about.hpp
|
||||
actions.cpp
|
||||
actions.hpp
|
||||
ai.hpp
|
||||
animated.cpp
|
||||
animated.hpp
|
||||
array.hpp
|
||||
astarnode.cpp
|
||||
astarnode.hpp
|
||||
builder.cpp
|
||||
builder.hpp
|
||||
cavegen.cpp
|
||||
cavegen.hpp
|
||||
checksum.cpp
|
||||
checksum.hpp
|
||||
clipboard.cpp
|
||||
clipboard.hpp
|
||||
config.cpp
|
||||
config.hpp
|
||||
cursor.cpp
|
||||
cursor.hpp
|
||||
dialogs.cpp
|
||||
dialogs.hpp
|
||||
display.cpp
|
||||
display.hpp
|
||||
events.cpp
|
||||
events.hpp
|
||||
filesystem.cpp
|
||||
filesystem.hpp
|
||||
font.cpp
|
||||
font.hpp
|
||||
game_config.cpp
|
||||
game_config.hpp
|
||||
game_events.cpp
|
||||
game_events.hpp
|
||||
gamestatus.cpp
|
||||
gamestatus.hpp
|
||||
gettext.cpp
|
||||
gettext.hpp
|
||||
halo.cpp
|
||||
halo.hpp
|
||||
help.cpp
|
||||
help.hpp
|
||||
hotkeys.cpp
|
||||
hotkeys.hpp
|
||||
image.cpp
|
||||
image.hpp
|
||||
intro.hpp
|
||||
key.cpp
|
||||
key.hpp
|
||||
language.cpp
|
||||
language.hpp
|
||||
log.cpp
|
||||
log.hpp
|
||||
map.cpp
|
||||
map.hpp
|
||||
map_create.cpp
|
||||
map_create.hpp
|
||||
map_label.cpp
|
||||
map_label.hpp
|
||||
mapgen.cpp
|
||||
mapgen.hpp
|
||||
mapgen_dialog.cpp
|
||||
mapgen_dialog.hpp
|
||||
mouse.cpp
|
||||
mouse.hpp
|
||||
network.cpp
|
||||
network.hpp
|
||||
network_worker.cpp
|
||||
network_worker.hpp
|
||||
pathfind.cpp
|
||||
pathfind.hpp
|
||||
pathutils.cpp
|
||||
pathutils.hpp
|
||||
playlevel.hpp
|
||||
playturn.cpp
|
||||
playturn.hpp
|
||||
preferences.cpp
|
||||
preferences.hpp
|
||||
race.cpp
|
||||
race.hpp
|
||||
random.cpp
|
||||
random.hpp
|
||||
replay.cpp
|
||||
replay.hpp
|
||||
reports.cpp
|
||||
reports.hpp
|
||||
sdl_ttf/SDL_ttf.c
|
||||
sdl_ttf/SDL_ttf.h
|
||||
sdl_utils.cpp
|
||||
sdl_utils.hpp
|
||||
serialization/binary_or_text.cpp
|
||||
serialization/binary_or_text.hpp
|
||||
serialization/binary_wml.cpp
|
||||
serialization/binary_wml.hpp
|
||||
serialization/parser.cpp
|
||||
serialization/parser.hpp
|
||||
serialization/preprocessor.cpp
|
||||
serialization/preprocessor.hpp
|
||||
serialization/string_utils.cpp
|
||||
serialization/string_utils.hpp
|
||||
serialization/tokenizer.cpp
|
||||
serialization/tokenizer.hpp
|
||||
show_dialog.cpp
|
||||
show_dialog.hpp
|
||||
sound.cpp
|
||||
sound.hpp
|
||||
statistics.cpp
|
||||
statistics.hpp
|
||||
team.cpp
|
||||
team.hpp
|
||||
terrain.cpp
|
||||
terrain.hpp
|
||||
theme.cpp
|
||||
theme.hpp
|
||||
thread.cpp
|
||||
thread.hpp
|
||||
tooltips.cpp
|
||||
tooltips.hpp
|
||||
tstring.cpp
|
||||
tstring.hpp
|
||||
unit.cpp
|
||||
unit.hpp
|
||||
unit_display.cpp
|
||||
unit_display.hpp
|
||||
unit_types.cpp
|
||||
unit_types.hpp
|
||||
variable.cpp
|
||||
variable.hpp
|
||||
video.cpp
|
||||
video.hpp
|
||||
wesconfig.h
|
||||
widgets/button.cpp
|
||||
widgets/button.hpp
|
||||
widgets/label.cpp
|
||||
widgets/label.hpp
|
||||
widgets/menu.cpp
|
||||
widgets/menu.hpp
|
||||
widgets/progressbar.cpp
|
||||
widgets/progressbar.hpp
|
||||
widgets/scrollarea.cpp
|
||||
widgets/scrollarea.hpp
|
||||
widgets/scrollbar.cpp
|
||||
widgets/scrollbar.hpp
|
||||
widgets/slider.cpp
|
||||
widgets/slider.hpp
|
||||
widgets/textbox.cpp
|
||||
widgets/textbox.hpp
|
||||
widgets/widget.cpp
|
||||
widgets/widget.hpp
|
||||
zipios++/xcoll.cpp
|
||||
zipios++/xcoll.hpp
|
16
src/wesnoth_editor_sources
Normal file
16
src/wesnoth_editor_sources
Normal file
|
@ -0,0 +1,16 @@
|
|||
editor/editor.cpp
|
||||
editor/editor.hpp
|
||||
editor/editor_dialogs.cpp
|
||||
editor/editor_dialogs.hpp
|
||||
editor/editor_layout.cpp
|
||||
editor/editor_layout.hpp
|
||||
editor/editor_main.cpp
|
||||
editor/editor_palettes.cpp
|
||||
editor/editor_palettes.hpp
|
||||
editor/editor_undo.cpp
|
||||
editor/editor_undo.hpp
|
||||
editor/map_manip.cpp
|
||||
editor/map_manip.hpp
|
||||
filechooser.cpp
|
||||
widgets/file_chooser.cpp
|
||||
widgets/file_chooser.hpp
|
39
src/wesnoth_sources
Normal file
39
src/wesnoth_sources
Normal file
|
@ -0,0 +1,39 @@
|
|||
ai.cpp
|
||||
ai2.hpp
|
||||
ai_attack.cpp
|
||||
ai_interface.hpp
|
||||
ai_move.cpp
|
||||
game.cpp
|
||||
game_errors.hpp
|
||||
global.hpp
|
||||
intro.cpp
|
||||
leader_list.cpp
|
||||
leader_list.hpp
|
||||
multiplayer.cpp
|
||||
multiplayer.hpp
|
||||
multiplayer_connect.cpp
|
||||
multiplayer_connect.hpp
|
||||
multiplayer_create.cpp
|
||||
multiplayer_create.hpp
|
||||
multiplayer_lobby.cpp
|
||||
multiplayer_lobby.hpp
|
||||
multiplayer_ui.cpp
|
||||
multiplayer_ui.hpp
|
||||
multiplayer_wait.cpp
|
||||
multiplayer_wait.hpp
|
||||
playcampaign.cpp
|
||||
playcampaign.hpp
|
||||
playlevel.cpp
|
||||
publish_campaign.cpp
|
||||
publish_campaign.hpp
|
||||
scoped_resource.hpp
|
||||
titlescreen.cpp
|
||||
titlescreen.hpp
|
||||
util.hpp
|
||||
wassert.cpp
|
||||
wassert.hpp
|
||||
widgets/combo.cpp
|
||||
widgets/combo.hpp
|
||||
widgets/scrollpane.cpp
|
||||
widgets/scrollpane.hpp
|
||||
wml_separators.hpp
|
109
utils/mkmam
Executable file
109
utils/mkmam
Executable file
|
@ -0,0 +1,109 @@
|
|||
#!/usr/bin/perl
|
||||
# mkmam: make Makefile.am from Makefile.am.in,
|
||||
# substituting file lists into _SOURCES variables
|
||||
|
||||
# Copyright (C) 2005 by ott
|
||||
# Part of the Battle for Wesnoth Project http://wesnoth.org/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License.
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY.
|
||||
#
|
||||
# See the COPYING file for more details.
|
||||
|
||||
# Automake is dysfunctional: it doesn't understand
|
||||
# that one may want to use a list of sources for multiple projects,
|
||||
# and that this list should be clean and simple...
|
||||
# The automake authors seem to think one should extract the list of sources
|
||||
# from the Makefile.am _SOURCES variable if one needs it.
|
||||
# This script works around this limitation by substituting any
|
||||
# occurrences of @NAME@ inside any _SOURCES variable assignments
|
||||
# in FILE.in with the contents of the file NAME, and writes FILE as the output.
|
||||
# It is assumed that NAME contains a list of files, one per line
|
||||
# and multiple files can be substituted at once.
|
||||
# Watch out for @ substitutions inside file NAME, no check is made
|
||||
# for infinite loops -- it's probably best to avoid @ inside the NAME files.
|
||||
|
||||
use strict;
|
||||
use File::Basename;
|
||||
|
||||
my $DEBUG = 0;
|
||||
my $filename;
|
||||
|
||||
sub process_arg {
|
||||
# uses global $filename
|
||||
my $arg = shift;
|
||||
$DEBUG and print STDERR "argument :$arg:\n";
|
||||
while (1) { # process $arg
|
||||
my $i = index($arg, '@');
|
||||
my $l = index($arg, '@', $i+1) - $i + 1;
|
||||
last if $l <= 1; # stop unless we find two @'s
|
||||
# now $l > 1 and substr($arg, $i, $l) =~ /^@.*@$/
|
||||
my $thisfile = substr($arg, $i, $l, '');
|
||||
$thisfile =~ s/^@([^@]*)@/\1/;
|
||||
my ($base,$path,$type) = fileparse($filename, '');
|
||||
$thisfile = (fileparse($filename, ''))[1] . $thisfile unless $thisfile =~ /^\//;
|
||||
$DEBUG and print STDERR "substituting $thisfile\n";
|
||||
substr($arg, $i, 0) = `cat $thisfile`;
|
||||
}
|
||||
$arg =~ s/^([^\\])/\\\n\1/;
|
||||
$arg =~ s/([^\\\n ])\n/\1 \\\n/g;
|
||||
$arg =~ s/\n +/\n\t/g;
|
||||
$arg =~ s/\n([^\t\n])/\n\t\1/g;
|
||||
$arg =~ s/\s*\\(\n+)$/\1/;
|
||||
$DEBUG and print STDERR "argument now :$arg:\n";
|
||||
return $arg;
|
||||
}
|
||||
|
||||
my $state;
|
||||
my $arg;
|
||||
|
||||
Argument:
|
||||
while ($filename = shift) {
|
||||
$DEBUG and print STDERR "opening $filename for reading\n";
|
||||
if (! open(CURRENT, $filename)) {
|
||||
warn("cannot open file $filename, skipping");
|
||||
next Argument;
|
||||
}
|
||||
my ($base,$path,$type) = fileparse($filename, qr{\.in});
|
||||
if ($type ne '.in') {
|
||||
warn "Can only process files ending with .in, skipping $filename";
|
||||
next Argument;
|
||||
}
|
||||
my $outfile = $path . $base;
|
||||
$DEBUG and print STDERR "opening $outfile for writing\n";
|
||||
if (! open(OUTFILE, ">$outfile")) {
|
||||
warn "Can't open $outfile for writing, skipping $filename";
|
||||
next Argument;
|
||||
}
|
||||
$state = 0;
|
||||
$arg = '';
|
||||
while (<CURRENT>) {
|
||||
if ($state == 0) {
|
||||
if ( /^(\w+_SOURCES\s*=\s*)(.*)/s ) {
|
||||
print OUTFILE $1;
|
||||
$arg = $2;
|
||||
# chomp $arg;
|
||||
if ( $arg =~ /\\$/ ) {
|
||||
$state = 1;
|
||||
} else {
|
||||
print OUTFILE process_arg( $arg );
|
||||
}
|
||||
} else {
|
||||
print OUTFILE; # keep looking
|
||||
}
|
||||
} elsif ($state == 1) { # looking for more lines
|
||||
$arg .= $_;
|
||||
if ( ! /\\$/ ) { # got the whole SOURCES line, substitute
|
||||
print OUTFILE process_arg($arg);
|
||||
$arg = '';
|
||||
$state = 0;
|
||||
}
|
||||
} else {
|
||||
die 'Internal error, quitting';
|
||||
}
|
||||
}
|
||||
print OUTFILE process_arg($arg) if $arg;
|
||||
close $outfile;
|
||||
}
|
Loading…
Add table
Reference in a new issue