######################################################################### 
#									# 
#   File: scorpion/src/IDLlib/libidlP/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
INCDIR=/usr/local/scorpion/include
AR=ar ru
CAT=cat
CC=cc
IDLC=$(BINDIR)/idlc
PC=pc
CFLAGS=-I$(INCDIR)/C
IDLCFLAGS=
PFLAGS=-w
D_PFLAGS=-w -g
CP=cp
MV=mv
RM=rm -f
LEX=lex
MAKE=make
RANLIB=ranlib
SED=sed
YACC=yacc
CI=ci
CO=co -l
UTILITYVARS='AR=$(AR)' 'CC=$(CC)' 'IDLC=$(IDLC)' 'PC=$(PC)' 'CFLAGS=$(CFLAGS)' \
              'IDLCFLAGS=$(IDLCFLAGS)' 'PFLAGS=$(PFLAGS)' 'CP=$(CP)' \
              'MV=$(MV)' 'RM=$(RM)' 'LEX=$(LEX)' 'MAKE=$(MAKE)' \
              'YACC=$(YACC)' 'MACHINE=$(MACHINE)' 'SED=$(SED)' 'SHELL=$(SHELL)'\
              'LINT=$(LINT)' 'RANLIB=$(RANLIB)'

# LOCAL VARIABLES
LIBRARYOUTFILE=libidlP.a
PINCDIR=$(INCDIR)/Pascal
PINCDIRR=$(PINCDIR)
PFLAGSLOC=-I$(PINCDIR)
SRC=writer.p string.p
OFILES=writer.o string.o
DEBUGOBJ=

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

System: $(OFILES)
	$(AR) $(LIBRARYOUTFILE) $(OFILES)
	$(RANLIB) $(LIBRARYOUTFILE)

DebugLibrary:
	$(MAKE) -f Makefile 'PFLAGS=$(D_PFLAGS)' $(UTILITYVARS) \
		'LIBRARYOUTFILE=libidlPdebug.a' System

Install:
	$(RM) $(LIBDEST)/libidlP*.a
	$(CP) libidlP*.a $(LIBDEST)
	cd $(LIBDEST); \
	    if (test "$(MACHINE)" = "sparc" -o "$(MACHINE)" = "sun" ) then \
		$(RANLIB) -t libidlP*.a; \
	    else \
		$(RANLIB) libidlP*.a; \
	    fi;

string.o: $(PINCDIR)/global2.h $(PINCDIR)/global3.h
	$(CAT) string.p | \
	$(SED) '   s,include ".*global,include "$(PINCDIRR)/global,' > \
		string.temp
	$(MV) string.temp string.p
	$(PC) -c $(PFLAGS) $(PFLAGSLOC) string.p

writer.o: $(PINCDIR)/global2.h $(PINCDIR)/writer.h
	$(CAT) writer.p | \
	$(SED) '   s,include ".*global,include "$(PINCDIRR)/global,' | \
		sed '   s,include ".*writer,include "$(PINCDIRR)/writer,' > \
		writer.temp
	$(MV) writer.temp writer.p
	$(PC) $(PFLAGS) $(PFLAGSLOC)  -c writer.p

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

Ci:
	$(CI) $(SRC)

Co:
	$(CO) $(SRC)

Copy:
	mkdir $(COPYDIR)/lib
	$(CP) $(SRC) Makefile README $(COPYDIR)/lib

DelSrc:
	$(RM) *.p *.h *.i *.idl
