SRC_COM = 
SRC17 = c2fits17.f
SRC34 = c2fits34.f

OPT_SX4  = -P auto -Wf"-pvctl nomsg" -dW
OPT_SX  = -Wf"-pvctl nomsg" -dW
OPT_NEC = -Zstatic
OPT_SUN =

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

sx4 : c2fits17_sx4 c2fits34_sx4
c2fits17_sx4 : $(SRC_COM) $(SRC17)
	f77 $(OPT_SX4) -o $@ $(SRC17) $(SRC_COM) $(LIB_SX4)
c2fits34_sx4 : $(SRC_COM) $(SRC34)
	f77 $(OPT_SX4) -o $@ $(SRC34) $(SRC_COM) $(LIB_SX4)

sx : c2fits17_sx c2fits34_sx
c2fits17_sx : $(SRC_COM) $(SRC17)
	f77 $(OPT_SX) -o $@ $(SRC17) $(SRC_COM) $(LIB_SX)
c2fits34_sx : $(SRC_COM) $(SRC34)
	f77 $(OPT_SX) -o $@ $(SRC34) $(SRC_COM) $(LIB_SX)

nec : c2fits17_nec  c2fits34_nec 
c2fits17_nec : $(SRC_COM) $(SRC17)
	f77 $(OPT_NEC) -o $@ $(SRC17) $(SRC_COM) $(LIB_NEC)
c2fits34_nec : $(SRC_COM) $(SRC34)
	f77 $(OPT_NEC) -o $@ $(SRC34) $(SRC_COM) $(LIB_NEC)

sun : c2fits17_sun c2fits34_sun
c2fits17_sun : $(SRC_COM) $(SRC17) $(SRC_SUN)
	f77 $(OPT_SUN) -o $@ $(SRC17) $(SRC_COM) $(LIB_SUN)
c2fits34_sun : $(SRC_COM) $(SRC34) $(SRC_SUN)
	f77 $(OPT_SUN) -o $@ $(SRC34) $(SRC_COM) $(LIB_SUN)

tmp : c2fits17.f
	f77 $(OPT_SUN) -o c2fits17_sun c2fits17.f tmp.o $(LIB_SUN)

clean :
	rm *.o 

