hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk
author dnsimon
Tue, 05 Jan 2016 10:57:15 -1000
changeset 35160 acae4975b367
parent 35148 5cfafc99d791
child 35234 854fc566323e
permissions -rw-r--r--
8146001: Remove support for command line options from JVMCI Reviewed-by: twisti

#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

default: all

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk

GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.vm.ci
SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes

################################################################################
# Compile the annotation processor

$(eval $(call SetupJavaCompilation, BUILD_JVMCI_SERVICE, \
    SETUP := GENERATE_OLDBYTECODE, \
    SRC := $(SRC_DIR)/jdk.vm.ci.service/src \
        $(SRC_DIR)/jdk.vm.ci.service.processor/src, \
    BIN := $(BUILDTOOLS_OUTPUTDIR)/jvmci_service, \
    JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar, \
))

################################################################################

PROC_SRC_SUBDIRS := \
    jdk.vm.ci.hotspot \
    jdk.vm.ci.hotspot.aarch64 \
    jdk.vm.ci.hotspot.amd64 \
    jdk.vm.ci.hotspot.sparc \
    jdk.vm.ci.runtime \
    #

PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))

PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))

ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src)
SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
PROCESSOR_PATH := $(call PathList, \
    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar)

$(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) \
    $(BUILD_JVMCI_SERVICE)
	$(MKDIR) -p $(@D)
	$(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files))
	$(JAVA_SMALL) $(NEW_JAVAC) \
	    -XDignore.symbol.file \
	    -sourcepath $(SOURCEPATH) \
	    -implicit:none \
	    -proc:only \
	    -processorpath $(PROCESSOR_PATH) \
	    -d $(GENSRC_DIR) \
	    -s $(GENSRC_DIR) \
	    @$(@D)/_gensrc_proc_files
	$(TOUCH) $@

TARGETS += $(GENSRC_DIR)/_gensrc_proc_done

################################################################################

$(GENSRC_DIR)/_providers_converted: $(GENSRC_DIR)/_gensrc_proc_done
	$(MKDIR) -p $(GENSRC_DIR)/META-INF/services
	($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \
	    for i in $$($(LS)); do \
	      c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
	      $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c.tmp; \
	    done)
	($(CD) $(GENSRC_DIR)/META-INF/services && \
	    for i in $$($(LS) *.tmp); do \
	      $(MV) $$i $${i%.tmp}; \
	    done)
	$(TOUCH) $@

TARGETS += $(GENSRC_DIR)/_providers_converted

################################################################################

all: $(TARGETS)

.PHONY: default all