Makefile revision 911:9937f406e27e
155682Smarkm#
2102644Snectar# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
355682Smarkm# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
455682Smarkm#
555682Smarkm# This code is free software; you can redistribute it and/or modify it
655682Smarkm# under the terms of the GNU General Public License version 2 only, as
755682Smarkm# published by the Free Software Foundation.  Oracle designates this
855682Smarkm# particular file as subject to the "Classpath" exception as provided
955682Smarkm# by Oracle in the LICENSE file that accompanied this code.
1055682Smarkm#
1155682Smarkm# This code is distributed in the hope that it will be useful, but WITHOUT
1255682Smarkm# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1355682Smarkm# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1455682Smarkm# version 2 for more details (a copy is included in the LICENSE file that
1555682Smarkm# accompanied this code).
1655682Smarkm#
1755682Smarkm# You should have received a copy of the GNU General Public License version
1855682Smarkm# 2 along with this work; if not, write to the Free Software Foundation,
1955682Smarkm# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2055682Smarkm#
2155682Smarkm# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2255682Smarkm# or visit www.oracle.com if you need additional information or have any
2355682Smarkm# questions.
2455682Smarkm#
2555682Smarkm
2655682Smarkm#
2755682Smarkm# Makefile to run tests from multiple sibling directories
2855682Smarkm#
2955682Smarkm
3055682Smarkm# Root of the forest that was built
3155682SmarkmTOPDIR=..
3255682Smarkm
3355682Smarkm# This makefile depends on the availability of sibling directories.
3455682SmarkmLANGTOOLS_DIR=$(TOPDIR)/langtools
3555682SmarkmJDK_DIR=$(TOPDIR)/jdk
3655682Smarkm
3755682Smarkm# Macro to run a test target in a subdir
3855682Smarkmdefine SUBDIR_TEST # subdirectory target
3955682Smarkmif [ -d $1 ] ; then \
4055682Smarkm  if [ -r $1/test/Makefile ] ; then \
4155682Smarkm    echo "$(MAKE) -k -C $1/test $2" ; \
4255682Smarkm    $(MAKE) -k -C $1/test $2 ; \
4355682Smarkm  else \
4455682Smarkm    echo "ERROR: File does not exist: $1/test/Makefile"; \
4555682Smarkm    exit 1; \
4690926Snectar  fi; \
4755682Smarkmelse \
48107207Snectar  echo "WARNING: No testing done, directory does not exist: $1"; \
4990926Snectarfi
50103423Snectarendef
51103423Snectar
5255682Smarkm# Default test target (core)
5355682Smarkmdefault: jdk_core langtools_jtreg
5455682Smarkm
5555682Smarkm# All testing
5655682Smarkmall: jdk_all langtools_all
5755682Smarkm
5855682Smarkm# Test targets
5955682Smarkmlangtools_% :
6055682Smarkm	@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
6155682Smarkm
6272445Sassarjdk_% core_%s svc_%:
6355682Smarkm	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@)
6455682Smarkm
6555682Smarkm################################################################
6655682Smarkm
6772445Sassar# Phony targets (e.g. these are not filenames)
6872445Sassar.PHONY: all clean
6955682Smarkm
7072445Sassar################################################################
7155682Smarkm