# 
# Makefile for ffwindex
#

C++ = g++
OPTIONS = -g
BINDIR = ../bin

CFLAGS = -I../lib/src
LDFLAGS = -L../lib -lffw

SOURCE_FILES = main.cc
TMP = $(SOURCE_FILES:.c=.o)
OBJS = $(TMP:.cc=.o)

.SUFFIXES: .cc .c .o
SHELL=/bin/sh

.cc.o:
	$(C++) -c $(CFLAGS) $(OPTIONS) $<

all: ffwindex

ffwindex: $(OBJS) ../lib/libffw.a
	$(C++) -o ffwindex $(OPTIONS) $(OBJS) $(LDFLAGS)

purify: $(OBJS) ../lib/libffw.a
	purify -first-only -g++ \
	    -collector=/usr/local/gnu/lib/gcc-lib/sun4/2.4.3/ld \
	    $(C++) -o ffwindex $(OBJS) $(LDFLAGS)

install: ffwindex
	-mkdir $(BINDIR)
	install -m 755 ffwindex $(BINDIR)

depend:
	makedepend -s "# DO NOT DELETE" -- $(CFLAGS) $(OPTIONS) \
	           -- $(SOURCE_FILES)

noinc:
	sed -e "/^# DO NOT DELETE/,$$ d" Makefile > /tmp/ffwM
	mv /tmp/ffwM Makefile

clean:
	-/bin/rm -f *.o core *~ ffwindex *.bak \#*


