# .COPYRIGHT:	Copyright (c) 1988-2009  European Southern Observatory,
#						all rights reserved
# .TYPE		make file
# .NAME		$MIDASHOME/$MIDVERS/prim/src/general/makefile 
# .LANGUAGE	makefile syntax
# .ENVIRONMENT	Unix Systems. 
# .COMMENT	Compiles source files and generates "general" commands
#
# .REMARKS	
# .AUTHOR	
# .VERSION 1.1	880831:		Implementation
# .VERSION 1.2	890104:		Generating makefile.com for VMS systems
# .VERSION 2.3  920521:         Removing MLIB CG
# .VERSION 3.0  930308:		Using default.mk file
# 110514	last modif


include ../../../local/default.mk

M = ../../exec

LIBS =	$(LIBDIR)/libgen.a \
	$(LIBDIR)/libmidas.a \
	$(LIBDIR)/libmidmath.a 

LLIB = -L$(LIBDIR) -lgen -lmidas -lmidmath

OUT =	$(M)/airmass.exe \
	$(M)/darithm.exe \
	$(M)/arithm.exe $(M)/averow.exe  \
	$(M)/averag.exe $(M)/avwndw.exe $(M)/averagw.exe  \
	$(M)/copier.exe $(M)/fheader.exe  \
	$(M)/iminfo.exe $(M)/genxy1.exe $(M)/positions.exe \
	$(M)/compxy.exe $(M)/crfram.exe  \
	$(M)/deconv.exe $(M)/descr.exe   \
	$(M)/genxx1.exe  \
	$(M)/flip.exe   $(M)/fitsmd5.exe  \
        $(M)/fouri.exe  \
	$(M)/logviewer.exe $(M)/modcol.exe  \
	$(M)/rarthm.exe  \
	$(M)/rebin.exe  $(M)/repla.exe   \
        $(M)/genzz1.exe	 \
        $(M)/rcosmic.exe $(M)/genran.exe \
	$(M)/genyy1.exe 

# DEPENDENCIES:
all: $(MAKEFILE_VMS) $(OUT)

$(MAKEFILE_VMS): makefile
	$(MAKE_VMS) force

$(M)/airmass.exe: airmass.o $(LIBS)
	$(LD77) airmass.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/darithm.exe: darithm.o $(LIBS)
	$(LD77) darithm.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/arithm.exe: arithm.o $(LIBS)
	$(LD77) arithm.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/averag.exe: averag.o $(LIBS)
	$(LDCC) averag.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/avwndw.exe: avwndw.o $(LIBS)
	$(LD77) avwndw.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/averagw.exe: averagw.o $(LIBS)
	$(LDCC) averagw.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/averow.exe: averow.o $(LIBS)
	$(LD77) averow.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/compxy.exe: compxy.o $(LIBS)
	$(LD77) compxy.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/copier.exe: copier.o $(LIBS)
	$(LD77) copier.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/fheader.exe: fheader.o $(LIBS)
	$(LDCC) fheader.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/iminfo.exe: iminfo.o $(LIBS)
	$(LDCC) iminfo.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/genxy1.exe: genxy1.o $(LIBS)
	$(LDCC) genxy1.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/crfram.exe: crfram.o $(LIBS)
	$(LD77) crfram.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/deconv.exe: deconv.o $(LIBS)
	$(LD77) deconv.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/fouri.exe: fouri.o $(LIBS)
	$(LD77) fouri.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/descr.exe: descr.o $(LIBS)
	$(LD77) descr.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/genxx1.exe: genxx1.o genxx2.o $(LIBS)
	$(LD77) genxx1.o genxx2.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/flip.exe: flip.o $(LIBS)
	$(LD77) flip.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/fitsmd5.exe: fitsmd5.o $(LIBS)
	$(LDCC) fitsmd5.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/logviewer.exe: logviewer.o $(LIBS)
	$(LDCC) logviewer.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/modcol.exe: modcol.o $(LIBS)
	$(LD77) modcol.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/genzz1.exe: genzz1.o $(LIBS)
	$(LD77) genzz1.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/rarthm.exe: rarthm.o $(LIBS)
	$(LD77) rarthm.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/rebin.exe: rebin.o $(LIBS)
	$(LD77) rebin.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/repla.exe: repla.o replsubs.o replsubt.o $(LIBS)
	$(LD77) repla.o replsubs.o replsubt.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/genyy1.exe: genyy1.o $(LIBS)
	$(LD77) genyy1.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/rcosmic.exe: rcosmic.o $(LIBS)
	$(LD77) rcosmic.o $(LLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/positions.exe: positions.o $(LIBS)
	$(LDCC) positions.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@
$(M)/genran.exe: genran.o $(LIBS)
	$(LDCC) genran.o $(LLIB) $(MLIB) $(SLIB) -o $@
	$(STRIP) $@

clean_exec:
	rm -f $(OUT)

clean:
	rm -f *.o
	rm -f *.f

