CC=gcc

CFLAGS= -O3 -g -Wall -Wshadow -pedantic   -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -m64 
#CFLAGS= -g -Wall -Wshadow -pedantic -DSTRMAT -DSTATS
#CFLAGS= -O3 -DSTRMAT -DSTATS


#
# The source files, object files, libraries and executable name.
#
SRCFILES= shustring.c sequenceData.c interface.c stringUtil.c eprintf.c \
	shulen.c findShustring.c hash.c

OBJFILES= shustring.o sequenceData.o interface.o stringUtil.o eprintf.o \
	shulen.o  findShustring.o hash.o DeepShallow/ds_ssort.a

LIBS= -lm DeepShallow/ds_ssort.a DeepShallow/bwtlcp.a

EXECFILE= shustring
DIRECTORY= Shustring
VERSION= 2.6
#
# The make rule for the executable
#
$(EXECFILE) : $(OBJFILES)
	$(CC) $(CFLAGS) -o $(EXECFILE) $(OBJFILES) $(LIBS)

DeepShallow/ds_ssort.a:
	cd DeepShallow; make

DeepShallow/bwtlcp.a:
	cd DeepShallow; make
#
# The dependencies for each of the *.o files.
#


#
# Other Standard make rules
#

lint : 
	lint $(SRCFILES) | more

clean:
	rm -f *.o *~
realClean:
	rm -f *.o *~
	cd DeepShallow; make clean

remove: clean
	rm -f $(EXECFILE)

tarfile:
	mkdir $(DIRECTORY)_$(VERSION)
	cp -rf *.c *.h Makefile COPYING README $(DIRECTORY)_$(VERSION)
	mkdir $(DIRECTORY)_$(VERSION)/DeepShallow/
	cp DeepShallow/Makefile DeepShallow/*.txt DeepShallow/README DeepShallow/*.c DeepShallow/*.h $(DIRECTORY)_$(VERSION)/DeepShallow/
	tar cvzf $(EXECFILE)_$(VERSION).tgz $(DIRECTORY)_$(VERSION)
	mv $(EXECFILE)_$(VERSION).tgz ../
	/bin/rm -r $(DIRECTORY)_$(VERSION)
