SHELL = /bin/sh
CC = gcc
CFLAGS += -O0 -g -std=c99 -Werror -I/home/mithrandir/price/pan-starrs/jhroot/i686-pc-linux-gnu/include/ -D_GNU_SOURCE
PSLIB += -L/home/mithrandir/price/pan-starrs/jhroot/i686-pc-linux-gnu/lib/ -lpslib -lgsl -lgslcblas -lfftw3f -lsla -lcfitsio -lm -lxml2 -lmysqlclient
LDFLAGS += $(PSLIB)

BUILD_OBJS = test_pmFPAfromHeader.o pmCameraFromHeader.o pmFPAFromHeader.o psAdditionals.o papStuff.o
BUILD_TARGET = test_pmFPAfromHeader

READ_OBJS = test_pmFPARead.o pmCameraFromHeader.o pmFPARead.o papFocalPlane.o psAdditionals.o papStuff.o \
		pmFPAConstruct.o pmFPAMorph.o pmFPAWrite.o
READ_TARGET = test_pmFPARead

.PHONY: tags clean empty

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

$(READ_TARGET):	$(READ_OBJS)
		$(CC) $(CFLAGS) -o $@ $(READ_OBJS) $(LDFLAGS) $(OPTFLAGS)

clean:
		-$(RM) *.o gmon.* profile.txt

empty:		clean
		-$(RM) $(TARGET) TAGS

# Tags for emacs
tags:
		etags `find . -name \*.[ch] -print`
