######################################################################### 
#									# 
#   File: scorpion/src/idlc/semassert/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:								# 
#									# 
######################################################################### 

# IMPORTED VARIABLES
SHELL=/bin/sh
INCDIR=/usr/local/scorpion/include
BINDIR=/usr/local/scorpion/bin
LIBDIR=/usr/local/scorpion/lib
SPECSDIR=/usr/local/scorpion/src/specs

CC=cc
IDLC=$(BINDIR)/idlc
PC=pc
CFLAGS=-I$(INCDIR)
NO_CFLAGS=-I$(INCDIR)
IDLCFLAGS=-v
PFLAGS=
CP=cp
MV=mv
RM=rm -f
LEX=lex
MAKE=make
MACHINE=sparc
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=

# LOCAL VARIABLES
CANDIR=$(SPECSDIR)/Candle
UNCCANDIR=../specs
LIB=$(LIBDIR)/libidl.a $(LIBDIR)/liberr.a
LINTLIB=$(LIBDIR)/lintlib/llib-llibidl.ln $(LIBDIR)/lintlib/llib-lliberr.ln
IDLCFLAGSLOC=-I$(CANDIR) -S -I$(SPECSDIR) -I$(UNCCANDIR) -nc -k -h
IDLFILES=$(CANDIR)/CandleSyntax.idl $(CANDIR)/CandleSemantic.idl \
	   $(CANDIR)/Candle.idl $(CANDIR)/CandleContext.idl \
	   $(UNCCANDIR)/UNCCandleSemantic.idl SemAssert.idl

OBJ=symbol.o symbol2.o symbol3.o symbol4.o errhand.o main.o \
	analyze.o init.o types.o debug.o expand.o

SRC=symbol.c symbol2.c symbol3.c symbol4.c errhand.c main.c \
	analyze.c init.c types.c debug.c expand.c SemAssert.idl macros.h

LINTSRC=symbol.c symbol2.c symbol3.c symbol4.c errhand.c main.c\
	analyze.c init.c types.c debug.c expand.c \
	SemAssert1.c SemAssert2.c SemAssert3.c

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

IDLsa2 : $(OBJ) SemAssert1.o SemAssert2.o SemAssert3.o
	$(CC) -o IDLsa2 $(CFLAGS) $(OBJ) SemAssert1.o SemAssert2.o SemAssert3.o $(LIB)

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

SemAssert1.o SemAssert2.o SemAssert3.o:
	if (test "$(MACHINE)" = "sparc") then \
		$(CC) -c $(NO_CFLAGS) $*.c ; \
	else \
		$(CC) -c $(CFLAGS) $*.c ; \
	fi

SemAssert1.o : SemAssert.h 
SemAssert2.o : SemAssert.h 
SemAssert3.o : SemAssert.h 
analyze.o : SemAssert.h macros.h error.h 
debug.o : SemAssert.h 
errhand.o : error.h 
expand.o : SemAssert.h macros.h error.h 
init.o : SemAssert.h 
main.o : SemAssert.h macros.h error.h 
symbol.o : SemAssert.h macros.h error.h 
symbol2.o : SemAssert.h macros.h error.h 
symbol3.o : SemAssert.h macros.h error.h 
symbol4.o : SemAssert.h macros.h error.h 
types.o : SemAssert.h macros.h error.h 

SemAssert.h : $(IDLFILES)
	$(IDLC) $(IDLCFLAGS) $(IDLCFLAGSLOC) SemAssert.idl 

System: IDLsa2

Install:
	$(RM) $(LIBDEST)/IDLsa2
	$(INSTALL) IDLsa2 $(LIBDEST)

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

Ci:
	$(CI) $(SRC) Makefile
Co:
	$(CO) $(SRC)
Copy:
	mkdir $(COPYDIR)/semassert
	$(CP) $(SRC) SemAssert.c SemAssert.h README $(COPYDIR)/semassert

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

Lint:
	$(LINT) $(LINTFLAGS) -DDEBUG -DDEBUG2 $(LINTINC) $(LINTLIB) $(LINTSRC)
