# @(#)makefile	19.1 (ESO-IPG) 02/25/03 14:22:16
# .COPYRIGHT:	Copyright (c) 1988 European Southern Observatory,
#						all rights reserved
# .TYPE		make file
# .NAME		$MIDASHOME/$MIDVERS/contrib/feros/src/makefile 
# .LANGUAGE	makefile syntax
# .ENVIRONMENT	Unix Systems. 
# .COMMENT	Compiles source files and generates "fors" commands
#
# .REMARKS	
# .AUTHOR	
# .VERSION 1.1	880831:		Implementation
# .VERSION 1.2	890104:		Generating makefile.com for VMS systems
# .VERSION 2.1  901102:         new directory structure CG.
# .VERSION 3.0  930308:         Using default.mk file

# DEFINITIONS:

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

#LLIBDIR = ../lib

M = ../../exec
#C_OPT = -O
#DEBUG = -g

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

LLIB = -L$(LIBDIR) -lmidas -lm
LLIB1 = -L$(LLIBDIR) -lech -L$(LIBDIR) -lftab -lgen -lmidas -lmidmath -lm

LIBS =	$(LIBDIR)/libmidas.a
LIBS1 =	$(LLIBDIR)/libech.a $(LIBDIR)/libmidas.a

OBJ = 	echloc.o  echext.o echbackground.o echfit.o echcalibrate.o \
	echrebin1d.o ypos.o echstraight.o imaqual.o echmerg1.o echidena.o \
	colmean.o 

OUT =	$(M)/echloc.exe $(M)/echext.exe $(M)/echbackground.exe \
	$(M)/echcalibrate.exe \
	$(M)/echrebin1d.exe $(M)/ypos.exe $(M)/echstraight.exe \
	$(M)/imaqual.exe $(M)/echmerg1.exe $(M)/echidena.exe \
	$(M)/colmean.exe

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

$(MAKEFILE_VMS): makefile
	$(MAKE_VMS)

$(M)/echloc.exe: echloc.o $(LIBS1)
	$(LDCC) echloc.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/echext.exe: echext.o $(LIBS1)
	$(LDCC) echext.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/echstraight.exe: echstraight.o $(LIBS1)
	$(LDCC) echstraight.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/echbackground.exe: echbackground.o $(LIBS1)
	$(LDCC) echbackground.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/echcalibrate.exe: echcalibrate.o $(LIBS1)
	$(LDCC) echcalibrate.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/ypos.exe: ypos.o $(LIBS1)
	$(LDCC) ypos.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/echrebin1d.exe: echrebin1d.o $(LIBS1)
	$(LDCC) echrebin1d.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/imaqual.exe: imaqual.o $(LIBS1)
	$(LDCC) imaqual.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/echmerg1.exe: echmerg1.o $(LIBS1)
	$(LD77) echmerg1.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/echidena.exe: echidena.o $(LIBS1)
	$(LD77) echidena.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@
$(M)/colmean.exe: colmean.o $(LIBS1)
	$(LD77) colmean.o $(LLIB1) $(SLIB) -o $@
	$(STRIP) $@

clean_exec:
	rm -f $(OUT)

clean:
	rm -f $(OBJ)
