##############################################################
# Name: /home/users/otso/official/otso/tutorial/tut1/SCCS/s.Makefile
# Vers: 5.2    Time: 92/09/10, 10:48:23
#
# 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:	nada.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 (nada executable)
EXES =		nada.out
all:		$(EXES) inst-all

#install only
inst-all:	inst-nada

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


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

CFILES	=	nada.cxx
OFILES	=	nada.o

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


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

# OTSO_LIBES are the OTSO kernel libraries, macro defined in system.make

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

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

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

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


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