aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-01-13 17:05:43 +0000
committerMax Horn2008-01-13 17:05:43 +0000
commit696ea9d301cae1f2a123c37ddaa7490544cd99a0 (patch)
tree7ac7d9a83c250ce1abaec2d2cea030d73467e7cd
parent79e1579cb3119a70677f7c7c158c5e7686b65f6d (diff)
downloadscummvm-rg350-696ea9d301cae1f2a123c37ddaa7490544cd99a0.tar.gz
scummvm-rg350-696ea9d301cae1f2a123c37ddaa7490544cd99a0.tar.bz2
scummvm-rg350-696ea9d301cae1f2a123c37ddaa7490544cd99a0.zip
Various small patches to the build system by jvprat
svn-id: r30473
-rw-r--r--Makefile17
-rw-r--r--Makefile.common10
-rwxr-xr-xconfigure18
-rw-r--r--tools/module.mk2
4 files changed, 20 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index ef7cfac3a0..a85f31420c 100644
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,19 @@ CXXFLAGS+= -fno-rtti -fno-exceptions -fcheck-new
#CXXFLAGS+= -O -Wuninitialized
#######################################################################
+# Default commands - put the necessary replacements in config.mk #
+#######################################################################
+
+CAT ?= cat
+CP ?= cp
+ECHO ?= printf
+INSTALL ?= install
+MKDIR ?= mkdir -p
+RM ?= rm -f
+RM_REC ?= $(RM) -r
+ZIP ?= zip -q
+
+#######################################################################
# Misc stuff - you should never have to edit this #
#######################################################################
@@ -44,8 +57,8 @@ EXECUTABLE := scummvm$(EXEEXT)
include $(srcdir)/Makefile.common
# check if configure has been run or has been changed since last run
-config.mk: $(srcdir)/configure
-ifdef CONFIG_MK_IS_PRESENT
+config.h config.mk: $(srcdir)/configure
+ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
@echo "Running $(srcdir)/configure with the last specified parameters"
@sleep 2s
LDFLAGS="$(SAVED_LDFLAGS)" CXX="$(SAVED_CXX)" CXXFLAGS="$(SAVED_CXXFLAGS)" CPPFLAGS="$(SAVED_CPPFLAGS)" \
diff --git a/Makefile.common b/Makefile.common
index 4852906c02..965f73dd42 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -79,7 +79,7 @@ clean:
ifndef HAVE_GCC3
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
-.cpp.o:
+%.o: %.cpp
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
@@ -90,18 +90,16 @@ else
# rule can get you into a bad state if you Ctrl-C at the wrong moment.
# Also, with this GCC inserts additional dummy rules for the involved headers,
# which ensures a smooth compilation even if said headers become obsolete.
-.cpp.o:
+%.o: %.cpp
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
-.m.o:
+%.o: %.m
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o
endif
ifdef HAVE_NASM
-.SUFFIXES: .asm
-
-.asm.o:
+%.o: %.asm
$(NASM) -O1 $(NASMFLAGS) -g -o $*.o $(<)
endif
diff --git a/configure b/configure
index 48d814dfab..aac0896e1c 100755
--- a/configure
+++ b/configure
@@ -109,15 +109,7 @@ _nasm=auto
# more defaults
_backend=sdl
_ranlib=ranlib
-_install=install
_ar="ar cru"
-_mkdir="mkdir -p"
-_echo=printf
-_cat=cat
-_rm="rm -f"
-_rm_rec="$_rm -r"
-_zip="zip -q"
-_cp=cp
_windres=windres
_win32path="C:/scummvm"
_aos4path="Games:ScummVM_Snapshot"
@@ -1646,15 +1638,7 @@ CXX := $CXX
CXXFLAGS := $CXXFLAGS
LIBS += $LIBS
RANLIB := $_ranlib
-INSTALL := $_install
AR := $_ar
-MKDIR := $_mkdir
-ECHO := $_echo
-CAT := $_cat
-RM := $_rm
-RM_REC := $_rm_rec
-ZIP := $_zip
-CP := $_cp
WINDRES := $_windres
WIN32PATH=$_win32path
AOS4PATH=$_aos4path
@@ -1685,8 +1669,6 @@ SAVED_LDFLAGS := $SAVED_LDFLAGS
SAVED_CXX := $SAVED_CXX
SAVED_CXXFLAGS := $SAVED_CXXFLAGS
SAVED_CPPFLAGS := $SAVED_CPPFLAGS
-
-CONFIG_MK_IS_PRESENT := 1
EOF
#
diff --git a/tools/module.mk b/tools/module.mk
index 365118a0ea..cb91912b7f 100644
--- a/tools/module.mk
+++ b/tools/module.mk
@@ -75,4 +75,4 @@ md5scumm: tools/md5table$(EXEEXT)
# $(srcdir)/tools/credits.pl --cpp > $@
-.PHONY: clean-tools tools credits md5scumm md5simon
+.PHONY: clean-tools tools credits md5scumm