#this makefile has 2 targets
#seaview    (default target) for standard unix/linux compilation
#seaviewps  does not use the PDFLibLite library and outputs postscript 

#customize these next 3 lines
FLTK = ../fltk-1.1.6
PDF = ../PDFlib-Lite-6.0.1/libs/pdflib
X11 = /usr/X11R6

#comment out and customize next line to set helpfile name at compile-time
#HELP_NOT_IN_PATH = -DDEFAULT_HELPFILE=\"/bge/mgouy/seaview/seaview.help\"

CXX = g++
CC = gcc

OPT = $(shell if [ '$(DEBUG)' = '' ]; then echo '-O2'; else echo '-O0'; fi)

STDCFLAGS  = -Dunix  -c $(OPT) -I$(FLTK) -I$(X11)/include $(DEBUG) $(HELP_NOT_IN_PATH)

CFLAGS = $(STDCFLAGS) -I$(PDF)
PDFLIBS = -L$(PDF) -lpdf 


#conditional macros 
seaviewps : CFLAGS = $(STDCFLAGS) -DNO_PDF


OBJECTS = custom.o use_mase_files.o regions.o load_seq.o align.o xfmatpt.o comlines.o chooser_plus.o resource.o nexus.o viewasprots.o misc_acnuc.o


seaview : seaview.o $(OBJECTS) pdf.o
	$(CXX) $(DEBUG)  seaview.o $(OBJECTS) pdf.o \
			-L$(FLTK)/lib -lfltk \
			$(PDFLIBS)   \
             -L$(X11)/lib -lX11 \
             -o seaview \
             -lm        

seaviewps : seaview.o $(OBJECTS) postscript.o
	$(CXX) $(DEBUG)  seaview.o $(OBJECTS) postscript.o \
			-L$(FLTK)/lib -lfltk \
             -L$(X11)/lib -lX11 \
             -o seaview \
             -lm        


.SUFFIXES:	.cxx .h .o

.cxx.o :
	$(CXX) $(CFLAGS) $<
.c.o :
	$(CC) $(CFLAGS) $<
