# $Id: makefile,v 1.9 2001/07/04 08:06:24 amodigli Exp $
#*******************************************************************************
#
#  .COPYRIGHT  (C) 1998  European Southern Observatory (ESO)
#
#  .IDENT      $MIDASHOME/$MIDVERS/pipeline/uves/pipe/src/makefile 
#
#  .KEYWORDS   UVES, Pipeline
#
#  .PURPOSE    Compiling
#  __________
#
#  .USAGE      make
#  __________
#
#  .ENVIRON    MIDAS 98NOV
#
#  .LANGUAGE   Makefile syntax
#
#  .AUTHOR     N.Rainer  DPG/DMD/ESO
#              S.Wolf    DPG/DMD/ESO
#
#  .VERSION    0.9  98/07/07  Creation
#                   98/07/15  Release
#              1.0  98/12/15  Release
#              1.1  99/01/14  Release
#              1.2  99/03/04  Cleanup (rp)
#              2.0  99/08/25  Cleanup (sw)
#              2.1  99/08/30  Add SLIB, MLIB and X_LIBS to LLIB!
#	       2.2  99/10/15  Add new routine uves_psf.c (OB)
#
###############################################################################
# $Name:  $
# $Revision: 1.9 $
# $Log: makefile,v $
# Revision 1.9  2001/07/04 08:06:24  amodigli
# Eliminated any reference to fitsmd5.c
#
# Revision 1.8  2001/05/18 11:00:17  amodigli
# Added entry to source a completely
# commented makefile to eventually allow
# (uncommenting at user own risk the proper
# section) to purify/quantify pipe modules
#
# Revision 1.7  2001/05/18 06:19:58  amodigli
# Added fitsmd5.c to log checksum info
#
# Revision 1.6  2001/03/05 07:06:04  amodigli
# Added uves_corr_trap and uves_corr_hotpix
#
# Revision 1.5  2001/01/04 13:36:32  amodigli
# Added Id, Name, Revision, Log conf. control info
#
###############################################################################

# DEFINITIONS:

include $(MIDASHOME)/$(MIDVERS)/local/default.mk

# The next line allow to purify/quantify sources modules
# normally the sourced makefile is all commented 
# see it for further warings
include ../../Install/purify-quantify.mk

CFLAGS = $(C_OPT) $(DEBUG) $(SYS) -I$(LINC) -I$(INC)

LLIBDIR = ../../lib

LLIB  = -L$(LIBDIR) -lmidas $(SLIB) $(MLIB) -L$(LLIBDIR) -luves -lnumrec
LLIB1 = -L$(LLIBDIR) -lspec -L$(LIBDIR) -lftab -lgen -lmidas
LIBS  = $(LIBDIR)/libmidas.a $(LLIBDIR)/libuves.a
PLIB  = $(LLIBDIR)/libphysmod.a

M    =	../../../exec

OUT  =	$(M)/physmodtbl.exe \
	$(M)/uves_annot.exe \
	$(M)/uves_append.exe \
	$(M)/uves_badpix.exe \
	$(M)/uves_extract.exe \
	$(M)/uves_getwbin.exe \
	$(M)/uves_list.exe \
	$(M)/uves_message.exe \
	$(M)/uves_nonlfit.exe \
	$(M)/uves_psf.exe \
	$(M)/uves_replcol.exe \
	$(M)/uves_corr_trap.exe \
	$(M)/uves_corr_hotpix.exe \
	$(M)/uves_t3dextract.exe \
	$(M)/uves_qc1logtbl.exe \
	$(M)/uves_qc1pmtbl.exe 

# DEPENDENCIES:

all: $(OUT)

$(M)/uves_qc1pmtbl.exe: uves_qc1pmtbl.o $(LIBS)
	$(LDCC) uves_qc1pmtbl.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_qc1logtbl.exe: uves_qc1logtbl.o $(LIBS)
	$(LDCC) uves_qc1logtbl.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_annot.exe: uves_annot.o $(LIBS)
	$(LDCC) uves_annot.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_append.exe: uves_append.o $(LIBS)
	$(LDCC) uves_append.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_badpix.exe: uves_badpix.o $(LIBS)
	$(LDCC) uves_badpix.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_extract.exe: uves_extract.o $(LIBS)
	$(LDCC) uves_extract.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_getwbin.exe: uves_getwbin.o $(PLIB) $(LIBS)
	$(LDCC) uves_getwbin.o $(PLIB) $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_list.exe: uves_list.o $(LIBS)
	$(LDCC) uves_list.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_message.exe: uves_message.o $(LIBS)
	$(LDCC) uves_message.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_corr_trap.exe: uves_corr_trap.o $(LIBS)
	$(LDCC) uves_corr_trap.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_corr_hotpix.exe: uves_corr_hotpix.o $(LIBS)
	$(LDCC) uves_corr_hotpix.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_nonlfit.exe: uves_nonlfit.o $(LIBS)
	$(LDCC) uves_nonlfit.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_psf.exe: uves_psf.o $(PLIB) $(LIBS)
	$(LDCC) uves_psf.o $(PLIB) $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_replcol.exe: uves_replcol.o $(LIBS)
	$(LDCC) uves_replcol.o $(LLIB) -o $@
	$(STRIP) $@

$(M)/uves_t3dextract.exe: uves_t3dextract.o $(ADMO) $(LIBS)
	$(LDCC) uves_t3dextract.o $(ADMO) $(LLIB) $(SLIB) -o $@
	$(STRIP) $@

$(M)/physmodtbl.exe: physmodtbl.o $(PLIB) $(LIBS)
	$(LDCC) physmodtbl.o $(PLIB) $(LLIB) -o $@
	$(STRIP) $@


uves_messages.o: $(LINC)/messages.h

uves_message.o: $(LINC)/messages.h

uves_extract.o: $(LINC)/matrix.h

uves_getwbin.o: $(LINC)/physmod.h

uves_psf.o: $(LINC)/physmod.h

physmodtbl.o: $(LINC)/physmod.h $(LINC)/messages.h



clean:
	rm -f *.o

clean_exec:
	rm -f $(OUT)
