#For Debian compilation, uncomment the 2 lines below 
#HELPFILE= -DDEFAULT_HELPFILE=\"/usr/share/doc/seaview/seaview.html\"
#PHYMLNAME= -DPHYMLNAME=\"phyml\"


#to use your own, uninstalled FLTK library,
#uncomment the next 3 lines and adapt the 1st (and 2nd if FLTK was built with CMake) to your local file system
#FLTK = $(HOME)/fltk-1.3
#IFLTK = -I$(FLTK) # -I$(FLTK)/..
#CONFIG = $(FLTK)/fltk-config


CONFIG ?= fltk-config

EXTRALIBS = `$(CONFIG) --use-images --ldflags` -ldl -lpthread -lz

CC = cc
CXX = c++
CSRC = csrc

#DEBUG = -g
#OPT = -O0

OPT ?= -O3

SVFLAGS = $(CPPFLAGS) $(CFLAGS) -Dunix $(OPT) -I. $(IFLTK) -I$(CSRC) $(DEBUG) $(HELPFILE) $(PHYMLNAME)

OBJECTS = seaview.o custom.o use_mase_files.o regions.o load_seq.o align.o xfmatpt.o \
comlines.o resource.o nexus.o \
viewasprots.o racnuc_fetch.o concatenate.o statistics.o \
trees.o treedraw.o addbootstrap.o least_squares_brl.o \
pseudoterminal.o unrooted.o pdf_or_ps.o svg.o threads.o tbe.o treerecs_draw.o Fl_SVG_Image.o
 
COBJECTS = raa_acnuc.o parser.o md5.o zsockr.o misc_acnuc.o dnapars.o protpars.o seq.o phylip.o lwl.o bionj.o phyml_util.o

seaview : $(OBJECTS) $(COBJECTS)
	$(CXX) -o $@ $(DEBUG) $(LDFLAGS) $(OBJECTS) $(COBJECTS) $(LPDF) $(EXTRALIBS) -Wl,-z,muldefs

Fl_SVG_Image.o : FL/Fl_SVG_Image.cxx
	$(CXX) -c $(SVFLAGS) FL/Fl_SVG_Image.cxx

$(COBJECTS) : $(CSRC)/$<
	$(CC) -c $(DEBUG) $(OPT) $(CFLAGS) -Dunix -I$(CSRC) $(CSRC)/$*.c


.SUFFIXES:	.c .cxx .h .o

.cxx.o :
	$(CXX) -c  $(SVFLAGS) $<
