install: clustalx clustalw

clean:
	rm *.o

OBJECTS = interface.o sequence.o showpair.o malign.o \
  	util.o trees.o gcgcheck.o prfalign.o pairalign.o \
  	calcgapcoeff.o calcprf1.o calcprf2.o calctree.o \
        readmat.o alnscore.o random.o 

XOBJECTS = xutils.o xmenu.o xcolor.o xdisplay.o xscore.o

HEADERS = general.h clustalw.h

CC	= cc
CFLAGS  = -c -O
LFLAGS	= -O -lm 
#NCBI_INC  = /dec/biolo/ncbi/include
#NCBI_LIB	= /dec/biolo/ncbi/lib
NCBI_INC  = /usr/include/ncbi
NCBI_LIB	= /usr/X11R6/lib/
CXFLAGS  = -DWIN_MOTIF -I$(NCBI_INC)
LXFLAGS	= -L$(NCBI_LIB) -lvibrant -lncbi -lpthread -lXm -lXmu -lXt -lX11 -lm 

clustalw : $(OBJECTS) amenu.o clustalw.o
	$(CC) -o $@ $(OBJECTS) amenu.o clustalw.o $(LFLAGS)

interface.o : interface.c $(HEADERS) param.h
	$(CC) $(CFLAGS) $*.c

amenu.o : amenu.c $(HEADERS) param.h
	$(CC) $(CFLAGS) $*.c

clustalx : $(OBJECTS) $(XOBJECTS) clustalx.o
	$(CC) -o $@ $(OBJECTS) $(XOBJECTS) clustalx.o $(LFLAGS) $(LXFLAGS)

clustalx.o : clustalx.c $(HEADERS)
	$(CC) $(CFLAGS) $(CXFLAGS) $*.c

xmenu.o : xmenu.c $(HEADERS) param.h
	$(CC) $(CFLAGS) $(CXFLAGS) $*.c

xdisplay.o : xdisplay.c $(HEADERS) param.h
	$(CC) $(CFLAGS) $(CXFLAGS) $*.c

xutils.o : xutils.c $(HEADERS) param.h
	$(CC) $(CFLAGS) $(CXFLAGS) $*.c

xcolor.o : xcolor.c $(HEADERS) param.h
	$(CC) $(CFLAGS) $(CXFLAGS) $*.c

xscore.o : xscore.c $(HEADERS) param.h
	$(CC) $(CFLAGS) $(CXFLAGS) $*.c

readmat.o : readmat.c $(HEADERS) matrices.h
	$(CC) $(CFLAGS) $*.c

trees.o : trees.c $(HEADERS) dayhoff.h
	$(CC) $(CFLAGS) $*.c

.c.o :
	$(CC) $(CFLAGS) $?

