SHELL	= /bin/sh
CC	= gcc
#CC	= g++
OPT	= -O -Wall
DEBUG	= -g
BIN	= ../../bin
PROGS	= $(BIN)/hfind
CFLAGS	= $(DEFS) $(INCL) $(OPT) $(DEBUG) -I. -I../auxtools $(XFLAGS)

LIBOBJ  = tm_lookup.o nsrl_index.o md5sum_index.o hk_index.o idxonly_index.o
LIB = ../../lib/libtsk.a

defs:
	@CC="$(CC)" sh ../makedefs $(MAKE)

all:    lib $(PROGS)

lib: 	$(LIBOBJ)
	$(AR) $(LIB) $?
	$(RANLIB) $(LIB)

$(BIN)/hfind: hfind.o $(LIB)
	$(CC) $(CFLAGS) -o $@ hfind.o $(LIB)

indent:
	indent *.c *.h

clean:
	rm -f $(PROGS) *.o core *.core *~

depend: $(MAKES)
	(sed '1,/^# do not edit/!d' Makefile; \
	set -e; for i in [a-z][a-z0-9]*.c; do \
	    $(CC) -E $(DEFS) $(INCL) $$i | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
	    -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' -e 'p' -e '}'; \
	done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile

# do not edit below this line - it is generated by 'make depend'
hfind.o: hfind.c
hfind.o: hashdb_tools.h
hk_index.o: hk_index.c
hk_index.o: hashdb_tools.h
md5sum_index.o: md5sum_index.c
md5sum_index.o: hashdb_tools.h
nsrl_index.o: nsrl_index.c
nsrl_index.o: hashdb_tools.h
idxonly_index.o: idxonly_index.c
idxonly_index.o: hashdb_tools.h
tm_lookup.o: tm_lookup.c
tm_lookup.o: hashdb_tools.h
