include ../cpuopt.mk
CC=g++  
CFLAGS=-O6 $(CPUOPT)
ASSEMBLER=gcc -c 
OBJS=chnhash.o sha.o sha1.o
ASMOBJS=sha1.ao
INCLDIR=../
LIBDIR=../lib
LIBNAME=ch
EXECUTABLES=
HEADERS=lcirc.hxx lcirc.inl chnhash.hxx sha.hxx sha1.hxx sha1.inl 

lib$(LIBNAME).a:	$(OBJS) $(ASMOBJS)
	ar cr lib$(LIBNAME).a $(ASMOBJS) $(OBJS) ; ranlib lib$(LIBNAME).a

chnhash.o:    chnhash.cxx chnhash.hxx
	$(CC) $(CFLAGS) -c chnhash.cxx -I$(INCLDIR)

sha.o:	chnhash.hxx sha.hxx sha.cxx
	$(CC) $(CFLAGS) -c sha.cxx -I$(INCLDIR)

sha1.o:	chnhash.hxx sha.hxx sha1.hxx sha1.inl sha1.cxx
	$(CC) $(CFLAGS) -c sha1.cxx -I$(INCLDIR)

sha1.ao:	sha1.S
	$(ASSEMBLER) -o sha1.ao sha1.S -I$(INCLDIR)

install-lib:	lib$(LIBNAME).a
	cp lib$(LIBNAME).a $(LIBDIR)/lib$(LIBNAME).a 

install-headers:
	for HFILE in $(HEADERS) ; \
	do  ( cp $$HFILE ../include/chnhash/ ) ; \
	done

install:	install-lib install-headers

clean:
	rm -f *~ *.o *.ao core lib$(LIBNAME).a $(EXECUTABLES) 

dist-clean:	clean 
