SHELL = /bin/sh
CC=gcc
RANLIB=ranlib
INSTALL=/usr/bin/install -c
DEFS = -DHAVE_CONFIG_H
CFLAGS=-g -O2
CPPFLAGS=
LIBS=

prefix=/usr/local
exec_prefix=${prefix}
bindir=$(DESTDIR)${exec_prefix}/bin

### All C-file names in the PRF package
FILES = main \
	fits \
        init \
        integrate \
        sphere \
        store \
        vector

### All include files.
INCS = fits.h \
       init.h \
       prf.h \
       vector.h

### Directories
DIRS = data

### All *.o files
OBJ = $(FILES:%=%.o)

### All *.c files
SOU = $(FILES:%=%.c)

all: prf

prf:  $(OBJ) 
	$(CC) $(OBJ) -o prf $(LDOPTS) $(LIBS) -lm

main.o: main.c prf.h

fits.o: fits.c fits.h prf.h

init.o: init.c init.h prf.h

integrate.o: integrate.c prf.h

sphere.o: sphere.c prf.h

store.o: store.c prf.h

vector.o: vector.c vector.h

clean:
	rm -f *~
	rm -f *.o
	rm -f *.log

distclean: clean
	rm -f prf
	rm -f config.h config.status config.log
	rm -f -vR autom4te.cache

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c -o $@ $*.c
