# $Id: Makefile,v 1.1.1.1 2004-05-19 22:55:27 price Exp $
#
# make file
#
# Paul A. Price
#

CC = gcc
FITSFLAGS = -lcfitsio -lm
GSLFLAGS = -lgslcblas -lgsl

### SUN:
#FITSFLAGS = -lcfitsio -lm -L../cfitsio/ -lsocket -lnsl

### RH Linux:
CFLAGS = -Wall -O3 -g -march=i686

# Destination directory
DESTDIR = .

# Inputs
FAKEIMAGE = fakeimage.o memory.o
CONVERTFITS = convertFITS.o memory.o

.PHONY:	all clean

all: fakeimage convertFITS

.c.o:
	$(CC) -c $(CFLAGS) $<

fakeimage: $(FAKEIMAGE)
	$(CC) $(FAKEIMAGE) -o $(DESTDIR)/fakeimage $(FITSFLAGS) $(GSLFLAGS)

convertFITS: $(CONVERTFITS)
	$(CC) $(CFLAGS) $(CONVERTFITS) -o $(DESTDIR)/convertFITS $(FITSFLAGS)

clean:
	-$(RM) *.o

# Tags for emacs
.PHONY : tags
tags :
	etags `find . \( -name \*.[ch] -o -name \*.cpp \) -print`

