SRCCOM = 
SRC17 = snap2d17.f
SRC34 = snap2d34.f

OPT_SX4  = -Wf"-pvctl nomsg" -dW
OPT_SX  = -Wf"-pvctl nomsg" -dW
OPT_SX90 = -h ary90
OPT_NEC = -Zstatic
OPT_SUN = 

LIB_SX5  = -L../../../../lib -lnorhsx5 -L/share/norh_local/lib -lsslsx5 -lfitsiosx5 -lasl
LIB_SX4  = -L../../../../lib -lnorhsx4  -L/share/norh_local/lib -lsslsx4 -lfitsiosx4 -lasl
LIB_SX  = -L../../../../lib -lnorhsx  -L/share/norh_local/lib -lsslsx -lfitsiosx -L/xmu/lib -lasl
LIB_NEC = -L../../../../lib -lnorhnec -L/share/norh_local/lib -lsslnec -lfitsionec
LIB_SUN = -L../../../../lib -lnorhsun -L/usr/local/lib  -lssl -lfits

OBJCOM    = $(SRCCOM:.f=.o)
OBJ17     = $(SRC17:.f=.o)
OBJ34     = $(SRC34:.f=.o)

sx5 : hanaoka17_sx5 hanaoka34_sx5
hanaoka17_sx5 : $(SRCCOM) $(SRC17)
	f90 $(OPT_SX4) -o $@ $(SRC17) $(SRCCOM) $(LIB_SX5)
hanaoka34_sx5 : $(SRCCOM) $(SRCCOM_SSL) $(SRC34)
	f90 $(OPT_SX4) -o $@ $(SRC34) $(SRCCOM) $(LIB_SX5)

sx4 : hanaoka17_sx4 hanaoka34_sx4
hanaoka17_sx4 : $(SRCCOM) $(SRC17)
	f90 $(OPT_SX4) -o $@ $(SRC17) $(SRCCOM) $(LIB_SX4)
hanaoka34_sx4 : $(SRCCOM) $(SRCCOM_SSL) $(SRC34)
	f90 $(OPT_SX4) -o $@ $(SRC34) $(SRCCOM) $(LIB_SX4)

sx : hanaoka17_sx hanaoka34_sx
hanaoka17_sx : $(SRCCOM) $(SRC17)
	f77 $(OPT_SX) -o $@ $(SRC17) $(SRCCOM) $(LIB_SX)
hanaoka34_sx : $(SRCCOM) $(SRCCOM_SSL) $(SRC34)
	f77 $(OPT_SX) -o $@ $(SRC34) $(SRCCOM) $(LIB_SX)

nec : hanaoka17_nec hanaoka34_nec
hanaoka17_nec : $(SRCCOM) $(SRC17)
	f77 $(OPT_NEC) -o $@ $(SRC17) $(SRCCOM) $(LIB_NEC)
hanaoka34_nec : $(SRCCOM) $(SRCCOM_SSL) $(SRC34)
	f77 $(OPT_NEC) -o $@ $(SRC34) $(SRCCOM) $(LIB_NEC)

sun : hanaoka17_sun hanaoka34_sun
hanaoka17_sun : $(SRCCOM) $(SRC17)
	f77 $(OPT_SUN) -o $@ $(SRC17) $(SRCCOM) $(LIB_SUN)
hanaoka34_sun : $(SRCCOM) $(SRCCOM_SSL) $(SRC34)
	f77 $(OPT_SUN) -o $@ $(SRC34) $(SRCCOM) $(LIB_SUN)

clean :
	\rm *.o 
