SHELL = /bin/sh
CC=gcc
RANLIB=ranlib
TAR=/bin/tar
GZIP=/bin/gzip
INSTALL=/usr/bin/install -c
DEFS = -DHAVE_CONFIG_H
CFLAGS=-g -Wall -DNTHREADS=8
CPPFLAGS=
LIBS=
LDOPTS=

prefix=/usr/local
exec_prefix=${prefix}
bindir=$(DESTDIR)${exec_prefix}/bin
pkgdir=$(DESTDIR)$(prefix)/share/mcprf
datadir=$(DESTDIR)$(prefix)/share/mcprf/data
mandir=$(DESTDIR)$(prefix)/share/man/man1

# A makefile to compile and cleanup the ali program
FILES = main \
	adjust \
        allocs \
        gaussj \
        init \
        pop_init \
        run \
        sphere \
        store \
        vector

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

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

LIB= -lm -lpthread
#OPTS= -Wall -DNTHREADS=8 -DCOOLING

all: ali

ali: $(OBJ)
	$(CC) $(LDOPTS) $(OBJ) -o ali $(LIB)

$(OBJ)	:ali.h

init.o	:init.h

init.o	:dat.h

$(OBJ)	:vector.h

lint:
	-lint $(LOPT) $(SOU)

test: read_par.o
	$(CC) read_par.o -o test $(LIB)

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

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

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