Makefile revision 2251:e51f798914a8
12421Sdlsmith#
23861Svromero# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
32421Sdlsmith# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
42421Sdlsmith#
52421Sdlsmith# This code is free software; you can redistribute it and/or modify it
62421Sdlsmith# under the terms of the GNU General Public License version 2 only, as
72421Sdlsmith# published by the Free Software Foundation.  Oracle designates this
82421Sdlsmith# particular file as subject to the "Classpath" exception as provided
92421Sdlsmith# by Oracle in the LICENSE file that accompanied this code.
102421Sdlsmith#
112421Sdlsmith# This code is distributed in the hope that it will be useful, but WITHOUT
122421Sdlsmith# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
132421Sdlsmith# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
142421Sdlsmith# version 2 for more details (a copy is included in the LICENSE file that
152421Sdlsmith# accompanied this code).
162421Sdlsmith#
172421Sdlsmith# You should have received a copy of the GNU General Public License version
182421Sdlsmith# 2 along with this work; if not, write to the Free Software Foundation,
192421Sdlsmith# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
202421Sdlsmith#
212421Sdlsmith# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
222421Sdlsmith# or visit www.oracle.com if you need additional information or have any
232421Sdlsmith# questions.
242421Sdlsmith#
252421Sdlsmith
262421Sdlsmith###
272421Sdlsmith### This file is just a very small wrapper needed to run the real make/Init.gmk.
282421Sdlsmith### It also performs some sanity checks on make.
293861Svromero###
303861Svromero
313861Svromero# The shell code below will be executed on /usr/bin/make on Solaris, but not in GNU Make.
323861Svromero# /usr/bin/make lacks basically every other flow control mechanism.
333861Svromero.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU Make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
342421Sdlsmith
352421Sdlsmith# The .FEATURES variable is likely to be unique for GNU Make.
362421Sdlsmithifeq ($(.FEATURES), )
372421Sdlsmith  $(info Error: '$(MAKE)' does not seem to be GNU Make, which is a requirement.)
383861Svromero  $(info Check your path, or upgrade to GNU Make 3.81 or newer.)
393861Svromero  $(error Cannot continue)
403861Svromeroendif
412421Sdlsmith
422421Sdlsmith# Assume we have GNU Make, but check version.
432421Sdlsmithifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
442421Sdlsmith  $(info Error: This version of GNU Make is too low ($(MAKE_VERSION)).)
452421Sdlsmith  $(info Check your path, or upgrade to GNU Make 3.81 or newer.)
462421Sdlsmith  $(error Cannot continue)
472421Sdlsmithendif
48
49# In Cygwin, the MAKE variable gets prepended with the current directory if the
50# make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe).
51ifneq ($(findstring :, $(MAKE)), )
52  MAKE := $(patsubst $(CURDIR)%, %, $(patsubst $(CURDIR)/%, %, $(MAKE)))
53endif
54
55# Locate this Makefile
56ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
57  makefile_path := $(CURDIR)/$(strip $(lastword $(MAKEFILE_LIST)))
58else
59  makefile_path := $(lastword $(MAKEFILE_LIST))
60endif
61topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
62
63# ... and then we can include the real makefile
64include $(topdir)/make/Init.gmk
65