
# Modified Definitions #

HOME = /u/usystem/software/concc

VENDOR = sun
CPU = sparc
OS = solaris

# Basic Definitions #

INC = ../inc
INC1 = ${HOME}/inc
INC2 = ${HOME}/kernel/work/inc
LIB = ../lib

# List all the things that need to be made.  These include the lib directory,
# and the libraries themselves.  On the architectures that support shared
# memory, we can build the multiple processor versions of the libraries
# as well as the single processor versions.

# There must be some sort of precedence established for the
# extenders, in order that the naming conventions be unambiguous.
# The -m extender has highest precedence, followed by the
# -d extender, followed by the -u extender.

ALL = ${LIB} ${LIB}/uLib{.a -d.a} ${LIB}/uIO{.a -u.a}
.IF ${VENDOR:s/sequent//:s/encore//:s/sgi//} == ${NULL}
    ALL += ${LIB}/uLib-m{.a -d.a} ${LIB}/uIO-m{.a -u.a}
.END

# List the primary directive.

all .SEQUENTIAL : ${ALL};

# List the source files.  The sequent and sgi architectures include
# some source files that can only be made on those machines.

SRC = uDelay.c uReap.c
.IF ${VENDOR} == sequent
    SRC += uSampler.c
.END
#.IF ${VENDOR} == sgi
#    SRC += uSGIGraphics.c
#.END

IOSRC = uFile.c uStream.c

# Derive the names of the object files for all library versions.

OBJ = {${SRC:b}}.o
OBJ-M = {${SRC:b}}-m.o
OBJ-D = {${SRC:b}}-d.o
OBJ-M-D = {${SRC:b}}-m-d.o

IOOBJ = {${IOSRC:b}}.o
IOOBJ-M = {${IOSRC:b}}-m.o
IOOBJ-U = {${IOSRC:b}}-u.o
IOOBJ-M-U = {${IOSRC:b}}-m-u.o

# These are the include files that all object files depend on.

HFILES = ${INC1}/uUnix.h ${INC2}/{uSystem.h uMachine.h uKernel.h uExcept.h uMalloc.h uSystemEx.h uStart.h}

# These are the individual dependencies on the various include files.
# All the object files depend on the standard include files.

${OBJ} ${OBJ-D} ${OBJ-P} ${OBJ-M} ${OBJ-M-D} ${OBJ-M-P} : ${HFILES} Makefile
${IOOBJ} ${IOOBJ-M} ${IOOBJ-P} ${IOOBJ-U} ${IOOBJ-M-P} ${IOOBJ-M-U} ${IOOBJ-P-U} ${IOOBJ-M-P-U} : ${HFILES} Makefile

# Describe how to make the object files, standard, and debug
# versions from the source files for both single and multiple
# processor versions.  Notice that all object files depend on both
# the .c file and .h file, but only the .c file is used in the recipe
# to make the object file.

CC = ${HOME}/bin/concc -O -quiet -work -Wall -finline-functions -I${INC1} -I${INC} -D__${VENDOR}__

%.o : %.c '${INC}/%.h' ; ${CC} $< -nounixrc -c -o $@
%-m.o : %.c '${INC}/%.h' ; ${CC} $< -nounixrc -multi -c -o $@
%-d.o : %.c '${INC}/%.h' ; ${CC} $< -nounixrc -debug -c -o $@
%-u.o : %.c '${INC}/%.h' ; ${CC} $< -unixrc -c -o $@
%-m-d.o : %.c '${INC}/%.h' ; ${CC} $< -nounixrc -multi -debug -c -o $@
%-m-u.o : %.c '${INC}/%.h' ; ${CC} $< -multi -unixrc -c -o $@

# Describe how to make the library files, standard, and debug
# versions from the object files for both single and multiple processor
# versions.  The ranlib program must be run on each archived library
# only on BSD 4.3 systems.

${LIB} :
	mkdir $@

AR = ar r
RL = ranlib

${LIB}/uLib.a .LIBRARY : ${OBJ}
${LIB}/uLib-d.a .LIBRARY : ${OBJ-D}
${LIB}/uLib-m.a .LIBRARY : ${OBJ-M}
${LIB}/uLib-m-d.a .LIBRARY : ${OBJ-M-D}

${LIB}/uIO.a .LIBRARY : ${IOOBJ}
${LIB}/uIO-m.a .LIBRARY : ${IOOBJ-M}
${LIB}/uIO-u.a .LIBRARY : ${IOOBJ-U}
${LIB}/uIO-m-u.a .LIBRARY : ${IOOBJ-M-U}

%.a :
[
	${AR} $@ $?
.IF ${OS} == bsd43
	${RL} $@
.END
	rm $?
]

# Local Variables: #
# compile-command: "dmake" #
# End: #
