INCLUDES = -I$(top_srcdir)/src $(all_includes)

AM_CXXFLAGS = $(BOOST_CPPFLAGS)

SUFFIXES= .itxt

#LINKEDITLIB= -lmiraEdIt -lmiraExamine -lmiraKNN_abi373
#LINKEDITDIR= -L../examine -L../EdIt -L../knn_abi373 -L../knn_alf

LINKEDITLIB=
LINKEDITDIR=

ciclean:
	-@rm -f compileinfo.itxt

compileinfo.itxt:
	@/bin/echo -n "Compiled by: " >compileinfo.itxt.xxd
	@whoami >>compileinfo.itxt.xxd
	@date >>compileinfo.itxt.xxd
	@/bin/echo -n "On: " >>compileinfo.itxt.xxd
	@uname -a >>compileinfo.itxt.xxd
	@echo "Making .H out of .xxd" $@
	@$(SHELL) -ec 'grep -v "^#" compileinfo.itxt.xxd | xxd -i >compileinfo.itxt.xxd.H'
	@rm compileinfo.itxt.xxd



#bin_PROGRAMS= mira fastatool scftool uncover_at convert_project tagsnp
bin_PROGRAMS= mira fastatool scftool convert_project miramer

# tagsnp ace2caf
noinst_PROGRAMS= miratest dbgreplay

noinst_HEADERS = quirks.H

#noinst_PROGRAMS+= mirazip
# EdIt_abi373 EdIt_alf skimmer

if BUILDMIRASTATIC
AM_LDFLAGS=  $(BLOODYDARWINSTATLIBDIRHACK) -L../debuggersupport -L../memorc -L../io/ -L../util/ -L../errorhandling/ -L../mira -L../caf $(LINKEDITDIR) $(BOOST_LDFLAGS) -all-static
else
AM_LDFLAGS=  -L../debuggersupport -L../memorc -L../io/ -L../util/ -L../errorhandling/ -L../mira -L../caf $(LINKEDITDIR) $(BOOST_LDFLAGS)
endif

if BUILDMIRAMEMORC
MEMORC= -lmemorc
endif

MIRALIBS=-lmiradebuggersupport $(MEMORC) -lmira -lmiraestass -lmiracaf -lmirautil -lmiradptools -lmirafio -lmiraerrorhandling -lmiradebuggersupport  $(LINKEDITLIB)

install-exec-hook:
	cd $(DESTDIR)$(bindir) && \
	rm -f miraSearchESTSNPs$(EXEEXT) && \
	rm -f miraclip$(EXEEXT) && \
	rm -f miramem$(EXEEXT) && \
	rm -f miradiff$(EXEEXT) && \
	$(LN_S) miramer$(EXEEXT) miradiff$(EXEEXT) && \
	$(LN_S) mira$(EXEEXT) miramem$(EXEEXT) && \
	$(LN_S) mira$(EXEEXT) miraSearchESTSNPs$(EXEEXT) && \
	$(LN_S) mira$(EXEEXT) miraclip$(EXEEXT)

uninstall-hook:
	cd $(DESTDIR)$(bindir) && \
	rm -f miraSearchESTSNPs$(EXEEXT) && \
	rm -f miramem$(EXEEXT) && \
	rm -f miradiff$(EXEEXT) && \
	rm -f miraclip$(EXEEXT)


strip:
	du -sk $(bin_PROGRAMS)
	strip $(bin_PROGRAMS)
	du -sk $(bin_PROGRAMS)

privinst:
	cp $(bin_PROGRAMS) /home/bach/pub/bin

binclean:
	rm -rf $(bin_PROGRAMS)


sw.C:
sw_SOURCES= sw.C
sw_LDADD= $(MIRALIBS)

mira.C: ciclean compileinfo.itxt
mira_SOURCES= mira.C
mira_LDADD= $(MIRALIBS)

convert_project.C:
convert_project_SOURCES= convert_project.C
convert_project_LDADD= $(MIRALIBS)

miramer.C:
miramer_SOURCES= miramer.C
miramer_LDADD= $(MIRALIBS)

mirazip.C: ciclean compileinfo.itxt
nodist_mirazip_SOURCES= mirazip.C
mirazip_LDADD= $(MIRALIBS)

dbgreplay_SOURCES= dbgreplay.C
dbgreplay_LDADD=  $(MIRALIBS)

uncover_at_SOURCES= uncover_at.C
uncover_at_LDADD= $(MIRALIBS)

miratest_SOURCES= miratest.C
miratest_LDADD= $(MIRALIBS)


fastatool_SOURCES= fastatool.C
fastatool_LDADD= -lmiradebuggersupport -lmiraerrorhandling  -lmirautil -lmirafio -lexpat -lmiradebuggersupport

scftool_SOURCES= scftool.C
scftool_LDADD=  $(MIRALIBS)

ace2caf_SOURCES= ace2caf.C
ace2caf_LDADD=  $(MIRALIBS)

tagsnp_SOURCES= tagsnp.C
tagsnp_LDADD=  $(MIRALIBS)
