######################################################################### 
#									# 
#   File: scorpion/src/idldatacount/Makefile 
#				 					# 
#   Copyright (C) 1991 Karen Shannon
#									# 
#   The Scorpion System is free software in the public domain; you can  # 
#   redistribute it and/or modify it as you wish. We ask that you 	# 
#   retain credits referencing the University of Arizona and that you	# 
#   identify any changes you make.					# 
#									# 
#   Report problems to scorpion-project@cs.arizona.edu			# 
#   Direct all inquiries to:	The Scorpion Project			# 
#				Department of Computer Science		# 
#				Gould-Simpson Building			# 
#				University of Arizona			# 
#				Tucson, AZ 85721			# 
#				U.S.A.					# 
#									# 
#   Revision Log:							# 
#	$Log:$ 
#									# 
#   Edit Log:								# 
#     Jan 9 1985 (shannon) Created.					# 
#									# 
######################################################################### 

# IMPORTED VARIABLES
SHELL=/bin/sh
LIBDIR=/usr/local/scorpion/lib
INCDIR=/usr/local/scorpion/include
SRCDIR=..
BINDIR=/usr/local/scorpion/bin
SPECSDIR=/usr/local/scorpion/src/specs
CC=cc
IDLC=$(BINDIR)/idlc
PC=pc
CFLAGS=-I$(INCDIR)
IDLCFLAGS=
PFLAGS=
CP=cp
MV=mv
RM=rm -f
LEX=lex
MAKE=make
YACC=yacc

LINT=/usr/bin/lint
LINTINC=-I$(INCDIR)
LINTFLAGS=-abx

UTILITYVARS='CC=$(CC)' 'IDLC=$(IDLC)' 'PC=$(PC)' 'CFLAGS=$(CFLAGS)' \
	      'IDLCFLAGS=$(IDLCFLAGS)' 'PFLAGS=$(PFLAGS)' 'CP=$(CP)' \
	      'MV=$(MV)' 'RM=$(RM)' 'LEX=$(LEX)' 'MAKE=$(MAKE)' \
	      'YACC=$(YACC)'
CI=ci
CO=co -l

# LOCAL VARIABLES
OBJ=main.o incfile.o
LIB=$(LIBDIR)/libidl.a
LINTLIB=$(LIBDIR)/lintlib/llib-llibidl.ln
IDLCFLAGSLOC=-I$(SPECSDIR) -nc -h -k
LINTSRC=main.c incfile.c idldatacount.c

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

System: idldatacount

idldatacount: idldatacount.o $(OBJ) 
	$(CC) $(CFLAGS) -o idldatacount $(OBJ) idldatacount.o $(LIB)

idldatacount.h: idldatacount.idl
	$(IDLC) $(IDLCFLAGS) $(IDLCFLAGSLOC)  idldatacount.idl

.c.o:
	$(CC) -c $(CFLAGS) $*.c

idldatacount.o : idldatacount.c idldatacount.h
incfile.o : incfile.c idldatacount.h
main.o : main.c idldatacount.h

Checkout:
	make 'BINDIR=$(BINDIR)' 'DOCDIR=$(DOCDIR)' Checkout1
	$(BINDIR)/idldatacount <$(DOCDIR)/examples/billing/C/billing.Cdl >test/idldatacounttest.out2
	sh -c 'cmp -s test/idldatacounttest.out1 test/idldatacounttest.out2 &&(echo "files idldatacounttest.out1 idldatacounttest.out2 agree"; echo "idldatacount Passed Installation Check") || (echo "*** idldatacount Failed Installation Check") '

Checkout1:
	cd $(DOCDIR)/examples/billing/C; make -s 'BINDIR=$(BINDIR)' billing.h

Install:
	$(RM) $(BINDEST)/idldatacount
	$(INSTALL) idldatacount $(BINDEST)

Clean:
	$(RM) *.o a.out core *.list *.Cdl
Ci:
	$(CI) idldatacount.idl main.c

Co:
	$(CO) idldatacount.idl main.c

DelSrc:
	$(RM) *.c *.h *.idl

Lint:
	$(LINT) $(LINTFLAGS) $(LINTINC) $(LINTLIB) $(LINTSRC)
