#! /bin/sh
#*******************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: vltMakeIdlDependencies,v 1.2 2003/08/20 15:39:20 mzampare Exp $" 
#
# who       when      what
# --------  --------  ----------------------------------------------
# psivera   25/07/00  created
# psivera   01/03/09  removed ../src in order to make cpp files in test dir also
# mzampare  25/02/02  support for fake file to do python and Java idl compilation
# mzampare  28/02/02  *S_T.cpp (generated from IDL) now under ../include


#************************************************************************
#   NAME
#   vltMakeIdlDependencies - create the makefile to build an executable
# 
#   SYNOPSIS
#
#   vltMakeIdlDependencies [/vw] <idlName> 
# 
#   DESCRIPTION
#   Utility used by vltMakefile to create the makefile to build an executable.
#   It is not intended to be used as a standalone command.
#
#   An executable depends on the objects and the libraries(1) that 
#   it uses, so the final target rule is:
#
#   ../bin/<idlName>: ... ../object/<obj-i>.o ... -l<lib-i> ...
#   <TAB>   $(CC) $(LDFLAGS) $(ldFlags) [-r] \
#                   ...objects...  ...libraries...  -o ../bin/<idlName>
#
#                                       [-r] is used with VxWorks
#
#   (1) see also GNU Make 3.64, 4.3.5 pag 37
#
#
#   The .didl itself depends to Makefile.
#
#   The rules is written to standard output.
#
#   <idlName>     The name of the  IDL file
#                 (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

idlName=$1

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

#
# define the dependency file dependent to the Makefile
echo "../object/${idlName}.didl: Makefile"
echo ""

#
# define PHONY the target, so make does not try to make the target
# when no object are specified. (due to the fact that the same list of objects is
# used to build the list of exe both to be produced and to be installed).
echo ".PHONY: ${idlName} "

echo "${idlName}: ../object/${idlName}C.cpp ../object/${idlName}C.h ../object/${idlName}C.i ../object/${idlName}S.cpp ../object/${idlName}S.h ../object/${idlName}S.i ../object/${idlName}S_T.cpp ../object/${idlName}S_T.h ../object/${idlName}S_T.i ../object/.${idlName}.fake"

# ___oOo___
