#*******************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: makefile,v 2.43 2004/06/17 23:04:32 vltsccm Exp $"
#
# Makefile of FIMS
#
# who       when      what
# --------  --------  ----------------------------------------------
# hummel  13/08/99  created
#

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

#  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#   FILENAME : makefile
#   SOURCE   : 
#   LANGUAGE : makefile language
#   AUTHOR   : W.Hummel
#   PURPOSE  : compile and link AP.C -> AP 
#   HISTORY  :
#   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# --------------------------
# Makros : Flags 
# --------------------------
CC = g++
CCFLAG = -c 
COFLAG = -o 
OPFLAG = -g -Wall 
INCFLG  = -I./../include
OUTDIR =  ../object/
# --------------------------
# Makros : sources
# --------------------------

SOURCES = \
          AP.C \
          AP_targ.C\
          AP_list.C\
          AP_pixel.C\
          AP_mask.C

# --------------------------
# Makros : objects 
# --------------------------

OBJECTS = \
          $(OUTDIR)AP.o \
          $(OUTDIR)AP_targ.o\
          $(OUTDIR)AP_list.o\
          $(OUTDIR)AP_pixel.o\
          $(OUTDIR)AP_mask.o



# --------------------------
# Makros : libs    
# --------------------------
LMATH = -lm
# LGNU  = -lg++
LSTD  = -lstdc++

# --------------------------
# options                  
# --------------------------
default: clean p s d a

clean:
	- rm -r  ../lib/libfimsPlugins.tcl
	- rm -r  ../lib/libesoPlugins.tcl
	- rm -rf ../lib/fors
	- rm -r  ../bin/*
	- rm $(OUTDIR)*.o
list:  
	ls -l *.C
lost:
	ls -l *.o
head:
	ls -l ./../include/*.h
info: 
	echo "-s info  = this table"
	echo "---------------------"       
	echo "s     = Scripts" 
	echo "d     = DataBase"
	echo "p     = Plugins"
	echo "a     = AutoPos"
	echo "clean = clean"
	echo "all   = "
	echo "install "


lint: $(SOURCES)
	lint beitera.c

#--------------------------------------------------
# C++ AutomaticPositioning
#--------------------------------------------------

a: $(OBJECTS)  
	$(CC) $(COFLAG) ../bin/AP $(OBJECTS) $(LMATH) $(LGNU) $(LSTD)


#------------------------------------------------------------------

$(OUTDIR)AP.o: AP.C 
	$(CC) $(CCFLAG) $(INCFLG)       AP.C $(COFLAG) $(OUTDIR)AP.o
 
$(OUTDIR)AP_list.o: AP_list.C
	$(CC) $(CCFLAG) $(INCFLG)  AP_list.C $(COFLAG) $(OUTDIR)AP_list.o

$(OUTDIR)AP_targ.o: AP_targ.C
	$(CC) $(CCFLAG) $(INCFLG)  AP_targ.C $(COFLAG) $(OUTDIR)AP_targ.o

$(OUTDIR)AP_mask.o: AP_mask.C
	$(CC) $(CCFLAG) $(INCFLG)  AP_mask.C $(COFLAG) $(OUTDIR)AP_mask.o

$(OUTDIR)AP_pixel.o: AP_pixel.C
	$(CC) $(CCFLAG) $(INCFLG) AP_pixel.C $(COFLAG) $(OUTDIR)AP_pixel.o


#--------------------------------------------------
# TclTk Plugin 
#--------------------------------------------------
p: 
	- mkdir ../lib/libfimsPlugins.tcl
	- cp SkyCat_plugin.tcl    ../lib/libfimsPlugins.tcl/.
	- cp SkySearch_plugin.tcl ../lib/libfimsPlugins.tcl/.
	- cp fims.tcl             ../lib/libfimsPlugins.tcl/fims.tcl
	- cp fims_version.tcl     ../lib/libfimsPlugins.tcl/. 
	- cp ref_targ.tcl         ../lib/libfimsPlugins.tcl/ref_targ.tcl
	- cp mxu_class.tcl        ../lib/libfimsPlugins.tcl/mxu_class.tcl
	- cp conv_coord.tcl       ../lib/libfimsPlugins.tcl/conv_coord.tcl
	- cp conv_mc.tcl          ../lib/libfimsPlugins.tcl/conv_mc.tcl
	- cp conv_wc.tcl          ../lib/libfimsPlugins.tcl/conv_wc.tcl
	- cp statuspanel.tcl      ../lib/libfimsPlugins.tcl/statuspanel.tcl
	- cp fors1_menu.tcl       ../lib/libfimsPlugins.tcl/.
	- cp fors2_menu.tcl       ../lib/libfimsPlugins.tcl/.
	- cp FI_tclIndex          ../lib/libfimsPlugins.tcl/tclIndex

	- mkdir ../lib/libesoPlugins.tcl
	- cp PE_SkyCat_plugin.tcl     ../lib/libesoPlugins.tcl/.
	- cp PE_graphics_features.tcl ../lib/libesoPlugins.tcl/graphics_features.tcl
	- cp PE_tclIndex              ../lib/libesoPlugins.tcl/tclIndex

	- mkdir ../lib/libfrtdPlugins.tcl
	- cp Rtd_plugin.tcl           ../lib/libfrtdPlugins.tcl/.


#--------------------------------------------------
# FORS DATA BASE and MXU - STANDARD and CALIBRATION MASKS 
#--------------------------------------------------
d:
	- mkdir ../lib/fors
	- cp FORS1.isf              ../lib/fors/.
	- cp FORS2.isf              ../lib/fors/.
	- cp fims_deadline.asc      ../lib/fors/.
	- cp F1BadPixelMap.asc      ../lib/fors/.
	- cp F2BadPixelMap.asc      ../lib/fors/.

	- cp standard_mask_list     ../lib/fors/.
	- cp mxu2.*.standard.fad    ../lib/fors/.

s:
	- chmod u+x midas2skycat.sh
	- cp -p midas2skycat.sh ../bin/.
	- cp -p midas2skycat.prg ../bin/.

	- chmod u+x gerber2eps.perl gerber2ps.perl 
	- cp -p gerber2eps.perl ../bin/.
	- cp -p gerber2ps.perl  ../bin/.

	- chmod u+x efh.sh
	- cp -p efh.sh             ../bin/.

	- chmod u+x fims.sh
	- cp -p fims.sh             ../bin/.

	- chmod u+x new2old

install: 
	echo "TBD"
all: default

#___oOo___

