##############################################################
# Name: /home/users/otso/official/otso/tutorial/tut2/SCCS/s.Makefile
# Vers: 5.3    Time: 92/09/03, 14:11:59
#
# Copyright (c) 1992      Technical Research Centre of Finland (VTT)
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that this notice and the reference to this notice appearing in each software
# module be retained unaltered, and that the name of any contributors shall not
# be used in advertising or publicity pertaining to distribution of the software
# without specific written prior permission.  No contributor makes any
# representations about the suitability of this software for any purpose.
# It is provided "as is" without any express or limited warranty.
#
#			NO WARRANTY
#
# ALL CONTRIBUTORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS.  IN NO
# EVENT SHALL ANY CONTRIBUTOR BE LIABLE FOR ANY SPECIAL, PUNITIVE, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA, OR PROFITS, WHETHER IN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH, THE USE OR PERFORMANCE
# OF THIS SOFTWARE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THIS
# SOFTWARE IS WITH YOU.  SHOULD THIS SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE
# COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
#
# As used above, "contributor" includes, but is not limited to :
#        The Technical Research Centre of Finland
#############################################################################

###############################################################################
#   Instructions to Make, to compile an example program.
###############################################################################


###############################################################################
#
# NOTES
#
# This is a sample makefile for using OTSO.
#  - it makes an executable:	demo.out
#  - it installs the executable to an official OTSO directory.
#  'make' command for this Makefile:
#	exec /bin/make TOPDIR=$OTSO 		\
#		-f $OTSO/system/system.make	\
#		-f $OTSO/include/headers.make 	\
#		-f ./Makefile 
#
#   $OTSO/system/system.make contains macros 
#	to define OTSO directories and compiler commands:
#	e.g. $(LIBDIR), $(UTILDIR), $(BINDIR), etc.
#
#   $OTSO/include/headers.make contains macros 
#	to define groups of header files that a class depends on.
#	This makes it easier for others to write makefiles, since
#	they can use these macros in their local makefiles.
#	e.g.  see $(RUNNERH) below
#
###############################################################################

# default is for OTSO to just say:
#	system.make:	g++ compiling  .....
# uncomment QUIET_CXX (defined in system.make) to see exactly what 
#   goes on during C++ compiling.
#QUIET_CXX =	$(NICE) $(CXX)

###############################################################################
# GENERAL TARGETS
###############################################################################

# 		make everything (demo executable)
EXES =		demo.out
all:		$(EXES) inst-all

#		install only
inst-all:	inst-demo

#		install and clean-up
install:	inst-all clean


###############################################################################
# FILE DEPENCIES
###############################################################################

CFILES	=	demo.cxx
OFILES	=	demo.o

demo.o:	demo.cxx $(RUNNERH)
demo.cxx:	demo.cx


###############################################################################
# ACTION DEPENDENCIES
###############################################################################

demo.out:	$(OFILES) $(OTSO_LIBES)
		$(LDXX) $(OFILES) $(OTSO_LIBES) $(SYSTEM_LIBES) -o demo.out

inst-demo:	demo.out
		-@echo --- Installing: demo.out to $(BINDIR)
		-rm -f $(BINDIR)demo.out 
		-ln demo.out $(BINDIR)demo.out

###############################################################################
# clean up
###############################################################################

clean:;		-rm -f $(CLEANSTRINGS) demo.cxx demo.hxx demo.out


# remove executables so we don't have huge tar files
tar-clean:	clean
		-rm -f $(EXES)
