scummvm/Makefile.common

107 lines
2.9 KiB
Makefile
Raw Normal View History

# $Header$
# This file is used by Makefile and Makefile.mingw and declares common build rules,
# a list of common object files etc.
# The defaul build target: just build the scummvm executable
all: scummvm$(EXEEXT)
# Files that are to be included in the archive built by "make dist"
DISTFILES := \
Makefile Makefile.common Makefile.mingw \
NEWS README COPYING scummvm.6 Info.plist \
scumm.dsp scummvm.dsp scummvm.dsw scummvm.icns scummvm.ico \
scummvm.proj scummvm.rc scummvm.spec scummvm.xpm simon.dsp sky.dsp
# The dist file name
ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip
# The name for the directory used for depenency tracking
DEPDIR := .deps
# List of all sub modules (note: order is important, don't mess with it)
# TODO - the nested ones (scumm/smush, backends/...) should be handled from the
# module.mk of their parents. In fact the only reason they are listed here is to ensure the
# DEPDIRS directive works correctly.
ifdef DISABLE_SCUMM
DEFINES += -DDISABLE_SCUMM
else
MODULES += scumm
endif
ifdef DISABLE_SIMON
DEFINES += -DDISABLE_SIMON
else
MODULES += simon
endif
ifdef DISABLE_SKY
DEFINES += -DDISABLE_SKY
else
MODULES += sky
endif
MODULES += \
common \
gui \
backends \
sound \
scumm/smush \
backends/fs/posix \
backends/fs/morphos \
backends/fs/windows \
backends/midi
2002-07-06 13:05:42 +00:00
# Concat DEFINES and INCLUDES to form the CPPFLAGS
CPPFLAGS:= $(DEFINES) $(INCLUDES)
# Include the build instructions for all modules
-include $(addsuffix /module.mk,$(MODULES))
2002-08-21 16:07:07 +00:00
# Make engine.o depend on all other object files. This way if anything is
# changed, it causes engine.cpp to be recompiled. This in turn ensures that
# the build date in gScummVMBuildDate is correct.
common/engine.o: $(OBJS)
# HACK temporary fix to get compilation on OS X (and possibly others) working again
OBJS:=common/engine.o $(OBJS)
2002-08-21 16:07:07 +00:00
scummvm$(EXEEXT): $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $+ $(LIBS)
2002-07-06 13:05:42 +00:00
clean:
2002-11-24 08:51:17 +00:00
$(RM) $(OBJS) scummvm$(EXEEXT)
2002-07-06 13:05:42 +00:00
.PHONY: all clean dist distclean
2002-07-06 13:05:42 +00:00
# Default (dumb) compile & dependcy rules
#INCS = scumm/scumm.h common/scummsys.h common/stdafx.h
#.cpp.o:
# $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
#$(OBJS): $(INCS)
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
DEPDIRS = $(addsuffix /$(DEPDIR),$(MODULES))
DEPFILES = $(wildcard $(addsuffix /*.d,$(DEPDIRS)))
.cpp.o:
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
# If you even have GCC 3.x, you can use this build rule, which is safer; the above
# rule can get you into a bad state if you Ctrl-C it in the wrong moment.
#.cpp.o:
# $(MKDIR) $(*D)/$(DEPDIR)
# $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
-include $(DEPFILES) /dev/null
distclean: clean
2002-08-21 20:47:12 +00:00
$(RM_REC) $(DEPDIRS)
$(RM) build.rules config.h config.mak