jdk/make/common/Subdirs.gmk
author rfield
Tue, 20 Nov 2012 09:58:55 -0800
changeset 14554 4e29b285c723
parent 9035 1255eb81cc2f
permissions -rw-r--r--
8003639: convert lambda testng tests to jtreg and add them Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8583
diff changeset
     1
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
     2
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
     3
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
     4
# This code is free software; you can redistribute it and/or modify it
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
     5
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
     6
# published by the Free Software Foundation.  Oracle designates this
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
     7
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
     8
# by Oracle in the LICENSE file that accompanied this code.
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
     9
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    14
# accompanied this code).
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    15
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    19
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
5551
327690766109 6956202: Fix a few missed rebranding issues, please contact lines etc.
ohair
parents: 5506
diff changeset
    22
# questions.
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    23
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    24
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    25
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    26
# Generic makefile for building subdirectories.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    27
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    28
# SUBDIRS variables to specify the subdirectories to build recursively.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    29
# Makefile has to include Subdirs.gmk AFTER all SUBDIRS variables are
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    30
# defined.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    31
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    32
# This file does not contain any rule.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    33
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    34
# WARNING: This file is shared with other workspaces.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    35
#          So when it includes other files, it must use JDK_TOPDIR.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    36
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    37
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    38
# SUBDIRS          subdirs for the base module always get built
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    39
# SUBDIRS_<group>  subdirs for the named group
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    40
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    41
# By default, subdirs specified in the SUBDIRS and all SUBDIRS_* 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    42
# variables will be built.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    43
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    44
# Variables of the currently supported groups are:
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    45
#  SUBDIRS_desktop    
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    46
#  SUBDIRS_management
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    47
#  SUBDIRS_enterprise
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    48
#  SUBDIRS_misc
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    49
#  SUBDIRS_tools
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    50
# 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    51
# Change to the above list also need to update 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    52
# make/common/shared/Sanity.gmk.  NOTE: this list is subject
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
    53
# to change.
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    54
# 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    55
# Eventually we want to restructure the make directory
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    56
# according to these grouping (e.g. make/desktop/...) and
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    57
# the SUBDIRS_<group> variables would not be needed.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    58
# 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    59
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    60
# Iterate the subdirectories specified in $1.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    61
# - cd into each subdir and make them
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    62
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    63
# Given a SUBDIRS* list (first argument), cd into them and make them
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    64
#   SUBDIRS_MAKEFLAGS      Make settings for a subdir make
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    65
#   SUBDIRS_MAKEFLAGS-$@   Make settings specific to this target
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    66
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    67
define subdirs-group-loop
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    68
@$(ECHO) "Begin Processing SUBDIRS: $($1)"
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    69
@for i in DUMMY $($1) ; do \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    70
  if [ "$$i" != "DUMMY" ] ; then \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    71
    $(MAKE) -C $$i $@ $(SUBDIRS_MAKEFLAGS) $(SUBDIRS_MAKEFLAGS-$@) \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    72
            FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    73
  fi ; \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    74
done
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    75
@$(ECHO) "Done Processing SUBDIRS: $($1)"
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    76
endef
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    77
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    78
# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    79
#   OTHERSUBDIRS_MAKEFLAGS      Make settings for a subdir make
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    80
define OTHERSUBDIRS-loop
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    81
@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    82
@for i in DUMMY $(OTHERSUBDIRS) ; do \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    83
  if [ "$$i" != "DUMMY" ] ; then \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    84
    $(MAKE) -C $$i $@ $(OTHERSUBDIRS_MAKEFLAGS) \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    85
            FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    86
  fi ; \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    87
done
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    88
@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    89
endef
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    90
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    91
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    92
# Iterate the list specified in SUBDIRS_<group> only if
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
    93
# SUBDIRS_<group> is set.
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    94
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    95
ifdef SUBDIRS_desktop 
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
    96
  define subdirs-desktop-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
    97
      @$(call subdirs-group-loop,SUBDIRS_desktop)
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
    98
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
    99
else   
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   100
  define subdirs-desktop-loop
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   101
  endef
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   102
endif   # SUBDIRS_desktop 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   103
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   104
ifdef SUBDIRS_enterprise 
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   105
  define subdirs-enterprise-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   106
      @$(call subdirs-group-loop,SUBDIRS_enterprise)
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   107
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   108
else   
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   109
define subdirs-enterprise-loop
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   110
endef
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   111
endif   # SUBDIRS_enterprise 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   112
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   113
ifdef SUBDIRS_management 
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   114
  define subdirs-management-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   115
      @$(call subdirs-group-loop,SUBDIRS_management)
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   116
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   117
else   
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   118
  define subdirs-management-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   119
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   120
endif   # SUBDIRS_management 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   121
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   122
ifdef SUBDIRS_misc 
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   123
  define subdirs-misc-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   124
      @$(call subdirs-group-loop,SUBDIRS_misc)
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   125
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   126
else   
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   127
  define subdirs-misc-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   128
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   129
endif   # SUBDIRS_misc 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   130
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   131
ifdef SUBDIRS_tools 
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   132
  define subdirs-tools-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   133
      @$(call subdirs-group-loop,SUBDIRS_tools)
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   134
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   135
else   
8583
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   136
  define subdirs-tools-loop
15dea0fdc2ea 7025631: Remove the modules build support from jdk 7
mchung
parents: 5551
diff changeset
   137
  endef
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   138
endif   # SUBDIRS_tools 
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   139
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   140
#
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   141
# If BUILD_MODULES is not set or it's set to "all",
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   142
# iterate all groups.
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   143
SUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   144
	      $(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools)
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   145
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   146
define SUBDIRS-loop
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   147
  @$(call subdirs-group-loop,SUBDIRS_all)
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents:
diff changeset
   148
endef