FLAGS = -O9 
#FLAGS = -O9 -DQUERYREPORT 
#FLAGS = -O9 -DQUERYTIME 
#FLAGS = -O9 -DINDEXREPORT 
#FLAGS = -O9 -DINDEXREPORT -DMEMCTRL

all: indexshell searchshell flyshell demoshell

searchshell: searchshell.o search.o lzindex.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o persist.o
	gcc $(FLAGS) -o searchshell searchshell.o search.o lzindex.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o persist.o
indexshell: indexshell.o index.o lzindex.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o persist.o
	gcc $(FLAGS) -o indexshell indexshell.o index.o lzindex.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o persist.o
flyshell: flyshell.o index.o search.o lzindex.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o
	gcc $(FLAGS) -o flyshell flyshell.o index.o search.o lzindex.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o
demoshell: demoshell.o index.o search.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o
	gcc $(FLAGS) -o demoshell demoshell.o index.o search.o lzindex.o lztrie.o revtrie.o nodemap.o trie.o parentheses.o bitmap.o hash.o heap.o basics.o

searchshell.o: searchshell.c
	gcc $(FLAGS) -c searchshell.c
indexshell.o: indexshell.c
	gcc $(FLAGS) -c indexshell.c
flyshell.o: flyshell.c
	gcc $(FLAGS) -c flyshell.c
demoshell.o: demoshell.c
	gcc $(FLAGS) -c demoshell.c
index.o: index.c
	gcc $(FLAGS) -c index.c
search.o: search.c
	gcc $(FLAGS) -c search.c
persist.o: persist.c
	gcc $(FLAGS) -c persist.c
lzindex.o: lzindex.c
	gcc $(FLAGS) -c lzindex.c
lztrie.o: lztrie.c
	gcc $(FLAGS) -c lztrie.c
revtrie.o: revtrie.c
	gcc $(FLAGS) -c revtrie.c
nodemap.o: nodemap.c
	gcc $(FLAGS) -c nodemap.c
trie.o: trie.c
	gcc $(FLAGS) -c trie.c
heap.o: heap.c
	gcc $(FLAGS) -c heap.c 
parentheses.o: parentheses.c
	gcc $(FLAGS) -c parentheses.c
bitmap.o: bitmap.c
	gcc $(FLAGS) -c bitmap.c
hash.o: hash.c
	gcc $(FLAGS) -c hash.c
basics.o: basics.c
	gcc $(FLAGS) -c basics.c 

basics.h: makefile
	touch basics.h
bitmap.h: basics.h
	touch bitmap.h
hash.h: basics.h
	touch hash.h
lzindex.h: lztrie.h revtrie.h nodemap.h
	touch lzindex.h
lztrie.h: basics.h parentheses.h
	touch lztrie.h
nodemap.h: basics.h lztrie.h
	touch nodemap.h
parentheses.h: basics.h bitmap.h hash.h
	touch parentheses.h
revtrie.h: basics.h parentheses.h lztrie.h nodemap.h
	touch revtrie.h
persist.h: lzindex.h
	touch persist.h
index.h: lzindex.h
	touch index.h
search.h: lzindex.h
	touch search.h
trie.h: basics.h heap.h
	touch trie.h
heap.h: basics.h
	touch heap.h

searchshell.c: search.h persist.h
	touch searchshell.c
indexshell.c: index.h persist.h
	touch indexshell.c
flyshell.c: index.h search.h
	touch flyshell.c
demoshell.c: index.h search.h
	touch flyshell.c
basics.c: basics.h
	touch basics.c
hash.c: hash.h
	touch hash.c
bitmap.c: bitmap.h
	touch bitmap.c
index.c: index.h trie.h
	touch index.c
persist.c: persist.h
	touch persist.c
lzindex.c: lzindex.h
	touch lzindex.c
lztrie.c: lztrie.h
	touch lztrie.c
nodemap.c: nodemap.h
	touch nodemap.c
parentheses.c: parentheses.h
	touch parentheses.c
revtrie.c: revtrie.h
	touch revtrie.c
search.c: search.h
	touch search.c
shell.c: index.h search.h
	touch shell.c
trie.c: trie.h
	touch trie.c
heap.c: heap.h
	touch heap.c
