# Makefile to build executable binaries necessary for IRC pipeline
# Created: Yoshifusa Ita, 08-Jul-05
ifndef CFITSIO_DIR
CFITSIO_DIR=/usr/local/cfitsio
endif
CC     = gcc
FF     = g77
COPTS  = -Wall -O2 
COPTS2 = -ffast-math -funroll-loops
COPTS3 = -mtune=pentium4 -march=pentium4
COPTS4 = -I${CFITSIO_DIR}
FOPTS  = -O2
MLIB   = -lm
PGLIB  = -lcpgplot -lpgplot -L/usr/X11/lib -lX11
FITSL  = -lcfitsio -L${CFITSIO_DIR}
BIN    = ../bin
ATDIR  = /usr/local/lib/atFunctions/2.6
ATINC  = -I$(ATDIR)/include 
ATLIB  = $(ATDIR)/linux/libatFunctions.a


all:	mkpair mkflatpair lonesome convert2mass convert2mass2 convert2mass_all wipestars


mkpair: mkpair.c
	$(CC) $(COPTS) -o $(BIN)/mkpair mkpair.c $(MLIB)

mkflatpair: mkflatpair.c
	$(CC) $(COPTS) -o $(BIN)/mkflatpair mkflatpair.c $(MLIB)

lonesome: lonesome.c
	$(CC) $(COPTS) -o $(BIN)/lonesome lonesome.c $(MLIB)

convert2mass: convert2mass.c
	$(CC) $(COPTS) -o $(BIN)/convert2mass convert2mass.c $(MLIB)

convert2mass2: convert2mass.c
	$(CC) $(COPTS) -o $(BIN)/convert2mass2 convert2mass2.c $(MLIB)

convert2mass_all: convert2mass_all.c
	$(CC) $(COPTS) -o $(BIN)/convert2mass_all convert2mass_all.c $(MLIB)

wipestars: wipestars.c
	$(CC) $(COPTS) -o $(BIN)/wipestars wipestars.c $(MLIB)

clean:
	rm -rf ../bin/*
	rm -rf *~
