# Set this to the directory where you want to code installed.  The binaries
# will be installed in $(ROOT_DIR)/bin
ROOT_DIR = /usr/local

# Set this to your preferred C compiler (e.g. cc or gcc)
CC = gcc

# Set this to the location of the fitsio.h include file from CFITSIO and the libcfitsio library.
# This could be /usr/local, /opt/local, /sw, or somewhere else, depending on your configuration
CFITSIOINC = -I/opt/local/include/
CFITSIOLIB = -L/opt/local/lib/

# Add any compile flags you need 
CCFLAGS = -O

all: fits2bin

install: fits2bin 
	mkdir -p $(ROOT_DIR)/bin
	cp -p fits2bin makebininf.py $(ROOT_DIR)/bin

fits2bin: fits2bin.c
	$(CC) $(CCFLAGS) -o fits2bin $(CFITSIOLIB) $(CFITSIOINC) fits2bin.c -lcfitsio -lm

clean:
	rm -rf *.o *~ core build fits2bin
