~ chicken-core (chicken-5) ae99aa3c4c043ff71c56f0f6a6aadea334e693e1


commit ae99aa3c4c043ff71c56f0f6a6aadea334e693e1
Author:     Peter Bex <peter.bex@xs4all.nl>
AuthorDate: Sat May 17 22:03:20 2014 +0200
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Mon Jun 2 12:20:50 2014 +1200

    Instead of calling Make recursively, include the platform-specific Makefile, but avoid including the config when building boot-chicken.
    
    This allows the user to call any target defined in the platform
    Makefile, making it possible to build *only* library.c, for example.
    
    Signed-off-by: Evan Hanson <evhan@foldling.org>

diff --git a/GNUmakefile b/GNUmakefile
index 9714a25f..0ab14716 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,4 +1,5 @@
-# GNUmakefile - toplevel makefile
+# GNUmakefile - toplevel makefile.  This simply includes the
+# platform-specific makefile or quits when no platform is selected.
 #
 # Copyright (c) 2008-2014, The Chicken Team
 # Copyright (c) 2007, Felix L. Winkelmann
@@ -24,37 +25,25 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
+# If nothing selected, use default config (this should set PLATFORM)
 ifeq ($(CONFIG)$(PLATFORM),)
 CONFIG=config.make
 endif
 
 ifneq ($(CONFIG),)
+# Avoid loading config when building a boot-chicken
+ifneq ($(MAKECMDGOALS),boot-chicken)
 include $(CONFIG)
 endif
+endif
 
 ifndef PLATFORM
 $(info Please select your target platform by running one of the following commands:)
 $(info )
-$(foreach mf, $(wildcard Makefile.*), $(info "$(MAKE)" PLATFORM=$(mf:Makefile.%=%)))
+$(foreach mf, $(wildcard Makefile.*), $(info $(MAKE) PLATFORM=$(mf:Makefile.%=%)))
 $(info )
 $(info For more information, consult the README file.)
 $(error No PLATFORM given.)
-endif
-
-SRCDIR = .
-
-STANDARD_TARGETS \
-	= all clean distclean spotless install uninstall confclean check \
-	  fullcheck libs install-target install-dev bench
-
-.PHONY: $(STANDARD_TARGETS) dist boot-chicken
-
-$(STANDARD_TARGETS):
-	"$(MAKE)" -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) $@
-
-dist:
-	"$(MAKE)" -f $(SRCDIR)/Makefile.$(PLATFORM) CONFIG=$(CONFIG) dist
-
-boot-chicken:
-	"$(MAKE)" -f $(SRCDIR)/Makefile.$(PLATFORM) boot-chicken
+else
+include $(SRCDIR)Makefile.$(PLATFORM)
+endif
\ No newline at end of file
diff --git a/Makefile.aix b/Makefile.aix
index 77667347..bf27df33 100644
--- a/Makefile.aix
+++ b/Makefile.aix
@@ -25,10 +25,6 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
 SRCDIR ?= ./
 
 # platform configuration
diff --git a/Makefile.android b/Makefile.android
index 8276d3e0..fdcd4feb 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -23,11 +23,6 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
 SRCDIR ?= ./
 
 # platform configuration
diff --git a/Makefile.bsd b/Makefile.bsd
index 9006d861..365ffb67 100644
--- a/Makefile.bsd
+++ b/Makefile.bsd
@@ -24,12 +24,7 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
-SRCDIR = ./
+SRCDIR ?= ./
 
 # platform configuration
 
diff --git a/Makefile.cross-linux-mingw b/Makefile.cross-linux-mingw
index 589d8cae..5bf80f90 100644
--- a/Makefile.cross-linux-mingw
+++ b/Makefile.cross-linux-mingw
@@ -24,12 +24,7 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
-SRCDIR = ./
+SRCDIR ?= ./
 
 # platform configuration
 
diff --git a/Makefile.cygwin b/Makefile.cygwin
index 695ed1a5..a55d80f9 100644
--- a/Makefile.cygwin
+++ b/Makefile.cygwin
@@ -24,12 +24,7 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
-SRCDIR = ./
+SRCDIR ?= ./
 
 # platform configuration
 
diff --git a/Makefile.haiku b/Makefile.haiku
index 3836fb59..ed49cb69 100644
--- a/Makefile.haiku
+++ b/Makefile.haiku
@@ -23,11 +23,6 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
 SRCDIR ?= ./
 
 # platform configuration
diff --git a/Makefile.hurd b/Makefile.hurd
index cbb0176d..e0cd5931 100644
--- a/Makefile.hurd
+++ b/Makefile.hurd
@@ -24,11 +24,6 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
 SRCDIR ?= ./
 
 # platform configuration
diff --git a/Makefile.ios b/Makefile.ios
index dff7875d..e2819ea5 100644
--- a/Makefile.ios
+++ b/Makefile.ios
@@ -23,12 +23,7 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
-SRCDIR = ./
+SRCDIR ?= ./
 
 # platform configuration
 
diff --git a/Makefile.linux b/Makefile.linux
index ee8161eb..010b560e 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -24,11 +24,6 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
 SRCDIR ?= ./
 
 # platform configuration
diff --git a/Makefile.macosx b/Makefile.macosx
index d0134905..0fd4185a 100644
--- a/Makefile.macosx
+++ b/Makefile.macosx
@@ -24,12 +24,7 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
-SRCDIR = ./
+SRCDIR ?= ./
 
 # platform configuration
 
diff --git a/Makefile.mingw b/Makefile.mingw
index aa7ab008..a72d4672 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -24,13 +24,8 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
 SEP = $(strip \)
-SRCDIR =.$(SEP)
+SRCDIR ?= .$(SEP)
 
 # platform configuration
 
diff --git a/Makefile.mingw-msys b/Makefile.mingw-msys
index 50d3ee40..2af2dc17 100644
--- a/Makefile.mingw-msys
+++ b/Makefile.mingw-msys
@@ -24,12 +24,7 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
-SRCDIR = ./
+SRCDIR ?= ./
 
 # platform configuration
 
diff --git a/Makefile.solaris b/Makefile.solaris
index 9ce111e9..7c6c87c2 100644
--- a/Makefile.solaris
+++ b/Makefile.solaris
@@ -24,12 +24,7 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-
-ifneq ($(CONFIG),)
-include $(CONFIG)
-endif
-
-SRCDIR = ./
+SRCDIR ?= ./
 
 # platform configuration
 
diff --git a/defaults.make b/defaults.make
index 6367b78b..9c826357 100644
--- a/defaults.make
+++ b/defaults.make
@@ -34,7 +34,6 @@ CROSS_CHICKEN ?= 0
 # directories
 
 SEP ?= /
-SRCDIR ?= .$(SEP)
 DESTDIR ?=
 PREFIX ?= /usr/local
 
Trap