#
# Makefile for scsilib
#

include MCONFIG


all:	$(LIBNAME)


SUBDIRS = opcodes lib

.PHONY: subdirs $(SUBDIRS)

subdirs: $(SUBDIRS)


$(SUBDIRS):
	$(MAKE) -C $@

.PHONY: $(LIBNAME)

$(LIBNAME): subdirs
	$(AR) rc $@ opcodes/*.o lib/*.o
	$(RANLIB) $@

test: $(LIBNAME)
	make -C test

clean: 
	make -C test clean
	make -C lib clean
	make -C opcodes clean
	find -name core -exec rm {} \;
	rm -f $(LIBNAME)

reallyclean: clean 
	find -name "\#*~" -exec rm {} \;

install: 

install_headers:


tar: reallyclean
	mkdir -p ../archive
	DIR=$$(basename $$(pwd)) ;\
	cd .. ; \
	tar -czpSlvf archive/$${DIR}-$$(date +%Y%m%d).tar.gz $${DIR}

