#Makefile for the ClariGnu suite of MRI analysis and conversion programs
#Copyright (C) 2002 Matthew Belmonte
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
CC = cc
CC_OPTS = -O2
OBJ = sweet.o sgilib.o area.o fromge.o gecon.o clump.o colourise.o
EXE = area fromge gecon clump colourise epicat
INSTALLDIR = /usr/local/bin

all: $(EXE)
sweet.o: sweet.c sweet.h sgi.h
	$(CC) $(CC_OPTS) -c sweet.c
sgilib.o: sgilib.c sgi.h
	$(CC) $(CC_OPTS) -c sgilib.c
area.o: area.c
	$(CC) $(CC_OPTS) -c area.c
area: area.o sweet.o sgilib.o
	$(CC) $(CC_OPTS) -L/usr/X11R6/lib -o area area.o sweet.o sgilib.o -lforms -lX11 -lm
fromge.o: fromge.c sweet.h
	$(CC) $(CC_OPTS) -c fromge.c
fromge: fromge.o sweet.o sgilib.o
	$(CC) $(CC_OPTS) -o fromge fromge.o sweet.o sgilib.o
gecon.o: gecon.c
	$(CC) $(CC_OPTS) -c gecon.c
gecon: gecon.o
	$(CC) $(CC_OPTS) -L/usr/X11R6/lib -o gecon gecon.o -lforms -lX11 -lm
clump.o: clump.c
	$(CC) $(CC_OPTS) -c clump.c
clump: clump.o sweet.o sgilib.o
	$(CC) $(CC_OPTS) -o clump clump.o sweet.o sgilib.o
colourise.o: colourise.c
	$(CC) $(CC_OPTS) -c colourise.c
colourise: colourise.o sweet.o sgilib.o
	$(CC) $(CC_OPTS) -o colourise colourise.o sweet.o sgilib.o
epicat: epicat.c
	$(CC) $(CC_OPTS) -o epicat epicat.c
install:
	mv -f $(EXE) $(INSTALLDIR)
clean:
	rm -f $(OBJ) $(EXE)
