# Makefile for ALSCRIPT, msf2blc and clus2blc programs
#
# These programs require an ANSI C compiler
#
# This makefile is for gcc linux computers it should need only 
# minor modifications to work on other computer types, e.g. Sun
# Dec etc.  This also appears to work under cygwin, though you 
# have to use the --unix flag to make.
# 
#
CC = gcc
MACHINE = linux
CFLAGS = -O2 -I./ -I../gjutil/
LFLAGS =  -o
ALOBJS = alscript.o alps.o ../gjutil/gjutil.o agetbloc.o ckdd.o 
#
PROGS = alscript msf2blc clus2blc alsnum fast2blc

all: $(PROGS)

alscript: $(ALOBJS)
	$(CC) $(CFLAGS) $(ALOBJS) $(LFLAGS) alscript
msf2blc: msf2blc.o ../gjutil/gjutil.o 
	$(CC) $(CFLAGS) msf2blc.o ../gjutil/gjutil.o   $(LFLAGS) msf2blc
clus2blc: clus2blc.o ../gjutil/gjutil.o  
	$(CC) $(CFLAGS) clus2blc.o ../gjutil/gjutil.o   $(LFLAGS) clus2blc
fast2blc: fast2blc.o ../gjutil/gjutil.o 
	$(CC) $(CFLAGS) fast2blc.o ../gjutil/gjutil.o  $(LFLAGS) fast2blc
alsnum: alsnum.o ../gjutil/gjutil.o agetbloc.o  
	$(CC) $(CFLAGS) alsnum.o ../gjutil/gjutil.o agetbloc.o  $(LFLAGS) alsnum


alscript.o: alscript.c array.h ../gjutil/gjutil.h version.h
	$(CC) $(CFLAGS) -c alscript.c

alps.o: alps.c array.h ../gjutil/gjutil.h version.h
	$(CC) $(CFLAGS) -c alps.c

agetbloc.o: agetbloc.c array.h ../gjutil/gjutil.h
	$(CC) $(CFLAGS) -c agetbloc.c

../gjutil/gjutil.o: ../gjutil/gjutil.c ../gjutil/gjutil.h 
	(cd ../gjutil; $(CC) $(CFLAGS) -c gjutil.c gjtimes.o ; cd ../src)

clus2blc.o: clus2blc.c array.h ../gjutil/gjutil.h defaults.h
	$(CC) $(CFLAGS) -c clus2blc.c

msf2blc.o: msf2blc.c array.h ../gjutil/gjutil.h defaults.h
	$(CC) $(CFLAGS) -c msf2blc.c

fast2blc.o: fast2blc.c array.h ../gjutil/gjutil.h defaults.h
	$(CC) $(CFLAGS) -c fast2blc.c

ckdd.o: ckdd.c array.h
	$(CC) $(CFLAGS) -c ckdd.c

alsnum.o: alsnum.c array.h ../gjutil/gjutil.h defaults.h
	$(CC) $(CFLAGS) -c alsnum.c
