#*******************************************************************************
# ALMA - Atacama Large Millimeter Array
# Copyright (c) ESO - European Southern Observatory, 2011
# (in the framework of the ALMA collaboration).
# All rights reserved.
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#*******************************************************************************
#*******************************************************************************
# E.S.O. - ACS project
#
# "@(#) $Id$"
#
# Makefile of ........
#
# who       when      what
# --------  --------  ----------------------------------------------
# gchiozzi 2003-04-04 Changed destination directory (ans source) for template of archive db. 
# hsommer  26/11/02  created
#

#*******************************************************************************
# This Makefile follows VLT Standards (see Makefile(5) for more).
#*******************************************************************************
# REMARKS
#    None
#------------------------------------------------------------------------


DEBUG = on

#
# Scripts (public and local)
# ----------------------------
SCRIPTS         = #archiveListXmldb \
	          #archiveCleanXmldb \
	          #archivePerformanceTest \
	          #archiveMigrateXML \
                  #archiveQuery \
	          #asdmQuery \
		  #archiveInsert \
	          #archiveSanityCheck \
	          #archiveCleanAll \
	          #archiveCleanTest \
	          #archiveListAll \
	          #archiveListTest \
	          #archiveTestUp \
                  #archiveSchemaSort \
		  #projectQuery \
	          #archiveDatabaseStatus

SCRIPTS_L       =

# 
# IDL Files and flags
# 
IDL_FILES =
IDL_TAO_FLAGS =
USER_IDL =


#
# Jarfiles and their directories
#
JARFILES = archive_database
archive_database_DIRS =  alma
archive_database_EXTRAS = # -C ../config dbConfig.properties \
			  # -C ../test/scripts AlmaTestDbCreateTables.sql

INSTALL_FILES = ../lib/xmldb.jar \
		../lib/xmlrpc-1.2.jar \
		../lib/axis.jar \
		../lib/jaxrpc.jar \
		../lib/commons-discovery-0.2.jar \
		../lib/saaj.jar \
		../lib/wsdl4j-1.5.1.jar

ACS_LIB = junit.jar \
	  maci.jar \
	  acsjlog.jar \
	  jcont.jar \
	  jdom.jar \
	  endorsed/xercesImpl.jar \
	  commons-logging.jar \
	  antlr.jar \
	  xalan.jar \
	  systementities.jar \
	  castor.jar \
	  saxpath.jar \
	  ArchiveIdentifierError.jar \
      acserr.jar \
      acserrj.jar

#>>>>> END OF standard rules


#
# INCLUDE STANDARDS
# -----------------
ifdef ACSROOT
    MAKEDIR  = $(shell if [ -f $(INTROOT)/include/acsMakefile ];  then \
                     echo $(INTROOT)/include; \
	           else \
	             echo $(ACSROOT)/include; \
		   fi;)
    include $(MAKEDIR)/acsMakefile
else
    MAKEDIR  = $(shell if [ -f $(INTROOT)/include/acsMakefile ];  then \
                     echo $(INTROOT)/include; \
	           else \
	             echo $(VLTROOT)/include; \
		   fi;)
    include $(MAKEDIR)/acsMakefile
endif

DATABASELIBDIR = ../lib

#
# TARGETS
# -------
all:	do_all
	@echo " . . . 'all' done" 


clean : clean_all 
	@echo " . . . clean done"

clean_dist : clean_all clean_dist_all 
	@echo " . . . clean_dist done"

man   : do_man 
	@echo " . . . man page(s) done"

install : install_all install_config
	@echo " . . . installation done"

install_config :
	@echo "Installing archiveConfig.properties.* to $(ACSDATA)/config..."
	@cp ../config/archiveConfig.properties.* $(ACSDATA)/config
	@if [ -f $(ACSDATA)/config/archiveConfig.properties ]; then \
                rm  $(ACSDATA)/config/archiveConfig.properties; \
        fi
	
	if [[ "$(LOCATION)" = "NRI" ]];  then \
		echo "LOCATION NRI, installing test archiveConfig.properties";\
		ln -s $(ACSDATA)/config/archiveConfig.properties.TEST $(ACSDATA)/config/archiveConfig.properties ;\
	elif [[ "$(LOCATION)" = "" ]];  then \
		echo "No LOCATION set, installing test archiveConfig.properties";\
		ln -s $(ACSDATA)/config/archiveConfig.properties.TEST $(ACSDATA)/config/archiveConfig.properties ;\
	else \
		echo "LOCATION STE or OSF, installing STE archiveConfig.properties";\
		ln -s $(ACSDATA)/config/archiveConfig.properties.STE $(ACSDATA)/config/archiveConfig.properties ;\
	fi;\

#	@cp tnsnames.ora $(ACSDATA)/config
	@echo "Done."

db : db_all
	@echo " . . . ../DB done"

#___oOo___
