#include <Server.tmpl>

/* "@(#)Imakefile	3.1 88/09/22 09:29:19" */
#define IHaveSubdirs
#undef PassCDebugFlags
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CC=$(CC)' 'HCVERSION=$(HCVERSION)'

#define	ListCreate(name)\
SUBDIRS0= name @@\
SUBOBJS0= name/name.o @@\
DSUBOBJS0= name/name/**/_d.o @@\
PSUBOBJS0= name/name/**/_p.o
#define	ListCreateEmpty()\
SUBDIRS0=  @@\
SUBOBJS0=  @@\
DSUBOBJS0=  @@\
PSUBOBJS0= 
#define	ListAdd(last,new,name)\
SUBDIRS/**/new= $(SUBDIRS/**/last) name @@\
SUBOBJS/**/new= $(SUBOBJS/**/last) name/name.o @@\
DSUBOBJS/**/new= $(DSUBOBJS/**/last) name/name/**/_d.o @@\
PSUBOBJS/**/new= $(PSUBOBJS/**/last) name/name/**/_p.o
#define	ListAddEmpty(last,new)\
SUBDIRS/**/new= $(SUBDIRS/**/last) @@\
SUBOBJS/**/new= $(SUBOBJS/**/last) @@\
DSUBOBJS/**/new= $(DSUBOBJS/**/last) @@\
PSUBOBJS/**/new= $(PSUBOBJS/**/last)

#if	ibmInclude8514
#ifdef	AIXArchitecture
ListCreate(ibm8514)
#else	/* !AIXArchitecture */
SUBDIRS0 = ibm8514
SUBOBJS0 = ibm8514/ibm8514.o
#endif	/* !AIXArchitecture */
#else	/* !ibmInclude8514 */
ListCreateEmpty()
#endif	/* !ibmInclude8514 */

#if ibmIncludeAED
ListAdd(0,1,aed)
#else
ListAddEmpty(0,1)
#endif
#if ibmIncludeAPA8c
ListAdd(1,2,apa8c)
#else
ListAddEmpty(1,2)
#endif
#if ibmIncludeAPA16
ListAdd(2,3,apa16)
#else
ListAddEmpty(2,3)
#endif
#if ibmIncludeEGA
ListAdd(3,4,ega)
#else
ListAddEmpty(3,4)
#endif
#if ibmIncludeMPEL
ListAdd(4,5,mpel)
#else
ListAddEmpty(4,5)
#endif
#if ibmIncludeVGA
ListAdd(5,6,vga)
#else
ListAddEmpty(5,6)
#endif

SUBDIRS= $(SUBDIRS6) common OPERATING_SYSTEM ppc
/* common/ibmcomm.o is the seed for the link -- Don't put it below */
SUBOBJS= $(SUBOBJS6) OPERATING_SYSTEM/OPERATING_SYSTEM.o ppc/ppc.o
DSUBOBJS= $(DSUBOBJS6) OPERATING_SYSTEM/OPERATING_SYSTEM/**/_d.o
PSUBOBJS= $(PSUBOBJS6) OPERATING_SYSTEM/OPERATING_SYSTEM/**/_p.o

all::	subdirs

libibm.a: $(ICONFIGFILES)

NormalLibraryTarget(ibm,$(SUBOBJS))
#if ProfileServer
NormalLibraryTarget(ibm_p,$(PSUBOBJS))
#endif
#if DebugServer
NormalLibraryTarget(ibm_d,$(DSUBOBJS))
#endif
	
NamedMakeSubdirs(subdirs,$(SUBDIRS))
	
#
# before doing the depend, be sure that makedepend exists.
#
depend:: $(DEPEND)

DependSubdirs($(SUBDIRS))

#
# we should be always using ANY tool available ( even lint ) !
#
MakeLintLibSubdirs($(SUBDIRS))
LintSubdirs($(SUBDIRS))

#
# before making the makefiles, be sure that imake exists.
#
Makefiles:: $(IMAKE)

$(IMAKE):
	@echo "making $(IMAKESRC)"; \
	cd $(IMAKESRC); $(MAKE)


