#! /bin/bash
#*******************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: vltMakeJavaDependencies,v 1.2 2003/06/03 17:16:34 dfugate Exp $" 
#
# who       when       what
# --------  --------   ----------------------------------------------
# dfugate   2003-06-03 switched to bash
# mzampare  2002-02-18 created 
# mzampare  2002-03-12 javac on the same line of export CLASSPATH


#************************************************************************
#   NAME
#   vltMakeJavaDependencies - create the makefile to build an executable
# 
#   SYNOPSIS
#
#   vltMakeJavaDependencies [/vw] <jarfile> 
# 
#   DESCRIPTION
#   Utility used by vltMakefile to create the makefile to build a Java 
#   Jarfile, based upon the java compiler and the jar archival tool.
#   It is not intended to be used as a standalone command.
#
#
#   (1) see also GNU Make 3.64, 4.3.5 pag 37
#
#
#   The .djar itself depends to Makefile.
#
#   The rules is written to standard output.
#
#   <jarfile>     The name of the destination jarfile
#                 (Without directory)
#
#
#   FILES
#   $VLTROOT/include/vltMakefile   
#
#   ENVIRONMENT
#
#   RETURN VALUES
#
#   SEE ALSO 
#   vltMakefile, Makefile, (GNU) make
#
#   GNU make - Edition 0.41, for make Version 3.64 Beta, April 93
#   VLT Software - Programming Standard - 1.0 10/03/93
#
#   BUGS    
#
#----------------------------------------------------------------------

if [ "$1" = "/vw" ]
then
    MAKE_VXWORKS="yes"
    shift
else
    MAKE_VXWORKS="no"
fi

jarName=$1

echo "# Dependency file for program: ${jarName}"
echo "# Created automatically by vltMakeJavaDependencies -  `date '+%d.%m.%y %T'`"
echo "# DO NOT EDIT THIS FILE"

#

#
# define the dependency file dependent to the Makefile
echo "../object/${jarName}.djar: Makefile"
echo ""
echo "../lib/${jarName}.jar: *.java"
echo "	@echo \"== Making ${jarName}.jar\""
echo "	\$(AT)CLASSPATH=`vltMakeJavaClasspath` ; export CLASSPATH ; javac -d ../object \$?"
echo "	\$(AT)(cd ../object; jar cf ../lib/${jarName}.jar \`find . -name \*.class\`)"
# ___oOo___
