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

#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
ListCreate(ibm8514)
#else
ListCreateEmpty()
#endif
#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
#if ibmIncludeGSL
ListAdd(6,7,gsl)
#else
ListAddEmpty(6,7)
#endif

SUBDIRS= $(SUBDIRS7) ppc common OPERATING_SYSTEM
/* common/ibmcomm.o is the seed for the link -- Don't put it below */
SUBOBJS= $(SUBOBJS7) OPERATING_SYSTEM/OPERATING_SYSTEM.o ppc/ppc.o
DSUBOBJS= $(DSUBOBJS7) OPERATING_SYSTEM/OPERATING_SYSTEM/**/_d.o ppc/ppc_d.o
PSUBOBJS= $(PSUBOBJS7) OPERATING_SYSTEM/OPERATING_SYSTEM/**/_p.o ppc/ppc_p.o

all::	subdirs
libibm.a:	Makefile

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)

