# Makefile for PRIP software

# $PACKAGE is the name of this progam, e.g., mcluster
PACKAGE =  goodness

BINDIR = /home/pixel/u40/murniani/bin
LIBDIR = /home/pixel/l40/prip/lib/sun4
MANDIR = /home/pixel/l40/prip/man/manl

# All the source files required for this package
FILES =   goodness.c

# All the object files required to be linked together
OBJS =   goodness.o

CC = cc
#CFLAGS = -s
CFLAGS = -g
DEBUG = -g -Bstatic -DDEBUG
CPPFLAGS = -I/opt/hips/include -I/opt/prip/include -L/opt/lib
#CPPFLAGS = -I/opt/hips/include -I/opt/prip/include -L/opt/lib -R/opt/lib
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
FC = f77
FFLAGS = -s
COMPILE.f = $(FC) $(FFLAGS) $(CPPFLAGS) -c
LIBS = -lrangelib -lhips -llinpack -lm

$(PACKAGE): $(OBJS) Makefile
	$(CC) $(CFLAGS) $(CPPFLAGS)  -o $(PACKAGE) $(OBJS) $(LIBS)
#	install -s -m 755  $(PACKAGE)  $(BINDIR)

debug:
	$(CC) $(DEBUG) -o $(PACKAGE)-debug $(FILES) $(LIBS)

test:
	@echo "Please implement a test suite for your software!"

install:
	cp $(PACKAGE) $(BINDIR)
	chmod 755 $(BINDIR)/$(PACKAGE)
	- cp $(PACKAGE).l $(MANDIR)
	- chmod 755 $(MANDIR)/$(PACKAGE).l

uninstall:
	/bin/rm -f $(BINDIR)/$(PACKAGE)
	/bin/rm -f $(MANDIR)/$(PACKAGE).l

clean:
	/bin/rm -f core $(PACKAGE) *.o
