/*
 * Server Master Makefile
 *
 *	$Header: /crl/audio/AF/server/RCS/Imakefile,v 1.28 1994/04/04 12:38:09 tml Exp $
 */

#include <Server.tmpl>
            BSD = os/4.2bsd/libos.a $(AAULIB)
             MI = dda/mi/libmi.a ../lib/AFConvert/libAFConvert.a \
                    $(EXTENSIONS) $(AFUTILLIB)
            DIA = dia/libdia.a
         AAULIB = $(TOP)/lib/Aau/libAau.a
      AFUTILLIB = $(AFUTILLIBSRC)/libAFUtil.a
     EXTENSIONS = $(EXTENSIONSRC)/server/libext.a
        SYSLIBS = -lm

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


/*****************************************************************************
 *                                                                           * 
 *                            To add a new server                            *
 *                                                                           * 
 *     1.  Add an #ifdef block at the end of the following list.  It should  *
 *         determine whether or not a particular server is being built by    *
 *         checking to see if the symbol A<what>Server is defined:           *
 *                                                                           * 
 *             If so, then define a symbol do<what>Server                    * 
 *             If not, then define A<what>Server to be an empty comment      * 
 *                                                                           * 
 *     2.  Add the A<what>Server to the end of the ALL line below.           * 
 *                                                                           * 
 *     3.  Add the name of the server to the ALLPOSSIBLE list below.         * 
 *                                                                           * 
 *     4.  Add a set of object file definitions and build rules.             * 
 *                                                                           * 
 *****************************************************************************/


#ifdef AlofiServer
#define dolofiServer
#else
#define AlofiServer /* as nothing */
#endif

#ifdef AjvServer
#define dojvServer
#else
#define AjvServer /* as nothing */
#endif

#ifdef AmaxineServer
#define domaxineServer
#else
#define AmaxineServer /* as nothing */
#endif

#ifdef AaxpServer
#define doaxpServer
#else
#define AaxpServer /* as nothing */
#endif

#ifdef AlsServer
#define dolsServer
#else
#define AlsServer /* as nothing */
#endif

#ifdef AsparcServer
#define dosparcServer
#else
#define AsparcServer /* as nothing */
#endif

#ifdef AsgiServer
#define dosgiServer
#else
#define AsgiServer /* as nothing */
#endif

#ifdef AmsbServer
#define domsbServer
#else
#define AmsbServer /* as nothing */
#endif

#ifdef AconfServer
#define doconfServer
#else
#define AconfServer /* as nothing */
#endif

#ifdef Aj300Server
#define doj300Server
#else
#define Aj300Server /* as nothing */
#endif

/*****************************************************************************
 *                                                                           *
 * Now add A<what>Server to the ALL line; do NOT split across lines or you   *
 * will confuse make.  Then, add the name of the server to ALLPOSSIBLE.      *
 *                                                                           *
/*****************************************************************************
 */
ALL = AlofiServer AmaxineServer AlsServer AaxpServer AjvServer AsparcServer AsgiServer AmsbServer AconfServer Aj300Server
ALLPOSSIBLE = Alofi Amaxine Als Aaxp Ajv Asparc Asgi Amsb Aconf Aj300

all: $(ALL)


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

#ifdef dolofiServer
/**/#
/**/# lofi server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_lofi
#define need_os_42bsd
LOFIDIRS = dia dda/mi dda/lofi os/4.2bsd
LOFIOBJS = 
LOFILIBS = $(DIA) $(BSD) dda/lofi/liblofi.a $(MI) 
AlofiDIRS = $(LOFIDIRS)

ServerTarget(Alofi,$(LOFIDIRS),$(LOFIOBJS),$(LOFILIBS),$(SYSLIBS))
#endif /* dolofiServer */

#ifdef dojvServer
/**/#
/**/# jv server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_jv
#define need_os_42bsd
JVDIRS = dia dda/mi dda/jv os/4.2bsd
JVOBJS = 
JVLIBS = $(DIA) $(BSD) dda/jv/libAFjv.a $(MI)
AjvDIRS = $(JVDIRS)

ServerTarget(Ajv,$(JVDIRS),$(JVOBJS),$(JVLIBS),$(SYSLIBS))
#endif /* dojvServer */

#ifdef domaxineServer
/**/#
/**/# maxine server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_maxine
#define need_os_42bsd
MAXINEDIRS = dia dda/mi dda/maxine os/4.2bsd
MAXINEOBJS = 
MAXINELIBS = $(DIA) $(BSD) dda/maxine/libmaxine.a $(MI) 
AmaxineDIRS = $(MAXINEDIRS)

ServerTarget(Amaxine,$(MAXINEDIRS),$(MAXINEOBJS),$(MAXINELIBS),$(SYSLIBS))
#endif /* domaxineServer */

#ifdef doaxpServer
/**/#
/**/# axp server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_axp
#define need_os_42bsd
AXPDIRS = dia dda/mi dda/axp os/4.2bsd
AXPOBJS = 
AXPLIBS = $(DIA) $(BSD) dda/axp/libAFaxp.a $(MI) 
AaxpDIRS = $(AXPDIRS)

ServerTarget(Aaxp,$(AXPDIRS),$(AXPOBJS),$(AXPLIBS),$(SYSLIBS))
#endif /* doaxpServer */

#ifdef dolsServer
/**/#
/**/# line server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_ls
#define need_os_42bsd
LSDIRS = dia dda/mi dda/ls os/4.2bsd
LSOBJS = 
LSLIBS = $(DIA) $(BSD) dda/ls/libls.a $(MI) 
AlsDIRS = $(LSDIRS)

ServerTarget(Als,$(LSDIRS),$(LSOBJS),$(LSLIBS),$(SYSLIBS))
#endif /* dolsServer */

#ifdef dosparcServer
/**/#
/**/# sparc server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_sparc
#define need_os_42bsd
SPARCDIRS = dia dda/mi dda/sparc os/4.2bsd
SPARCOBJS = 
SPARCLIBS = $(DIA) $(BSD) dda/sparc/libsparc.a $(MI) 
AsparcDIRS = $(SPARCDIRS)

ServerTarget(Asparc,$(SPARCDIRS),$(SPARCOBJS),$(SPARCLIBS),$(SYSLIBS))
#endif /* dosparcServer */

#ifdef dosgiServer
/**/#
/**/# sgi server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_sgi
#define need_os_42bsd
SGIDIRS = dia dda/mi dda/sgi os/4.2bsd
SGIOBJS = 
SGILIBS = $(DIA) $(BSD) dda/sgi/libsgi.a $(MI) 
AsgiDIRS = $(SGIDIRS)

ServerTarget(Asgi,$(SGIDIRS),$(SGIOBJS),$(SGILIBS),$(SYSLIBS))
#endif /* dosgiServer */

#ifdef domsbServer
/**/#
/**/# msb server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_msb
#define need_os_42bsd
MSBDIRS = dia dda/mi dda/msb os/4.2bsd
MSBOBJS = 
MSBLIBS = $(DIA) $(BSD) dda/msb/libAFmsb.a $(MI)
AmsbDIRS = $(MSBDIRS)

ServerTarget(Amsb,$(MSBDIRS),$(MSBOBJS),$(MSBLIBS),$(SYSLIBS))
#endif /* domsbServer */

#ifdef doconfServer
/**/#
/**/# conf server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_conf
#define need_os_42bsd
CONFDIRS = dia dda/mi dda/conf os/4.2bsd
CONFOBJS = 
CONFLIBS = $(DIA) $(BSD) dda/conf/libAFconf.a $(MI)
AconfDIRS = $(CONFDIRS)

ServerTarget(Aconf,$(CONFDIRS),$(CONFOBJS),$(CONFLIBS),$(SYSLIBS))
#endif /* doconfServer */

#ifdef doj300Server
/**/#
/**/# j300 server
/**/#
#define need_dia
#define need_dda_mi
#define need_dda_j300
#define need_os_42bsd
J300DIRS = dia dda/mi dda/j300 os/4.2bsd
J300OBJS = 
J300LIBS = $(DIA) $(BSD) dda/j300/libAFj300.a $(MI)
Aj300DIRS = $(J300DIRS)

ServerTarget(Aj300,$(J300DIRS),$(J300OBJS),$(J300LIBS) dda/j300/libja.a, $(SYSLIBS))
#endif /* doj300Server */

/*****************************************************************************
 *                                                                           *
 *			Do not modify rest of Imakefile                      *
 *                                                                           *
 *****************************************************************************/

#ifdef need_dia
#define dir_dia dia
#else
#define dir_dia /**/
#endif

#ifdef need_os_42bsd
#define dir_os_42bsd os/4.2bsd
#else
#define dir_os_42bsd /**/
#endif

#ifdef need_dda_mi
#define dir_dda_mi dda/mi
#else
#define dir_dda_mi /**/
#endif

#ifdef need_dda_lofi
#define dir_dda_lofi dda/lofi
#else
#define dir_dda_lofi /**/
#endif

#ifdef need_dda_jv
#define dir_dda_jv dda/jv
#else
#define dir_dda_jv /**/
#endif

#ifdef need_dda_maxine
#define dir_dda_maxine dda/maxine
#else
#define dir_dda_maxine /**/
#endif

#ifdef need_dda_axp
#define dir_dda_axp dda/axp
#else
#define dir_dda_axp /**/
#endif

#ifdef need_dda_ls
#define dir_dda_ls dda/ls
#else
#define dir_dda_ls /**/
#endif

#ifdef need_dda_sparc
#define dir_dda_sparc dda/sparc
#else
#define dir_dda_sparc /**/
#endif

#ifdef need_dda_sgi
#define dir_dda_sgi dda/sgi
#else
#define dir_dda_sgi /**/
#endif

#ifdef need_dda_msb
#define dir_dda_msb dda/msb
#else
#define dir_dda_msb /**/
#endif

#ifdef need_dda_conf
#define dir_dda_conf dda/conf
#else
#define dir_dda_conf /**/
#endif

#ifdef need_dda_j300
#define dir_dda_j300 dda/j300
#else
#define dir_dda_j300 /**/
#endif

OURDIA = dir_dia
OURDDA = dir_dda_mi
OUROS = dir_os_42bsd
DECDDA = dir_dda_lofi
JVDDA = dir_dda_jv
MAXINEDDA = dir_dda_maxine
AXPDDA = dir_dda_axp
LSDDA = dir_dda_ls
SPARCDDA = dir_dda_sparc
SGIDDA = dir_dda_sgi
MSBDDA = dir_dda_msb
CONFDDA = dir_dda_conf
J300DDA = dir_dda_j300

SUBDIRS = $(OURDIA) $(OURDDA) $(OUROS) $(DECDDA) $(MAXINEDDA) \
	$(AXPDDA) $(LSDDA) $(JVDDA) $(SPARCDDA) $(SGIDDA) $(MSBDDA) \
	$(CONFDDA) $(J300DDA)

     ALLDDADIRS = dda/mi dda/lofi dda/maxine dda/axp dda/ls \
	dda/jv dda/sparc dda/sgi dda/msb dda/conf dda/j300
      ALLOSDIRS = os/4.2bsd
     ALLSUBDIRS = dia $(ALLDDADIRS) $(ALLOSDIRS)

InstallMultiple($(ALL),$(BINDIR))

#define IHaveSubdirs

DependSubdirs($(SUBDIRS))
MakeLintLibSubdirs($(SUBDIRS))
LintSubdirs($(SUBDIRS))

NamedCleanSubdirs(AllClean,$(ALLSUBDIRS))
NamedTagSubdirs(AllTags,$(ALLSUBDIRS))

MakeMakeSubdirs($(ALLSUBDIRS),AllMakefiles)


$(EXTDIR) $(SUBDIRS): FRC
	@cd $@ ; echo "making $@"; \
	$(MAKE) $(MFLAGS) PassCDebugFlags all

clean::
	$(RM) $(ALLPOSSIBLE)

InstallManPage(AudioFile,$(MANDIR))
InstallManPageAliases(AudioFile, $(MANDIR), AF)

InstallManPage(Ajv,$(MANDIR))

InstallManPage(Alofi,$(MANDIR))

InstallManPage(Aaxp,$(MANDIR))
InstallManPageAliases(Aaxp,$(MANDIR), Amaxine Asparc)

InstallManPage(Asgi,$(MANDIR))

InstallManPage(Amsb,$(MANDIR))

InstallManPage(Aj300,$(MANDIR))

InstallManPage(Aconf,$(MANDIR))

install::
	@echo "************************************************************"
	@echo "* "
	@echo "*     Don't forget to create a link called $(BINDIR)/AF"
	@echo "*     pointing to the default server, if there is one."
	@echo "* "
	@echo "************************************************************"

FRC:
