#  Copyright (c) 1984 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#ident	"@(#)xenv:m88k/template.mk	1.36"
#
#	M88000 GLOBAL MAKEFILE
#
# ======= MODIFY THE VALUES BELOW TO SUIT YOUR ENVIRONMENT ==================
#
OWN=bin
GRP=bin
#
# ===========================================================================
#
#	If host machine is running a pre-5.0 release of UNIX
#	then set Archive Format to "OLDAR".
#	Starting with the 5.0 UNIX (SVR1)  release the Archive Format
#	should be set to "PORTAR".
#	If building a 5.0 release on a host that is running
#	System V Rel. 2.0 (SVR2), then set ARFORMAT to PORT5AR.
#
ARFORMAT=PORTAR
#
#	SGS indicates the prefix to be applied to the installed commands.
#
#	ARCH indicates the architecture of the host machine
#		AR16WR=11/70, AR32WR=vax, AR32W=ibm, 3b20, etc
ARCH=AR32W
#
#	The following macros define the various installation directories.
#	Note that if relative pathnames are used, they must allow for the
#	"cd" issued prior to each make.
#
#	BASE is the directory under which all the sgs source lives
BASE= ../..
#
#	BINDIR is the directory for installing executable ("bin") files.
#	It should correspond to the same directory as specified in AS and LD
#	in paths.h.
BINDIR=$(BASE)/bin
#
#	LIBDIR is the directory for installing libraries and executable
#	files not intended for direct user execution (e.g., assembler pass1).
#	It should correspond to the same directory as specified in COMP,
#	OPTIM, AS1, and AS2 in paths.h.
LIBDIR=$(BASE)/lib
#
#	INCDIR is the directory for installing include files used in
#	developing the SGS and which are needed by certain users of the
#	SGS (e.g., operating system developers).  It should correspond to
#	the same directory as specified in INCDIR in paths.h.
INCDIR=$(BASE)/inc
#
#	Specify the byte order for this SGS instance.
#		FBO = Forward Byte Order (3B20, IBM, M88K)
#		RBO = Reverse Byte Order (DEC)
DBO=FBO
#
#
#	Starting with the SVR2 release of UNIX,
#	if flexnames feature is desired, then set FLEX
#	to -DFLEXNAMES.
#	If host machine is running a pre-SVR2 release of UNIX
#	then set FLEX to null (ie. FLEX= ).
#
FLEX=FLEXNAMES
#
#	MAC parameter specifies the set of software workarounds
#	to be produced by the new sgs.
#	MAC=ABWORMAC produces sgs for WE32001 and WE32100 chips.
#	MAC=BMAC produces sgs for WE32100  o n l y.
#	MAC=<nothing> for m88k.
#
MAC=
#	This is the machine ID field. The valid values are
#	u3b15, u3b5, u3b2 or m88k.
MACH=m88k
#
#	The following parameter specifies the default include directory
#	for cpp. If not defined the value will be ROOT/usr/include.
#
USRINC=$(BASE)/include
NOUSRINC=NOUSRINC
#
#
RANLIB=touch
MAKE=make
CC=cc
AR=ar
SGS= m88k
FFLAG=
SGSENV=
ROOT=
VERSION=
LDLIBS=
#    
#    set OCS_BCS to m88k as default to generate OCS/BCS release, others just
#    undefined OCS_BCS
#
#OCS_BCS= -DOCS_BCS
LIBLD=$(BASE)/libld/m88k/$(SGS)libld.a
#
#
ENVPARMS=MAKE="$(MAKE)" SGS="$(SGS)" ARCH="$(ARCH)" OWN="$(OWN)" GRP="$(GRP)" \
	DBO="$(DBO)" ARFORMAT="$(ARFORMAT)" FLEX="$(FLEX)" LIBLD="$(LIBLD)"
#	RANLIB="$(RANLIB)"
CCPARMS=CC="$(CC)" 

CPPARMS=CC="$(CC)" FFLAG="$(FFLAG)" SGSENV="$(SGSENV)" ROOT="$(ROOT)" \
	VERSION="$(VERSION)" USRINC="$(INCDIR)"

DIRPARMS=BINDIR="$(BINDIR)" LIBDIR="$(LIBDIR)"
LIBLDAR=AR="$(AR)"
#libs
#
all:	libs	
	cd $(BASE)/ar/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/as/m88k; $(MAKE) $(ENVPARMS) MAC=$(MAC) $(CCPARMS)
	cd $(BASE)/comp/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/ld/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/reorder/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/cpp/m88k; $(MAKE) $(ENVPARMS) $(CPPARMS) PD_SYS=D_unix \
		PD_MACH=D_newmach NEW_MACH="-DPD_MY_MACH=\\\"$(MACH)\\\""
	cd $(BASE)/cmd/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/sifilter/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/dump/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/dis/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/lorder/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/m4/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/mkshlib/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/nm/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/sim/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/size/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/strip/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
	cd $(BASE)/ldopt/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS)
##
libs:
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(LIBLDAR)
#
first:
	if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi 
	if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR) ; fi 
	if [ ! -d $(INCDIR) ] ; then mkdir $(INCDIR) ; fi 
#
install: 
	cd $(BASE)/ar/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/as/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/comp/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/reorder/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/cpp/m88k; $(MAKE) $(ENVPARMS) $(CPPARMS) $(DIRPARMS) install
	cd $(BASE)/cmd/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/ld/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/dump/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/dis/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/lorder/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) install
	cd $(BASE)/m4/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/mkshlib/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/nm/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/sim/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/size/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/strip/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/sifilter/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/ldopt/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) clobber
#
libinstall:
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) $(DIRPARMS) install
#
save:
	cd $(BASE)/inc/m88k; $(MAKE) $(ENVPARMS) INCDIR=$(INCDIR) save
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/ar/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/comp/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/cpp/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/cmd/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/as/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/ld/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/dump/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/dis/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/lorder/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/m4/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/mkshlib/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/nm/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/sim/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/reorder/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/size/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/strip/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) save
	cd $(BASE)/sifilter/m88k; $(MAKE) $(ENVPARMS)  $(DIRPARMS) save
	cd $(BASE)/ldopt/m88k; $(MAKE) $(ENVPARMS)  $(DIRPARMS) save
#
uninstall:
	cd $(BASE)/inc/m88k; $(MAKE) $(ENVPARMS) INCDIR=$(INCDIR) uninstall
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/ar/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/comp/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/cpp/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/cmd/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/as/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/ld/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/dump/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/dis/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/lorder/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/m4/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/mkshlib/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/nm/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/sim/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/reorder/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/size/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/strip/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/sifilter/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
	cd $(BASE)/ldopt/m88k; $(MAKE) $(ENVPARMS) $(DIRPARMS) uninstall
#
clean: libclean
	cd $(BASE)/ar/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clean
	cd $(BASE)/comp/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/cpp/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/cmd/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/as/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/ld/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/dump/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/dis/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/lorder/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/m4/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/mkshlib/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/nm/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/reorder/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/sim/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/size/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/strip/m88k; $(MAKE) $(ENVPARMS) clean
	cd $(BASE)/fpx/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clean
	cd $(BASE)/sifilter/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clean
	cd $(BASE)/ldopt/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clean
#
clobber: libclobber
	cd $(BASE)/ar/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
	cd $(BASE)/as/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/comp/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/reorder/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/ld/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/cpp/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/cmd/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/dump/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/dis/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/lorder/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/m4/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/mkshlib/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/nm/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/sim/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/size/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/strip/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/fpx/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
	cd $(BASE)/sifilter/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
	cd $(BASE)/ldopt/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
#
libclobber:
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) clobber

libclean:
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) clean

nolibclobber:
	cd $(BASE)/libld/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/ar/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
	cd $(BASE)/as/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/comp/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/reorder/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/ld/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/cpp/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/cmd/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/dump/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/dis/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/lorder/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/m4/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/mkshlib/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/nm/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/sim/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/size/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/strip/m88k; $(MAKE) $(ENVPARMS) clobber
	cd $(BASE)/fpx/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
	cd $(BASE)/sifilter/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
	cd $(BASE)/ldopt/m88k; $(MAKE) $(ENVPARMS) $(CCPARMS) clobber
