#
# Makefile for gt-itm2ns Topology converters
#



# Note: If you are using Solaris, you MUST edit the Makefile to 
#       uncomment the two Solaris lines below, and comment the SunOS line.
# 
# For Solaris: uncomment the next two lines
SYS = -DSYSV
LIBS = -lm -lgb5

# For SunOS: uncomment the next line
#LIBS = -lm -lgb4

GT_ITM = ../gt-itm
IDIR = $(GT_ITM)/include
LDIR = $(GT_ITM)/lib
BDIR = $(GT_ITM)/bin

CFLAGS = -I$(IDIR) -L$(LDIR) $(SYS) -g
CC = gcc 

CN = sgb2ns.o
HN = sgb2hierns.o
COM = sgb2comns.o

CH = $(IDIR)/geog.h $(IDIR)/gb_graph.h $(IDIR)/gb_save.h



all:	sgb2comns sgb2hierns sgb2ns ts2ns

sgb2ns: $(CN)
	$(CC) $(CFLAGS) -o $(BDIR)/sgb2ns $(CN) $(LIBS) 

ts2ns: $(CN)
	$(CC) $(CFLAGS) -o $(BDIR)/ts2ns $(CN) $(LIBS)

sgb2hierns: $(HN)
	$(CC) $(CFLAGS) -o $(BDIR)/sgb2hierns $(HN) $(LIBS)

sgb2comns: $(COM)
	$(CC) $(CFLAGS) -o $(BDIR)/sgb2comns $(COM) $(LIBS)

sgb2ns.o: $(CH)
sgb2hierns.o: $(CH)
ts2ns.o: $(CH)
sgb2comns.o : $(CH)

clean:  
	\rm -f *.o

veryclean:  clean
	\rm -f $(BDIR)/*

