SHELL	= /bin/sh
CC	= gcc
#CC	=g++
# uncomment the following for a static build
# OPT	= -O
OPT	= -O -Wall
DEBUG	= -g
CFLAGS	= $(DEFS) $(OPT) $(DEBUG)
LIBOBJ	= mymalloc.o strerror.o split_at.o tsk_endian.o \
    data_buf.o tsk_version.o tsk_error.o tsk_parse.o \
    tsk_unicode.o tsk_printf.o tsk_list.o md5c.o sha1c.o
LIB	= ../../lib/libtsk.a
BIN	= ../../bin
PROGS	= $(BIN)/md5 $(BIN)/sha1

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

all:	lib $(PROGS)

manpages: 

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

$(BIN)/md5: md5.o md5c.o
	$(CC) $(CFLAGS) -o $@ md5.o md5c.o

$(BIN)/sha1: sha1.o sha1c.o
	$(CC) $(CFLAGS) -o $@ sha1.o sha1c.o

indent:
	indent *.h *.c

clean:
	rm -f $(PROGS) *.o *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 - this was generated with make depend
data_buf.o: data_buf.c
data_buf.o: data_buf.c
tsk_endian.o: tsk_endian.c
tsk_endian.o: tsk_endian.c
tsk_unicode.o: tsk_unicode.c
tsk_printf.o: tsk_printf.c
mymalloc.o: mymalloc.c
mymalloc.o: mymalloc.c
split_at.o: split_at.c
split_at.o: split_at.c
strerror.o: strerror.c
strerror.o: strerror.c
tsk_version.o:tsk_version.c
tsk_error.o:tsk_error.c
tsk_parse.o:tsk_parse.c
tsk_list.o:tsk_list.c
