#Copyright (C) The University of Melbourne 1993
#All Rights Reserved

#Permission to use, copy, modify, and distribute this software and
#its documentation for any purpose and without fee is hereby
#granted, provided that the above copyright notice appear in all
#copies and that both that the copyright notice and this
#permission notice and warranty disclaimer appear in supporting
#documentation, and that the name of The University of Melbourne 
#or any of its entities not be used in advertising or publicity
#pertaining to distribution of the software without specific,
#written prior permission.

#THE UNIVERSITY OF MELBOURNE DISCLAIMS ALL WARRANTIES WITH REGARD
#TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
#MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL THE UNIVERSITY
#OF MELBOURNE OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
#SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
#IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
#ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
#THIS SOFTWARE.

#AUTHORS : Jason Lee (jasonl@cs.mu.oz.au)
#	   Andrew Davison (ad@cs.mu.oz.au)

# Makefile for bp and bebop utilities

#***************************************************************
# NOTE : WHEN CALLED FROM THE TOP LEVEL, ALL MACROS GET DEFINED
# SO DON'T EDIT THIS FILE ONLY THE TOP LEVEL MAKEFILE NEEDS TO
# BE CHANGED

SHELL =

NC=

INSTALLDIR=

VI=

# compilation rules
.SUFFIXES: .no .ns .nl

.nl.ns: ; $(NC) -S $*.nl
.ns.no: ; $(NC) -c $*.ns
.nl.no: ; $(NC) -c $*.nl

# files used
INTERP	=  bebop.nl

SINTERP	=  bebop.ns

OINTERP	=  bebop.no

SRCS	=  bound.nl call_class.nl demo.nl pcall.nl send.nl loadfiles.nl\
	   bebop_comp.nl flushwrite.nl

SOBJS	=  bound.ns call_class.ns demo.ns pcall.ns send.ns loadfiles.ns\
	   bebop_comp.ns flushwrite.ns

OBJS	= bound.no call_class.no demo.no pcall.no send.no loadfiles.no\
	  bebop_comp.no flushwrite.no

UTIL	= bebop_util.nl

SUTIL	= bebop_util.ns

OUTIL	= bebop_util.no

# force bp to be made each time
bp: $(OUTIL)
	$(NC) -c $(INTERP)
	$(NC) -o bp $(OUTIL) $(OINTERP)

$(OUTIL): $(SRCS) 
	 /bin/cat $(SRCS) > $(UTIL)
	 $(NC) -c $(UTIL)

install:
	$(VI) bp
	-/bin/cp $(INSTALLDIR)/bp $(INSTALLDIR)/bp.old
	-/bin/cp $(INSTALLDIR)/bp.save $(INSTALLDIR)/bp.save.old
	-/bin/cp $(INSTALLDIR)/$(OUTIL) $(INSTALLDIR)/$(OUTIL).old
	/bin/cp bp $(INSTALLDIR)
	/bin/cp bp.save $(INSTALLDIR)
	/bin/cp $(OUTIL) $(INSTALLDIR)

# Clean up some mess

clobber:
	-/bin/rm -f core errs
	-/bin/rm -f *.no 
	-/bin/rm -f *.ns 
	-/bin/rm -f $(UTIL)
	-/bin/rm -f bp*

clean :
	-/bin/rm -f core errs
	-/bin/rm -f *.no
	-/bin/rm -f *.ns
	-/bin/rm -f $(UTIL)

