aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 8916b44038..926d73ca92 100644
--- a/Makefile
+++ b/Makefile
@@ -15,19 +15,22 @@ CP := cp
# Default compilation parameters. Normally don't edit these #
#######################################################################
+srcdir ?= .
+builddir ?= .
+
DEFINES := -DHAVE_CONFIG_H
LDFLAGS :=
-INCLUDES := -I. -Icommon
+INCLUDES := -I$(srcdir) -I$(srcdir)/common
LIBS :=
OBJS :=
MODULES :=
MODULE_DIRS :=
-EXECUTABLE := scummvm$(EXEEXT)
+EXECUTABLE := scummvm$(EXEEXT)
# Load the make rules generated by configure
-include config.mak
+include $(builddir)/config.mak
# Uncomment this for stricter compile time code verification
# CXXFLAGS+= -Werror
@@ -44,10 +47,10 @@ CXXFLAGS+= -Wno-reorder -Wwrite-strings -fcheck-new -Wctor-dtor-privacy
# Misc stuff - you should normally never have to edit this #
#######################################################################
-include Makefile.common
+include $(srcdir)/Makefile.common
# check if configure has been run or has been changed since last run
-config.mak: configure
+$(builddir)/config.mak: $(srcdir)/configure
@echo "You need to run ./configure before you can run make"
@echo "Either you haven't run it before or it has changed."
@echo "If you cannot run configure, use 'make -f Makefile.noconf'"