CPPFLAGS = -g -ggdb3 \
			-D_NO_PROTO \
			-I include -I . -O1 
# -pg 
# (Profiling)

LOADLIBES = -lg++ -lstdc++

anneal: data-input.o anneal.o
	cc $(CPPFLAGS) $(LOADLIBES) $^ -o anneal

branch: data-input.o branch.o
	cc $(CPPFLAGS) $(LOADLIBES) $^ -o branch

1tree: 1tree.o data-input.o
	cc $(CPPFLAGS) $(LOADLIBES) $^ -o 1tree


SOURCES = Makefile 1tree.cc anneal.cc anneal.h branch.cc branch.h \
	data-input.cc data-input.h \
	cont26.dat cont51.dat cont76.dat cont101.dat \
	tsp.tex tsp.bib

#generic rules:
# This is an automatic-dependency generation rule from `Make' info.
# Modified: The character Q is used as sed delimiter (instead of a slash) to allow slashes to appear in path names.
%.d: %.cc
	$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< | sed '\''sQ$(*F).o[ :]*Q$(*D)/$(*F).o $@ : Makefile Qg'\'' > $@'

tgz: $(SOURCES)
	tar cfz tsp.tar.gz $(SOURCES)

LATEX=latex
MAKEINDEX=makeindex
DVIPS=dvips
BIBTEX=bibtex

%.ps: %.dvi
	-$(DVIPS) $*

tsp.dvi: tsp.tex tsp.bib
	-$(LATEX) "\batchmode \input{tsp.tex}"
	-$(BIBTEX) tsp
	-$(LATEX) "\batchmode \input{tsp.tex}"

include data-input.d branch.d iter.d
