# RCSid: $Header: /rcs/vcom/sbeux/Makefile,v 1.2 91/09/13 15:15:51 root Rel $

#-----------------------------------------------------------------------------
# Makefile - baseline make, drives others
#
# Copyrighted as an unpublished work.
# (c) Copyright 1991 SBE, Inc. and by other vendors under license agreements.
# All Rights Reserved.
#-----------------------------------------------------------------------------
# RCS info:
# RCS revision: $Revision: 1.2 $
# Last changed on $Date: 91/09/13 15:15:51 $
# Changed by $Author: root $
#-----------------------------------------------------------------------------
# $Log:	Makefile,v $
# Revision 1.2  91/09/13  15:15:51  root
# Make DPARMS string a passed literal.
# 
# Revision 1.1  91/05/28  06:21:50  rld
# SBEUX makes both TCPIP and X.25 products.
# 
# Revision 1.0  91/03/07  14:43:24  root
# Initial revision
# 
# Revision 1.7  91/03/07  14:39:45  root
# Remove clean/clobber of install directory.  This was moved
# to vcutils.
# 
#-----------------------------------------------------------------------------
#

##############################################################################
# A specific system will have any special parameters defined via the DPARMS
# variable.  Special kernel generation parameters will not be included here
# but will exist in "io/Makefile".

SYSTEM=VPU30
PRODUCT1=SBE_TCPIP
PRODUCT2=SBE_X25

DPARMS='"-D$(SYSTEM) -D$(PRODUCT1) -D$(PRODUCT2)"'

##############################################################################
# The exhastive set of utilities and demonstration programs for this system.

UTILS = x25utils/lib \
	x25utils/pad \
	x25utils/vcomdl \
	x25utils/x25stat \
	x25utils/xcf \
	vcutils/getmjr
DEMO  = x25utils/x25demo/lapb \
	x25utils/x25demo/wan \
	x25utils/x25demo/x25
MISC  = etc \
	stand \
	mkdev

all:  driver utils demo

#=============================================================================
# INSTALLATION SECTION
# NOTE: demo programs are NOT installed ...

install: all misc
	@echo ">> Installing VCOM driver and utilities ..."
	@cd io ; make install ; cd ..
	@for TARGET in $(UTILS) ; \
	do \
		echo "$$TARGET: " ; \
		if [ -d $$TARGET ] ; \
		then \
			(cd $$TARGET ; make DPARMS=$(DPARMS) install); \
		fi \
	done
	@echo ">> Installation script completed."

misc:
	@echo ">> Installing Miscellaneous files ..."
	@for TARGET in $(MISC) ; \
	do \
		echo "$$TARGET: " ; \
		(cd install ; sh install.sh $$TARGET) ; \
	done

#=============================================================================
# COMPILATION SECTION

driver:
	@echo ">> Compiling VCOM driver ..."
	@echo "driver: " ; cd io ; make DPARMS=$(DPARMS)

# Note that presence of a directory is checked.  Not all utilities
# may be available on all platforms or purchase agreements.
utils:
	@echo ">> Compiling VCOM utilities ..."
	@for TARGET in $(UTILS) ; \
	do \
		echo "$$TARGET: " ; \
		if [ -d $$TARGET ] ; \
		then \
			(cd $$TARGET ; make DPARMS=$(DPARMS) all) ; \
		else \
			echo "    $$TARGET not available." ; \
		fi \
	done

# Note that presence of a directory is checked.  Not all demo programs
# may be available on all platforms or purchase agreements.
demo:
	@echo ">> Compiling VCOM demonstration programs ..."
	@for TARGET in $(DEMO) ; \
	do \
		echo "$$TARGET: " ; \
		if [ -d $$TARGET ] ; \
		then \
			(cd $$TARGET ; make DPARMS=$(DPARMS) all) ; \
		else \
			echo "    $$TARGET not available." ; \
		fi \
	done

#=============================================================================
# CLEAN and CLOBBER SECTION

clean:
	@echo ">> Cleaning ..."
	@echo "driver: " ; (cd io ; make clean)
	@for TARGET in $(UTILS) $(DEMO) ; \
	do \
		echo "$$TARGET: " ; \
		if [ -d $$TARGET ] ; \
		then \
			(cd $$TARGET ; make clean) ; \
		fi \
	done

clobber:
	@echo ">> Clobbering ..."
	@echo "driver: " ; (cd io ; make clobber)
	@for TARGET in $(UTILS) $(DEMO) ; \
	do \
		echo "$$TARGET: " ; \
		if [ -d $$TARGET ] ; \
		then \
			(cd $$TARGET ; make clobber) ; \
		fi \
	done

#=============================================================================

# --- End-of-file --- #
