# $Id: src.lib.Makefile,v 1.4 1992/05/13 09:16:48 cogito Exp $
# make library "lib.a", which consists of standard COMAR functions
# and a bitset module 
# 
DESTDIR = /tmp
DISTRIB = /tmp

IDL = ../idl

SRC = cmrlib.c cmrio.c bitset.c
OBJ = cmrlib.o cmrio.o bitset.o
HDR = cmrlib.h cmrio.h bitset.h cmrinternal.h

# causes additional tests which can be helpful to search bugs
# ALLDEB = -DDEBUG_LIB -DDEBUG_BIT

CFLAGS =  $(ALLDEB) -I$(IDL)

TIDY    = core a.out  *% *.o ERRS lintmsg
CLEAN   = $(TIDY) *.exe *.a
CLOBBER = $(CLEAN)

###########################################################################

all:	lib.a

install: lib.a

distrib:        $(SRC) $(HDR)
	@if test ! -d $(DISTRIB)/lib; \
		then umask 002; mkdir $(DISTRIB)/lib; \
		else :;\
		fi
	cp $(SRC) $(HDR) Makefile $(DISTRIB)/lib
	cd $(DISTRIB)/lib; chmod 0644 $(SRC) $(HDR) Makefile

tidy:
	rm -f $(TIDY)

clean:
	rm -f $(CLEAN)

clobber:
	rm -f $(CLOBBER)

###########################################################################

lib.a:  $(OBJ)
	rm -f lib.a
	ar cru lib.a $(OBJ)
	ranlib lib.a

cmrlib.o: $(IDL)/comar.h $(IDL)/comar_func.h cmrlib.h cmrinternal.h

cmrio.o:  $(IDL)/comar.h cmrlib.h cmrio.h

bitset.o: bitset.h


###########################################################################
lint:
	lint $(CFLAGS) $(SRC) >! lintmsg

