#==============================================================================
#                                  Makefile
#------------------------------------------------------------------------------
# Main makefile for Tcl SIPP.  It has the following targets:
#    o all - Compile and link the tsipp interpreter (default).
#    o test - Run the standard tests.
#    o clean - Remove all generated files.
#    o buildhelp - Build the help files.
#    o demo - Generate the demo pictures.
#------------------------------------------------------------------------------

include Config.mk

SHELL=/bin/sh
BUILDHELP=tsipp -c "load buildhelp.tcl"

#-----------------------------------------------------------------------------

all:
	cd sippsrc;$(MAKE) -$(MAKEFLAGS) all
	cd src;$(MAKE) -$(MAKEFLAGS) all

#-----------------------------------------------------------------------------

buildhelp:
	-mkdir help 2>/dev/null
	cd help ; rm -rf *
	$(BUILDHELP) -b sipp.brf help man/tsipp.man

#-----------------------------------------------------------------------------

test: all
	cd tests;$(MAKE) -$(MAKEFLAGS) test

#-----------------------------------------------------------------------------

demo: all
	cd demos;$(MAKE) -$(MAKEFLAGS) demo

#-----------------------------------------------------------------------------

clean: 
	rm -rf help
	rm -f $(OBJS) tsipp core
	cd src;$(MAKE) -$(MAKEFLAGS) clean
	cd sippsrc;$(MAKE) -$(MAKEFLAGS) clean
	cd tests;$(MAKE) -$(MAKEFLAGS) clean
	cd demos;$(MAKE) -$(MAKEFLAGS) clean
