#
# Makefile,v 1.4 2003/05/28 00:33:22 dsg Exp
# OpenMMS Makefile for directory: src/mms/deriv/idl
#
# Copyright 2001 The Regents of the University of California
# All Rights Reserved
#
# OpenMMS was developed by Dr. Douglas S. Greer at the San Diego
# Supercomputer Center, a research unit of the University of California,
# San Diego.  Support for this effort was provided by NSF through the
# Protein Data Bank (Grant DBI-9814284) and the National Partnership for
# Advanced Computational Infrastructure (Grant ACI-9619020)
#
# Permission to use, copy, modify and distribute any part of OpenMMS for
# educational, research and non-profit purposes, without fee, and
# without a written agreement is hereby granted, provided that the above
# copyright notice, this paragraph and the following paragraphs appear
# in all copies.
#
# Those desiring to incorporate this OpenMMS into commercial products or
# use for commercial purposes should contact the Technology Transfer
# Office, University of California, San Diego, 9500 Gilman Drive, La
# Jolla, CA 92093-0910, Ph: (619) 534-5815, FAX: (619) 534-7345.
#
# In no event shall the University of California be liable to any party
# for direct, indirect, special, incidental, or consequential damages,
# including lost profits, arising out of the use of this OpenMMS, even
# if the University of California has been advised of the possibility of
# such damage.
#
# The OpenMMS provided herein is on an "as is" basis, and the
# University of California has no obligation to provide maintenance,
# support, updates, enhancements, or modifications.  The University of
# California makes no representations and extends no warranties of any
# kind, either implied or express, including, but not limited to, the
# implied warranties of merchantability or fitness for a particular
# purpose, or that the use of the OpenMMS will not infringe any patent,
# trademark or other rights.

ifndef TOP_DIR
export TOP_DIR := $(shell (cd ../../../..; pwd))
endif
	
.PHONY: $(TOP_DIR)/config/openmms.gmake
include $(TOP_DIR)/config/openmms.gmake

idl_compiled_subdir := compile

Package        =
Sources        = 
Dependencies   =
Build_Subdirs  = $(idl_compiled_subdir)

idl_files := $(wildcard $(LSR_BASE_NAME)*.idl)

# All IDL derived files will be generated by idl to java compiler
# so just use the Entry.java files to know when to recompile the IDL.
# Cannot use a wildcard expansion since the java file may not exist yet.
base_dir =  $(idl_compiled_subdir)/$(OMG_PACKAGE_SUBDIR)
a_target = $(base_dir)/$(LSR_PRIMARY_NAME)/Entry.java

$(BUILD_TARGET):: $(a_target)

# command line for SUN's idlj compiler
ccmd := $(IDL2JAVA_COMPILER) \
	-td $(idl_compiled_subdir) \
	-pkgPrefix CosPropertyService $(OMG_PACKAGE_NAME) \
	-pkgPrefix TimeBase $(OMG_PACKAGE_NAME) \
	-pkgPrefix BaseIDL $(OMG_PACKAGE_NAME).ccm \
	-pkgPrefix \
	    $(LSR_BASE_NAME)MacromolecularStructure $(OMG_PACKAGE_NAME) \
	-pkgPrefix \
	    $(LSR_BASE_NAME)MmsDeposition $(OMG_PACKAGE_NAME) \
	-pkgPrefix \
	    $(LSR_BASE_NAME)MmsReference $(OMG_PACKAGE_NAME) \
	-pkgPrefix \
	    $(LSR_BASE_NAME)XRayCrystallography $(OMG_PACKAGE_NAME) \
	-pkgPrefix \
	    $(LSR_BASE_NAME)Nmr $(OMG_PACKAGE_NAME) \
	-i $(IMPORT_CORBA_DIR)/idl/Property \
	-i $(IMPORT_CORBA_DIR)/idl/Time \
	-i $(IMPORT_CORBA_DIR)/idl/Component \
	-fclient -fserver 

$(a_target): $(idl_files)
	@for i in $(idl_files) ; \
	do \
	echo $(ccmd) $$i ; \
	$(ccmd) $$i ; \
	done

init::

include $(TOP_DIR)/config/rules.gmake

fin::

clean::
	$(RM) -f *.idl

