/*
 * Copyright 1993 Network Computing Devices, Inc.
 *
 * Permission to use, copy, modify, distribute, and sell this software and
 * its documentation for any purpose is hereby granted without fee, provided
 * that the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name Network Computing Devices, Inc. not be
 * used in advertising or publicity pertaining to distribution of this 
 * software without specific, written prior permission.
 * 
 * THIS SOFTWARE IS PROVIDED `AS-IS'.  NETWORK COMPUTING DEVICES, INC.,
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
 * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL NETWORK
 * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING
 * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA,
 * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
 * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 * 
 * $NCDId: @(#)Imakefile,v 1.10 1994/05/09 17:53:17 greg Exp $
 */

XCOMM $NCDId: @(#)Imakefile,v 1.10 1994/05/09 17:53:17 greg Exp $

#include "NetAudio.tmpl"

#define StdSubdirs dia os
#define StdLibs $(DIA) $(OS)

      OTHEREXTS = 
      OTHERDEPDIRS =

        DEPDIRS =
     NONPEXEXTS = 
     EXTENSIONS = 
         XAULIB = 
       XDMCPLIB = 
             OS = os/libos.a $(XAULIB) $(XDMCPLIB)
        BSDEMUL = $(LIBSRC)/Berk/Berklib.o
            MFB =
            CFB =
           CFB8 =
             MI =
            DIX =
            DIA = dia/libdia.a
           FONT = 
#if SystemV4 && !defined(SGIArchitecture)
#if defined(SYSV386)
        SYSLIBS = -lc /usr/ucblib/libucb.a -L/usr/X386/lib
#else
        SYSLIBS = /usr/ucblib/libucb.a
#endif
#else
        SYSLIBS =
#endif
           CBRT =

XCOMM
XCOMM This turns off the default rule for compiling .c files because
XCOMM this makefile does not really know how to build it.  This is really
XCOMM just a hack because of the Sun version of make and nfs.
XCOMM
.c.o:

/*****************************************************************************
 *		  ALL definitions, add one for each server                   *
 *****************************************************************************/

#ifdef SunArchitecture
#define CanBuildAuServer	YES
ALL1 = ausun
#endif

#ifdef SGIArchitecture
#define CanBuildAuServer	YES
ALL1 = ausgi
#endif

#if defined(i386SVR4Architecture) || defined(__FreeBSD__) || defined(FreeBSDArchitecture) || defined(LinuxArchitecture)
#define CanBuildAuServer	YES
ALL1 = auvoxware
#endif

ALL = $(ALL1)

all:: $(ALL)

#ifdef CanBuildAuServer

/*****************************************************************************
 *		  Build rule blocks, add one for each server                 *
 *****************************************************************************/

#ifdef SunArchitecture
XCOMM
XCOMM Sun server
XCOMM
SUNDIRS = StdSubdirs dda/sun
SUNLIBS = StdLibs dda/sun/libsun.a
SUNSYSLIBS = $(SYSLIBS)

/* next 8 lines are for Solaris 2 OpenWindows imake config support */
MAPFILE=			
OWVERSIONFILE=owversion
SYSLIBS=
ausun: owversion
owversion:
	echo OpenWindows 3.x > $@
clean::
	rm -f owversion

ServerTarget(ausun,$(SUNDIRS),$(SUNOBJS),$(SUNLIBS),$(SUNSYSLIBS))

InstallMultipleFlags($(ALL),$(BINDIR),$(INSTPGMFLAGS))

SUBDIRS = $(SUNDIRS)
#endif

#ifdef SGIArchitecture
XCOMM
XCOMM SGI server
XCOMM
SGIDIRS = StdSubdirs dda/sgi
SGILIBS = StdLibs dda/sgi/libsgi.a
SGISYSLIBS = $(SYSLIBS) -laudio

ServerTarget(ausgi,$(SGIDIRS),$(SGIOBJS),$(SGILIBS),$(SGISYSLIBS))

InstallMultipleFlags($(ALL),$(BINDIR),$(INSTPGMFLAGS))

SUBDIRS = $(SGIDIRS)
#endif

#if defined(i386SVR4Architecture) || defined(__FreeBSD__) || defined(FreeBSDArchitecture) || defined(LinuxArchitecture)
XCOMM
XCOMM voxware server
XCOMM
VOXWAREDIRS = StdSubdirs dda/voxware
VOXWARELIBS = StdLibs dda/voxware/libvoxware.a
VOXWARESYSLIBS = $(SYSLIBS)

ServerTarget(auvoxware,$(VOXWAREDIRS),$(VOXWAREOBJS),$(VOXWARELIBS),$(VOXWARESYSLIBS))

InstallMultipleFlags($(ALL),$(BINDIR),$(INSTPGMFLAGS))

SUBDIRS = $(VOXWAREDIRS)
#endif

install::
	-(cd $(DESTDIR)$(BINDIR); $(RM) au; $(LN) $(ALL1) au)

#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'

DependSubdirs($(SUBDIRS))
ForceSubdirs($(DEPDIRS) $(SUBDIRS))

clean::
	$(RM) $(ALL)

InstallManPage(auserver,$(MANDIR))
#else /* CanBuildAuServer */

depend::
#endif /* CanBuildAuServer */
