.key DEST,INCLUDE/K,NETLIB/K,TARGET/K,INSTALL/S,ALL/S,APPL/S,AMITCP/S,DEVS/S,UTIL/S
;;; $Id: compile,v 1.6 1993/11/19 02:11:10 ppessi Exp $
;;;
;;; Compile AmiTCP distribution with SAS C
;;;
;;; Copyright (c) 1993 AmiTCP-Group, <AmiTCP-Group@hut.fi>
;;;                    Helsinki University of Technology, Finland.
;;;
;;; Created      : Thu Oct 14 01:59:00 1993 ppessi
;;; Last modified: Fri Nov 19 03:14:57 1993 ppessi
;;;
;;; $Log: compile,v $
;;; Revision 1.6  1993/11/19  02:11:10  ppessi
;;; quit -> echo
;;;
;;; Revision 1.5  1993/11/17  12:58:02  ppessi
;;; Implemented the APPL, AMITCP, UTIL and DEVS flags.
;;; Removed netlib compilation
;;;
;;; Revision 1.4  1993/11/15  12:06:40  ppessi
;;; Added TARGET/K, now really *using* INSTALL/S
;;;
;;; Revision 1.3  1993/10/23  01:19:06  ppessi
;;; Added -k flag to smake
;;;
;;; Revision 1.2  1993/10/14  00:02:04  ppessi
;;; Added devs and appl directories, renamed src to amitcp.
;;; Added install targets, DEST and INCLUDE directories.
;;;
;;;
.bra {
.ket }
.def DEST "AmiTCP:"

If NOT {NETLIB$IsNotGiven} EQ IsNotGiven
    If Exists {NETLIB> 
	Assign netlib: {NETLIB}
    Endif
Else
    Assign Netlib: exists > nil:
    If WARN 
	echo "The NETLIB: does not exist"
	echo "Can't continue"
	quit
    Endif
Endif

If NOT {INCLUDE$IsNotGiven} EQ IsNotGiven
    If Exists "{INCLUDE}" 
	assign netinclude: {INCLUDE}
    ENDIF
Else
    Assign Netinclude: exists > nil:
    If WARN 
	echo "The NETINCLUDE: does not exist"
	echo "Can't continue"
	quit
    Endif
ENDIF

Set APPL={APPL$X}
Set AMITCP={AMITCP$X}
Set DEVS={DEVS$X}
Set UTIL={UTIL$X}

If NOT {ALL$X} EQ X 
    Set APPL=APPL
    Set AMITCP=AMITCP
    Set DEVS=DEVS
    Set UTIL=UTIL
Endif

IF $APPL EQ APPL
    echo Make applications
    cd appl
    smake -k DEST={DEST} {target}  {install}
    cd /
Endif

IF $AMITCP EQ AMITCP
    echo Make protocol stack
    cd amitcp
    smake gst
    smake -k DEST={DEST} {target}  {INSTALL}
    cd /
Endif

If $DEVS EQ DEVS
    echo Make network utilities
    cd util
    smake -k DEST={DEST} {target}  {INSTALL}
    cd /
Endif

If $UTIL EQ UTIL
    echo Make network devices
    cd devs
    smake -k DEST={DEST} {target}  {INSTALL}
    cd /
Endif
