#
# USE GNU MAKE (gmake?) to compile
#
#

## CFITSIO library:
#Solaris:
FITSLIB = -L$(LHEASOFT)/lib -lcfitsio -lnsl -lsocket

# #Linux:
# FITSLIB = -L$(LHEASOFT)/lib -lcfitsio -lnsl

# The -I flags tells a path to the cfitsio header files. I assume they are 
# distributed with FTOOLs
CFLAGS = -O -I$(LHEASOFT)/include/

all: readpar apply_gain

readpar:
	(cd ReadPar; make)

apply_gain: apply_gain.o
	${LINK.c} -o $@ $^ $(FITSLIB) librp.a -lm 
	strip $@

clean:
	rm -f *.o

distclean:
	rm -f apply_gain librp.a
