Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
412 lines (339 sloc) 11 KB
# This file is used by Makefile and declares common build rules,
# a list of common object files etc.
######################################################################
# The default build target
######################################################################
all:
######################################################################
# Module settings
######################################################################
#MODULES := test tools base $(MODULES)
# TODO: This file should be restructured and much of it moved
# to module.mk style files.
#######################################################################
PROGRAMS = \
decine \
degob \
dekyra \
deprince \
descumm \
desword2 \
gob_loadcalc \
extract_mohawk \
construct_mohawk \
scummvm-tools-cli
ifdef USE_BOOST
PROGRAMS += \
decompile
endif
ifdef USE_FREETYPE
ifdef USE_ICONV
PROGRAMS += \
create_sjisfnt
endif
endif
ifdef USE_WXWIDGETS
PROGRAMS += \
scummvm-tools
endif
ifdef MACOSX
PROGRAMS += \
pegasus_save_types
endif
# TODO: We don't currently set USE_GTK in configure, so the user would have
# to manually specify it
ifdef USE_GTK
PROGRAMS += \
sword2_clue
endif
UTILS := \
common/file.o \
common/hashmap.o \
common/md5.o \
common/memorypool.o \
common/str.o \
common/util.o \
sound/adpcm.o \
sound/audiostream.o \
sound/voc.o \
sound/wave.o
decine_OBJS := engines/cine/decine.o
degob_OBJS := \
engines/gob/degob.o \
engines/gob/degob_script.o \
engines/gob/degob_script_v1.o \
engines/gob/degob_script_v2.o \
engines/gob/degob_script_v3.o \
engines/gob/degob_script_v4.o \
engines/gob/degob_script_v5.o \
engines/gob/degob_script_v6.o \
engines/gob/degob_script_bargon.o \
engines/gob/degob_script_fascin.o \
engines/gob/degob_script_littlered.o \
tool.o \
version.o \
$(UTILS)
dekyra_OBJS := \
engines/kyra/dekyra.o \
engines/kyra/dekyra_v1.o \
$(UTILS)
deprince_OBJS := \
engines/prince/deprince.o \
engines/prince/flags.o \
engines/prince/utils.o \
$(UTILS)
descumm_OBJS := \
engines/scumm/descumm.o \
engines/scumm/descumm6.o \
engines/scumm/descumm-common.o \
engines/scumm/descumm-tool.o \
tool.o \
version.o \
$(UTILS)
desword2_OBJS := \
engines/sword2/desword2.o \
tool.o \
version.o \
$(UTILS)
degob_OBJS := \
engines/gob/degob.o \
engines/gob/degob_script.o \
engines/gob/degob_script_v1.o \
engines/gob/degob_script_v2.o \
engines/gob/degob_script_v3.o \
engines/gob/degob_script_v4.o \
engines/gob/degob_script_v5.o \
engines/gob/degob_script_v6.o \
engines/gob/degob_script_bargon.o \
engines/gob/degob_script_fascin.o \
engines/gob/degob_script_geisha.o \
engines/gob/degob_script_littlered.o \
tool.o \
version.o \
$(UTILS)
gob_loadcalc_OBJS := \
engines/gob/gob_loadcalc.o
extract_mohawk_OBJS := \
engines/mohawk/archive.o \
engines/mohawk/extract_mohawk.o \
engines/mohawk/utils.o \
$(UTILS)
construct_mohawk_OBJS := \
engines/mohawk/construct_mohawk.o \
engines/mohawk/utils.o \
$(UTILS)
pegasus_save_types_OBJS := \
engines/pegasus/pegasus_save_types.o \
$(UTILS)
pegasus_save_types_LIBS := -framework CoreServices
create_sjisfnt_OBJS := create_sjisfnt.o $(UTILS)
create_sjisfnt_LIBS := $(FREETYPELIBS) $(ICONVLIBS)
# Set custom build flags
create_sjisfnt.o: CPPFLAGS+=$(FREETYPEINCLUDES) $(ICONVCFLAGS)
sword2_clue_OBJS := engines/sword2/sword2_clue.o common/file.o
sword2_clue_LIBS := `pkg-config --libs gtk+-2.0`
# Set custom build flags
engines/sword2/sword2_clue.o: CPPFLAGS+=`pkg-config --cflags gtk+-2.0`
tools_OBJS := \
engines/agos/compress_agos.o \
engines/bladerunner/pack_bladerunner.o \
engines/gob/compress_gob.o \
engines/gob/extract_fascination_cd.o \
engines/kyra/compress_kyra.o \
engines/queen/compress_queen.o \
engines/saga/compress_saga.o \
engines/sci/compress_sci.o \
engines/scumm/compress_scumm_bun.o \
engines/scumm/compress_scumm_san.o \
engines/scumm/compress_scumm_sou.o \
engines/sword1/compress_sword1.o \
engines/sword2/compress_sword2.o \
engines/tinsel/compress_tinsel.o \
engines/tony/compress_tony.o \
engines/tony/compress_tony_vdb.o \
engines/touche/compress_touche.o \
engines/tucker/compress_tucker.o \
engines/agos/extract_agos.o \
engines/cge/extract_cge.o \
engines/cge/pack_cge.o \
engines/cine/extract_cine.o \
engines/cruise/extract_cruise_pc.o \
engines/gob/extract_gob_stk.o \
engines/kyra/extract_kyra.o \
engines/prince/extract_prince.o \
engines/prince/pack_prince.o \
engines/prince/utils.o \
engines/parallaction/extract_parallaction.o \
engines/scumm/extract_loom_tg16.o \
engines/scumm/extract_mm_apple.o \
engines/scumm/extract_mm_c64.o \
engines/scumm/extract_mm_nes.o \
engines/scumm/extract_scumm_mac.o \
engines/scumm/extract_zak_c64.o \
engines/kyra/kyra_ins.o \
engines/kyra/kyra_pak.o \
compress.o \
tool.o \
tools.o \
version.o \
$(UTILS)
ifdef USE_PNG
tools_OBJS += \
encode_dxa.o
endif
scummvm-tools_OBJS := \
gui/configuration.o \
gui/gui_tools.o \
gui/main.o \
gui/pages.o \
$(tools_OBJS) \
$(OBJS)
scummvm-tools_LIBS := $(WXLIBS) $(LIBS)
# Set custom build flags for various files
gui/configuration.o: CPPFLAGS+=$(WXINCLUDES)
gui/gui_tools.o: CPPFLAGS+=$(WXINCLUDES)
gui/main.o: CPPFLAGS+=$(WXINCLUDES)
gui/pages.o: CPPFLAGS+=$(WXINCLUDES)
scummvm-tools-cli_OBJS := \
main_cli.o \
scummvm-tools-cli.o \
$(tools_OBJS)
scummvm-tools-cli_LIBS := $(LIBS)
ifdef USE_BOOST
decompile_OBJS := \
common/file.o \
decompiler/codegen.o \
decompiler/control_flow.o \
decompiler/decompiler.o \
decompiler/disassembler.o \
decompiler/graph.o \
decompiler/instruction.o \
decompiler/simple_disassembler.o \
decompiler/unknown_opcode.o \
decompiler/value.o \
decompiler/groovie/disassembler.o \
decompiler/groovie/engine.o \
decompiler/kyra/codegen.o \
decompiler/kyra/disassembler.o \
decompiler/kyra/engine.o \
decompiler/scummv6/codegen.o \
decompiler/scummv6/disassembler.o \
decompiler/scummv6/engine.o
decompile_LIBS := \
-lboost_program_options$(BOOST_SUFFIX)
# Decompiler tests
-include decompiler/test/module.mk
endif
# Decompiler documentation
doc:
make -C decompiler/doc all
# Make base/version.o depend on all other object files. This way if anything is
# changed, it causes version.cpp to be recompiled. This in turn ensures that
# the build date in gScummVMBuildDate is correct.
version.o: $(filter-out version.o,$(descumm_OBJS))
version.o: $(filter-out version.o,$(desword2_OBJS))
version.o: $(filter-out version.o,$(degob_OBJS))
version.o: $(filter-out version.o,$(scummvm-tools-cli_OBJS))
ifdef USE_WXWIDGETS
version.o: $(filter-out version.o,$(scummvm-tools_OBJS))
endif
######################################################################
# The build rules follow - normally you should have no need to
# touch whatever comes after here.
######################################################################
# Replace regular output with quiet messages
ifneq ($(findstring $(MAKEFLAGS),s),s)
ifneq ($(VERBOSE_BUILD),1)
ifneq ($(VERBOSE_BUILD),yes)
QUIET_CXX = @echo ' ' C++ ' ' $@;
QUIET_AR = @echo ' ' AR ' ' $@;
QUIET_RANLIB = @echo ' ' RANLIB ' ' $@;
QUIET_LINK = @echo ' ' LINK ' ' $(1);
QUIET_WINDRES = @echo ' ' WINDRES '' $@;
QUIET = @
endif
endif
endif
######################################################################
# Generate list of tool binaries
TARGETS := $(addsuffix $(EXEEXT),$(PROGRAMS))
all: $(TARGETS)
install: $(TARGETS)
$(INSTALL) -p -m 0755 -d $(DESTDIR)$(BINDIR)
$(INSTALL) -p -m 0755 -d $(DESTDIR)$(DATADIR)/scummvm-tools
for i in $^ ; do $(INSTALL) -p -m 0755 $$i $(DESTDIR)$(BINDIR) ; done
$(INSTALL) -m 0755 -d $(DESTDIR)$(DATADIR)/scummvm-tools
$(INSTALL) -p -m 0644 $(srcdir)/gui/media/*.* $(DESTDIR)$(DATADIR)/scummvm-tools
# Template for all executable targets.
# This also automatically hooks up a "clean" rule.
# It also sets up MODULE_DIRS.
define PROGRAM_template
MODULE_DIRS += $(dir $($(1)_OBJS))
$(1)$(EXEEXT): $$($(1)_OBJS)
$(QUIET_LINK)$(LD) -o $(1)$(EXEEXT) $$($(1)_OBJS) $(LDFLAGS) $$($(1)_LIBS)
#all: $(1)$(EXEEXT)
clean-$(1):
$(RM) $(1)$(EXEEXT)
clean: clean-$(1)
endef
# Generate build rules for all tools
$(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
# Merge duplicate entries in MODULE_DIRS
MODULE_DIRS := $(sort $(MODULE_DIRS))
######################################################################
clean:
$(RM) $(addsuffix *.o,$(MODULE_DIRS))
# Concat DEFINES and INCLUDES to form the CPPFLAGS
CPPFLAGS := $(DEFINES) $(INCLUDES)
# Include the build instructions for all modules
#-include $(addprefix $(srcdir)/, $(addsuffix /module.mk,$(MODULES)))
# Depdir information
DEPDIRS = $(addsuffix $(DEPDIR),$(MODULE_DIRS))
DEPFILES =
ifdef CXX_UPDATE_DEP_FLAG
# Build rule for C++ files. Makes use of CXX_UPDATE_DEP_FLAG for advanced
# dependency tracking.
%.o: %.cpp
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
else
# Dumb compile rule, for C++ compilers that don't allow dependency tracking or
# where it is broken (such as GCC 2.95).
.cpp.o:
$(QUIET_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
endif
# Include the dependency tracking files.
-include $(wildcard $(addsuffix /*.d,$(DEPDIRS)))
# Mark *.d files and most *.mk files as PHONY. This stops make from trying to
# recreate them (which it can't), and in particular from looking for potential
# source files. This can save quite a bit of disk access time.
.PHONY: $(wildcard $(addsuffix /*.d,$(DEPDIRS))) $(addprefix $(srcdir)/, $(addsuffix /module.mk,$(MODULES))) \
$(srcdir)/$(port_mk) $(srcdir)/rules.mk $(srcdir)/engines/engines.mk
######################################################################
# Get the current version information
######################################################################
# AmigaOS4's grep has a problem with "./" in pathnames, so use cat.
VERSION = $(shell cat "${srcdir}/internal_version.h" | grep SCUMMVM_TOOLS_VERSION | cut -d\" -f2)
VER_MAJOR = $(shell echo $(VERSION) | cut -d. -f 1)
VER_MINOR = $(shell echo $(VERSION) | cut -d. -f 2)
VER_PATCH = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c1)
VER_EXTRA = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c2-)
######################################################################
# Get git's working copy information
######################################################################
ifneq ($(shell cd $(srcdir); git rev-parse --verify HEAD 1>/dev/null 2>&1 || echo "error"),error)
GITROOT := $(srcdir)
ifeq ($(origin VER_REV), undefined)
# Are there uncommitted changes? (describe --dirty is only available since 1.6.6)
VER_DIRTY := $(shell cd $(srcdir); git update-index --refresh --unmerged 1>/dev/null 2>&1; git diff-index --quiet HEAD || echo "-dirty")
# Get the working copy base revision
VER_REV := $(shell cd $(srcdir); git describe | cut -d '-' -f 2-)$(VER_DIRTY)
endif
else
GITROOT := git://github.com/scummvm/scummvm-tools.git
endif
# Define the Git revision if available, either autodetected or
# specified by the user, but only for version.cpp.
ifneq ($(origin VER_REV), undefined)
version.o: CXXFLAGS:=$(CXXFLAGS) -DSCUMMVM_TOOLS_REVISION=\"$(VER_REV)\"
endif
You can’t perform that action at this time.