#
# Makefile,v 1.5 2002/06/19 01:55:08 dsg Exp
# OpenMMS Makefile for directory: src/mms/entry
#
# 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

# Category Flags are not always defined for all models,
# therefore we must compile different source files since some of these
# use model specific Flag definitions.
# This is needed since there is no "conditional compilation"
# directives in Java, i.e. there is no equivalent for the
# "C" language #ifdef/#endif compiler directive.
# Two model specific directories are defined here, the default
# version ("test") and full version ("std"). Others can be added as
# required, but all directories must contain the same set of class names.

MODEL_SPECIFIC_DIR := test
ifeq ($(BUILD_TARGET), Std)
MODEL_SPECIFIC_DIR := std
endif
ifeq ($(BUILD_TARGET), Dev)
MODEL_SPECIFIC_DIR := std
endif

Package        = $(OPENMMS_PACKAGE_SUBDIR)/entry
Sources        =
Dependencies   = $(CIFPARSE_CLASSES) $(UTIL_CLASSES) $(IDL_CLASSES)
Build_Subdirs  =

# Model_Sources is keep as a seperate variable since
# Sources is used to generate the INSTALL_CLASSES variable and the model
# directory-name will cause unnecessary compiles.
Model_Sources  = $(wildcard $(MODEL_SPECIFIC_DIR)/*.java)
Entry_Sources  = $(wildcard *.java)

ENTRY_BUILD_CLASSES = $(Entry_Sources:.java=.class)
ENTRY_INSTALL_CLASSES = $(foreach c, $(ENTRY_BUILD_CLASSES), \
	$(INSTALL_DIR)/$(c))

$(BUILD_TARGET):: $(ENTRY_INSTALL_CLASSES)

# Special rule for compiling entry classes
# This works since all class files are compiled together so the
# "Model.class" files do not need to be part of ENTRY_INSTALL_CLASSES
$(ENTRY_INSTALL_CLASSES): $(Entry_Sources) $(Model_Sources) $(Dependencies)
	$(JAVAC) -d $(CLASS_DIR) $(Entry_Sources) $(Model_Sources)

init::

include $(TOP_DIR)/config/rules.gmake

fin::

