################################################################################
# Filename: ./src/base/java/Makefile
# 
# The contents of this file are subject to the Qlusters Public License
# Version 1.1 (the License); you may not use this file except in compliance
# with the License.
# You may obtain a copy of the License at
# http://www.openqrm.org/content/view/33/69/.
# 
# Software distributed under the License is distributed on an AS IS basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
# the specific language governing rights and limitations under the License.
# 
# The Original Code is openQRM.
# 
# The Initial Developer of the Original Code is Qlusters Corporation. Portions
# created by Qlusters Corporation are Copyright (C) 2003-2005. All Rights
# Reserved.
# 
# Contributor(s):
# 
# Description:
# 
# Comments:
################################################################################
#
# java directory Makefile
#
#rel2abs = $(1)
INC_NAME := ../Makefile.inc
include $(INC_NAME)

export QRM_CACHE_DIR := $(QRM_CACHE_DIR)/java
export QRM_ROOT_DIR := $(QRM_ROOT_DIR)/java

export DEPLOY_DIR := $(call get_path_value,DEPLOY_DIR,$(DEPLOY_ROOT_DIR)/qrm/java)
export TOMCAT_DIR := $(call get_path_value,TOMCAT_DIR,$(DEPLOY_ROOT_DIR)/qrm/usr/tomcat)

#MAVEN_OPTS := 
all:	
	@echo "Filling repository. Actual compilation will be done during 'install'"
	./make.sh $(MAKECMDGOALS) -c $(QRM_CACHE_DIR) -t $(QRM_ROOT_DIR) -d $(DEPLOY_DIR) -w $(TOMCAT_DIR) -- $(MAVEN_OPTS)

install: check
	./make.sh $(MAKECMDGOALS) -c $(QRM_CACHE_DIR) -t $(QRM_ROOT_DIR) -d $(DEPLOY_DIR) -w $(TOMCAT_DIR) -- $(MAVEN_OPTS)

clean:	check
	@echo "cleaning up java directory"
	/bin/rm -rf $(DEPLOY_DIR) $(QRM_ROOT_DIR)

realclean: clean
	@echo "running realclean for the java directory"
	/bin/rm -rf $(QRM_CACHE_DIR)

check:
	@if [ -z $(QRM_CACHE_DIR) ]; then echo "ERROR: QRM_CACHE_DIR not set!"; exit 1; fi
	@if [ -z $(QRM_ROOT_DIR) ]; then echo "ERROR: QRM_ROOT_DIR not set!"; exit 1; fi
	@if [ -z $(DEPLOY_ROOT_DIR) ]; then echo "ERROR: DEPLOY_ROOT_DIR not set!"; exit 1; fi
	@if [ -z $(DEPLOY_DIR) ]; then echo "ERROR: DEPLOY_ROOT_DIR not set!"; exit 1; fi



