3909N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
2157N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2157N/A#
2157N/A# This code is free software; you can redistribute it and/or modify it
2157N/A# under the terms of the GNU General Public License version 2 only, as
2362N/A# published by the Free Software Foundation. Oracle designates this
2157N/A# particular file as subject to the "Classpath" exception as provided
2362N/A# by Oracle in the LICENSE file that accompanied this code.
2157N/A#
2157N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2157N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2157N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2157N/A# version 2 for more details (a copy is included in the LICENSE file that
2157N/A# accompanied this code).
2157N/A#
2157N/A# You should have received a copy of the GNU General Public License version
2157N/A# 2 along with this work; if not, write to the Free Software Foundation,
2157N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2157N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2365N/A# questions.
2157N/A#
2157N/A
2157N/A#
2157N/A# Generic makefile for building subdirectories.
2157N/A#
2157N/A# SUBDIRS variables to specify the subdirectories to build recursively.
2157N/A# Makefile has to include Subdirs.gmk AFTER all SUBDIRS variables are
2157N/A# defined.
2157N/A#
2157N/A# This file does not contain any rule.
2157N/A#
2157N/A# WARNING: This file is shared with other workspaces.
2157N/A# So when it includes other files, it must use JDK_TOPDIR.
2157N/A
2157N/A#
2157N/A# SUBDIRS subdirs for the base module always get built
2157N/A# SUBDIRS_<group> subdirs for the named group
2157N/A#
2157N/A# By default, subdirs specified in the SUBDIRS and all SUBDIRS_*
2157N/A# variables will be built.
2157N/A#
2157N/A# Variables of the currently supported groups are:
2157N/A# SUBDIRS_desktop
2157N/A# SUBDIRS_management
2157N/A# SUBDIRS_enterprise
2157N/A# SUBDIRS_misc
2157N/A# SUBDIRS_tools
2157N/A#
2157N/A# Change to the above list also need to update
2157N/A# make/common/shared/Sanity.gmk. NOTE: this list is subject
3686N/A# to change.
2157N/A#
2157N/A# Eventually we want to restructure the make directory
2157N/A# according to these grouping (e.g. make/desktop/...) and
2157N/A# the SUBDIRS_<group> variables would not be needed.
2157N/A#
2157N/A
2157N/A# Iterate the subdirectories specified in $1.
2157N/A# - cd into each subdir and make them
2157N/A
2157N/A# Given a SUBDIRS* list (first argument), cd into them and make them
2157N/A# SUBDIRS_MAKEFLAGS Make settings for a subdir make
2157N/A# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target
2157N/A#
2157N/Adefine subdirs-group-loop
2157N/A@$(ECHO) "Begin Processing SUBDIRS: $($1)"
2157N/A@for i in DUMMY $($1) ; do \
2157N/A if [ "$$i" != "DUMMY" ] ; then \
2157N/A $(MAKE) -C $$i $@ $(SUBDIRS_MAKEFLAGS) $(SUBDIRS_MAKEFLAGS-$@) \
2157N/A FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
2157N/A fi ; \
2157N/Adone
2157N/A@$(ECHO) "Done Processing SUBDIRS: $($1)"
2157N/Aendef
2157N/A
2157N/A# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
2157N/A# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make
2157N/Adefine OTHERSUBDIRS-loop
2157N/A@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
2157N/A@for i in DUMMY $(OTHERSUBDIRS) ; do \
2157N/A if [ "$$i" != "DUMMY" ] ; then \
2157N/A $(MAKE) -C $$i $@ $(OTHERSUBDIRS_MAKEFLAGS) \
2157N/A FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
2157N/A fi ; \
2157N/Adone
2157N/A@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
2157N/Aendef
2157N/A
2157N/A#
2157N/A# Iterate the list specified in SUBDIRS_<group> only if
3686N/A# SUBDIRS_<group> is set.
2157N/A#
2157N/Aifdef SUBDIRS_desktop
3686N/A define subdirs-desktop-loop
3686N/A @$(call subdirs-group-loop,SUBDIRS_desktop)
3686N/A endef
2157N/Aelse
2157N/A define subdirs-desktop-loop
2157N/A endef
2157N/Aendif # SUBDIRS_desktop
2157N/A
2157N/Aifdef SUBDIRS_enterprise
3686N/A define subdirs-enterprise-loop
3686N/A @$(call subdirs-group-loop,SUBDIRS_enterprise)
3686N/A endef
2157N/Aelse
2157N/Adefine subdirs-enterprise-loop
2157N/Aendef
2157N/Aendif # SUBDIRS_enterprise
2157N/A
2157N/Aifdef SUBDIRS_management
3686N/A define subdirs-management-loop
3686N/A @$(call subdirs-group-loop,SUBDIRS_management)
3686N/A endef
2157N/Aelse
3686N/A define subdirs-management-loop
3686N/A endef
2157N/Aendif # SUBDIRS_management
2157N/A
2157N/Aifdef SUBDIRS_misc
3686N/A define subdirs-misc-loop
3686N/A @$(call subdirs-group-loop,SUBDIRS_misc)
3686N/A endef
2157N/Aelse
3686N/A define subdirs-misc-loop
3686N/A endef
2157N/Aendif # SUBDIRS_misc
2157N/A
2157N/Aifdef SUBDIRS_tools
3686N/A define subdirs-tools-loop
3686N/A @$(call subdirs-group-loop,SUBDIRS_tools)
3686N/A endef
2157N/Aelse
3686N/A define subdirs-tools-loop
3686N/A endef
2157N/Aendif # SUBDIRS_tools
2157N/A
2157N/A#
2157N/A# If BUILD_MODULES is not set or it's set to "all",
2157N/A# iterate all groups.
2157N/ASUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \
2157N/A $(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools)
2157N/A
2157N/Adefine SUBDIRS-loop
2157N/A @$(call subdirs-group-loop,SUBDIRS_all)
2157N/Aendef