2002-04-26 13:39:31 +00:00
|
|
|
# $Header$
|
2002-11-21 04:08:37 +00:00
|
|
|
# This file is used by Makefile and Makefile.mingw and declares common build rules,
|
|
|
|
# a list of common object files etc.
|
2002-04-26 13:39:31 +00:00
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# 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
|
2002-08-21 16:28:19 +00:00
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# The dist file name
|
2002-04-26 13:39:31 +00:00
|
|
|
ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip
|
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# The name for the directory used for depenency tracking
|
|
|
|
DEPDIR := .deps
|
2002-04-26 13:39:31 +00:00
|
|
|
|
2002-11-21 05:00:40 +00:00
|
|
|
# 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
|
2002-11-21 04:08:37 +00:00
|
|
|
# module.mk of their parents. In fact the only reason they are listed here is to ensure the
|
|
|
|
# DEPDIRS directive works correctly.
|
|
|
|
MODULES += \
|
2002-11-26 20:11:46 +00:00
|
|
|
scumm common simon gui backends sound \
|
2002-11-21 04:08:37 +00:00
|
|
|
scumm/smush backends/fs/posix backends/fs/morphos backends/fs/windows
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# Include the build instructions for all modules
|
|
|
|
-include $(patsubst %,%/module.mk,$(MODULES))
|
2002-08-21 16:07:07 +00:00
|
|
|
|
|
|
|
|
2002-11-21 04:08:37 +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
|
|
|
|
2002-08-21 16:53:11 +00:00
|
|
|
.PHONY: all clean dist distclean
|
2002-07-06 13:05:42 +00:00
|
|
|
|
2002-07-06 13:02:57 +00:00
|
|
|
# Default (dumb) compile & dependcy rules
|
2002-11-21 04:08:37 +00:00
|
|
|
#INCS = scumm/scumm.h common/scummsys.h common/stdafx.h
|
2002-08-21 16:28:19 +00:00
|
|
|
#.cpp.o:
|
2002-12-09 13:38:01 +00:00
|
|
|
# $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2002-08-21 16:28:19 +00:00
|
|
|
#$(OBJS): $(INCS)
|
2002-07-06 13:02:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
# If you use GCC, disable the above and enable this for intelligent
|
|
|
|
# dependency tracking.
|
2002-08-21 16:28:19 +00:00
|
|
|
DEPDIRS = $(patsubst %,%/$(DEPDIR),$(MODULES))
|
2002-11-21 04:08:37 +00:00
|
|
|
DEPFILES = $(wildcard $(patsubst %,%/*.d,$(DEPDIRS)))
|
2002-08-21 16:40:33 +00:00
|
|
|
|
2002-11-21 20:36:33 +00:00
|
|
|
.cpp.o:
|
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
2002-12-09 13:38:01 +00:00
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2002-11-21 20:36:33 +00:00
|
|
|
$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
|
|
|
|
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
|
|
|
|
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
|
2002-08-21 16:28:19 +00:00
|
|
|
|
2002-11-21 04:08:37 +00:00
|
|
|
# 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.
|
2002-11-21 20:36:33 +00:00
|
|
|
#.cpp.o:
|
|
|
|
# $(MKDIR) $(*D)/$(DEPDIR)
|
2002-12-09 13:38:01 +00:00
|
|
|
# $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2002-11-21 04:08:37 +00:00
|
|
|
|
2002-08-21 16:40:33 +00:00
|
|
|
-include $(DEPFILES) /dev/null
|
2002-08-21 16:53:11 +00:00
|
|
|
|
|
|
|
distclean: clean
|
2002-08-21 20:47:12 +00:00
|
|
|
$(RM_REC) $(DEPDIRS)
|
2002-09-24 22:40:28 +00:00
|
|
|
$(RM) build.rules config.h
|