From aa947c9474ad83aa9315bc585d1f0b79060fee61 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:33 +0100 Subject: BUILD: Split configure.engines down to a single file per engine. This is the first part of allowing engines to be added dynamically. They are placed into a folder in engines/ which must contain a file named "configure.engine" to add the engine, which is pulled into the top level configure script automatically. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 09c38b2598..2ff67eef2a 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,8 @@ EXECUTABLE := $(EXEPRE)scummvm$(EXEEXT) include $(srcdir)/Makefile.common # check if configure has been run or has been changed since last run -config.h config.mk: $(srcdir)/configure $(srcdir)/engines/configure.engines +ENGINE_SUBDIRS_CONFIGURE := $(wildcard $(srcdir)/engines/*/configure.engine) +config.h config.mk: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE) ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk" @echo "Running $(srcdir)/configure with the last specified parameters" @sleep 2 -- cgit v1.2.3 From 00c27a28f91cc2bbf512461e69c86be998462728 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Split engines/plugins_table header down to a file per engine. This is the third and final commit enabling fully pluggable engines. Now providing an engine folder contains a configure.engine, engine.mk and engine-plugin.h file, it will be picked up automatically by the configure script. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2ff67eef2a..2f17822051 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ include $(srcdir)/Makefile.common # check if configure has been run or has been changed since last run ENGINE_SUBDIRS_CONFIGURE := $(wildcard $(srcdir)/engines/*/configure.engine) -config.h config.mk: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE) +config.h config.mk engines/plugins_table.h: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE) ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk" @echo "Running $(srcdir)/configure with the last specified parameters" @sleep 2 -- cgit v1.2.3 From ef85456859e466adc8913041e4f31809485c45ab Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Remove need for engine.mk in each engine directory. Each engine now only has to provide a single configure.engine file adding the engine into the configure script, which then produces the required other files automatically. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2f17822051..45f50f99d7 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ include $(srcdir)/Makefile.common # check if configure has been run or has been changed since last run ENGINE_SUBDIRS_CONFIGURE := $(wildcard $(srcdir)/engines/*/configure.engine) -config.h config.mk engines/plugins_table.h: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE) +config.h config.mk engines/plugins_table.h engines/engines.mk: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE) ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk" @echo "Running $(srcdir)/configure with the last specified parameters" @sleep 2 -- cgit v1.2.3 From 9c025523587410371d5b2e9e4d9643e02f33b5e2 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Partial solution for parallel make issue. This is due to the multiple outputs produced by the configure rule, which cause multiple invocations of configure when make is run in parallel. Various solutions are detailed in the Multiple-Outputs section of the GNU automake manual which apply generally to makefiles. This solution is a simpler one, but should solve the problem, though it can fail on "mutilated" trees ie. where some of the configure outputs are present, but not all... but this situation is not common, tends to be due to an error in configure and should be recoverable by a "make clean && ./configure" call. --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 45f50f99d7..88b60ca73f 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ include $(srcdir)/Makefile.common # check if configure has been run or has been changed since last run ENGINE_SUBDIRS_CONFIGURE := $(wildcard $(srcdir)/engines/*/configure.engine) -config.h config.mk engines/plugins_table.h engines/engines.mk: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE) +config.h: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE) ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk" @echo "Running $(srcdir)/configure with the last specified parameters" @sleep 2 @@ -95,6 +95,14 @@ else $(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters) endif +config.mk engines/plugins_table.h engines/engines.mk: config.h + @if test -f $@; then \ + touch $@; \ + else \ + rm -f config.h; \ + $(MAKE) config.h; \ + fi + ifneq ($(origin port_mk), undefined) include $(srcdir)/$(port_mk) endif -- cgit v1.2.3