>From 9b0b276c8e46e608bbbaa8aa27cda182b8bc44d0 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 17 May 2014 22:03:20 +0200 Subject: [PATCH 1/2] 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. --- GNUmakefile | 31 ++++++++++--------------------- Makefile.aix | 4 ---- Makefile.android | 5 ----- Makefile.bsd | 7 +------ Makefile.cross-linux-mingw | 7 +------ Makefile.cygwin | 7 +------ Makefile.haiku | 5 ----- Makefile.hurd | 5 ----- Makefile.ios | 7 +------ Makefile.linux | 5 ----- Makefile.macosx | 7 +------ Makefile.mingw | 7 +------ Makefile.mingw-msys | 7 +------ Makefile.solaris | 7 +------ defaults.make | 1 - 15 files changed, 18 insertions(+), 94 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 9714a25..0ab1471 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 7766734..bf27df3 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 8276d3e..fdcd4fe 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 9006d86..365ffb6 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 589d8ca..5bf80f9 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 695ed1a..a55d80f 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 3836fb5..ed49cb6 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 cbb0176..e0cd593 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 dff7875..e2819ea 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 ee8161e..010b560 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 d013490..0fd4185 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 aa7ab00..a72d467 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 50d3ee4..2af2dc1 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 9ce111e..7c6c87c 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 6367b78..9c82635 100644 --- a/defaults.make +++ b/defaults.make @@ -34,7 +34,6 @@ CROSS_CHICKEN ?= 0 # directories SEP ?= / -SRCDIR ?= .$(SEP) DESTDIR ?= PREFIX ?= /usr/local -- 1.7.10.4