Modules.gmk revision 1131:70e378877c6a
11590Srgrimes#
21590Srgrimes# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
31590Srgrimes# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41590Srgrimes#
51590Srgrimes# This code is free software; you can redistribute it and/or modify it
61590Srgrimes# under the terms of the GNU General Public License version 2 only, as
71590Srgrimes# published by the Free Software Foundation.  Oracle designates this
81590Srgrimes# particular file as subject to the "Classpath" exception as provided
91590Srgrimes# by Oracle in the LICENSE file that accompanied this code.
101590Srgrimes#
111590Srgrimes# This code is distributed in the hope that it will be useful, but WITHOUT
121590Srgrimes# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131590Srgrimes# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141590Srgrimes# version 2 for more details (a copy is included in the LICENSE file that
151590Srgrimes# accompanied this code).
161590Srgrimes#
171590Srgrimes# You should have received a copy of the GNU General Public License version
181590Srgrimes# 2 along with this work; if not, write to the Free Software Foundation,
191590Srgrimes# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201590Srgrimes#
211590Srgrimes# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221590Srgrimes# or visit www.oracle.com if you need additional information or have any
231590Srgrimes# questions.
241590Srgrimes#
251590Srgrimes
261590Srgrimesifndef _MODULES_GMK
271590Srgrimes_MODULES_GMK := 1
281590Srgrimes
291590Srgrimes################################################################################
301590Srgrimes# Module list macros
3154162Scharnier
3254162ScharnierALL_TOP_SRC_DIRS := \
3354162Scharnier    $(JDK_TOPDIR)/src \
341590Srgrimes    $(LANGTOOLS_TOPDIR)/src \
35112212Srobert    $(CORBA_TOPDIR)/src \
3699112Sobrien    $(JAXP_TOPDIR)/src \
3799112Sobrien    $(JAXWS_TOPDIR)/src \
381590Srgrimes    $(NASHORN_TOPDIR)/src \
391590Srgrimes    #
40112212Srobert
411590Srgrimes# There are snmp classes in the open but they are not included in OpenJDK
42200462SdelphijJAVA_MODULES_FILTER := jdk.snmp
431590Srgrimes
4487212Smarkm# Find all modules with java sources by looking in the source dirs
4587212Smarkmdefine FindJavaModules
461590Srgrimes  $(filter-out $(JAVA_MODULES_FILTER), $(sort $(notdir \
47112212Srobert      $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \
481590Srgrimes      $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \
4987212Smarkm          $(patsubst %,%/*/$(OPENJDK_TARGET_OS_API_DIR)/classes/*, $(ALL_TOP_SRC_DIRS)) \
5087212Smarkm          $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))))
51112212Srobertendef
5287212Smarkm
531590SrgrimesMODULES_LIST_FILE := $(SRC_ROOT)/make/common/modules.list
541590SrgrimesMODULE_DEPS_MAKEFILE := $(OUTPUT_ROOT)/module-deps.gmk
551590Srgrimes
561590Srgrimes$(MODULE_DEPS_MAKEFILE): $(MODULES_LIST_FILE)
571590Srgrimes	$(CAT) $^ | $(SED) -e 's/^\([^:]*\):/DEPS_\1 :=/g' > $@
581590Srgrimes
5987212Smarkm-include $(MODULE_DEPS_MAKEFILE)
601590Srgrimes
611590Srgrimes# Param 1: Module to find deps for
6287212Smarkmdefine FindDepsForModule
6387212Smarkm  $(DEPS_$(strip $1))
6487212Smarkmendef
651590Srgrimes
661590Srgrimes# Find all modules with source for the target platform.
67112212Srobertdefine FindAllModules
681590Srgrimes  $(sort $(filter-out closed demo sample, $(notdir $(patsubst %/,%, $(dir \
6987212Smarkm      $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \
701590Srgrimes      $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \
71112212Srobert      $(patsubst %, %/*/$(OPENJDK_TARGET_OS_API_DIR), $(ALL_TOP_SRC_DIRS))))))))
721590Srgrimesendef
73
74################################################################################
75
76# Hook to include the corresponding custom file, if present.
77$(eval $(call IncludeCustomExtension, , common/Modules.gmk))
78
79endif # _MODULES_GMK
80