######################################################################### 
#									# 
#   File: scorpion/src/showdep/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
BINDIR=/usr/local/scorpion/bin
INCDIR=/usr/local/scorpion/include
SPECSDIR=/usr/local/scorpion/src/specs
CC=cc
IDLC=$(BINDIR)/idlc
PC=pc
CFLAGS=-O -I$(INCDIR)
NO_CFLAGS=-I$(INCDIR)
IDLCFLAGS=-v
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
INSTALL=install

# LOCAL VARIABLES
CANDIR=$(SPECSDIR)/Candle
LIB=$(LIBDIR)/libidl.a
LINTLIB=$(LIBDIR)/lintlib/llib-llibidl.ln
IDLCFLAGSLOC=-I$(CANDIR) -C ShowDep.Cdl -nc -h -k
SRC=main.c ShowDep.idl
OBJ=main.o ShowDep.o
LINTSRC=main.c ShowDep.c

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

System: showdep

showdep: $(OBJ)
	$(CC) $(OBJ) $(LIB) -o showdep

ShowDep.h: ShowDep.idl $(CANDIR)/UNCCandle.idl $(CANDIR)/Candle.idl \
		 $(CANDIR)/CandleRep.idl $(CANDIR)/CandleSemantic.idl \
		 $(CANDIR)/CandleSyntax.idl
	$(IDLC) $(IDLCFLAGS) $(IDLCFLAGSLOC) ShowDep.idl

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

ShowDep.o : ShowDep.c ShowDep.h 
	if (test "$(MACHINE)" = "sun") then \
		$(CC) -c $(NO_CFLAGS) $*.c; \
	else \
		$(CC) -c $(CFLAGS) $*.c; \
	fi

main.o : main.c ShowDep.h 

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

Checkout:
	$(RM) test/showdeptest.out2
	$(MAKE) 'SPECSDIR=$(SPECSDIR)' 'BINDIR=$(BINDIR)' Checkout1
	$(BINDIR)/showdep <../idlc/test/test.Cdl >test/showdeptest.out2
	sh -c 'cmp -s test/showdeptest.out1 test/showdeptest.out2 &&(echo "files showdeptest.out1 showdeptest.out2 agree"; echo "showdep Passed Installation Check") || (echo "*** showdep Failed Installation Check") '

Checkout1:
	cd ../idlc/test; make -s 'SPECSDIR=$(SPECSDIR)' 'BINDIR=$(BINDIR)' test.Cdl

Clean:
	$(RM) *.o a.out core *.list *.Cdl

Ci:
	$(CI) $(SRC)

Co:
	$(CO) $(SRC)

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

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