## Define the appropriate configuration variables.

PACKAGE = /fsys2/u/usystem/software/u++-4.7

## Include the architecture dependent definitions.

.INCLUDE : ${PACKAGE}/CONFIG

## Define the path names of important directories.

SRCDIR = ${PACKAGE}/src/kernel

## Define some of the tools.

.INCLUDE : ../MakeTools

## Define the C++ source files.

LIBSRC = ${SRCDIR}/{\
uDefaultStackSize \
uDefaultPreemption \
uDefaultSpin \
uDefaultHeapExpansion \
uMainStackSize \
uDebug \
uC++ \
uMachContext \
uBootTask \
uSystemTask \
uNBIO \
uAbortExit \
uContext \
uFloat \
uCalendar \
uAlarm \
uBaseCoroutine \
uBaseTask \
uMemory \
uHeapLmmm \
uSignal \
uProcessor \
uCluster \
uAEHM \
uKernelEvent \
uRealTime \
}.cc

LIBSRC-D = ${LIBSRC}
.IF ${MULTI} == TRUE
	LIBSRC-M = ${LIBSRC}
	LIBSRC-M-D = ${LIBSRC}
.END

## Define the asm source files.

LIBASM = ${SRCDIR}/{\
uSwitch-${TCPU} \
}.s

LIBASM-D = ${LIBASM}
.IF ${MULTI} == TRUE
	LIBASM-M = ${LIBASM} ${SRCDIR}/{uAtomic-${TCPU}}.s
	LIBASM-M-D = ${LIBASM-M}
.END

## Define the special object files.

MODSRC = ${SRCDIR}/{\
uPrivate \
uBegin \
uEnd \
}.cc

.IF ${MULTI} == TRUE
	MODSRC-M = ${MODSRC}
.END

## Define the header files

HEADERS = uAlign.h uDefault.h uPageSize.h uCalendar.h uAlarm.h uAEHM.h uKernelEvent.h uC++.h uAssert.h uDebug.h uDeadlineMonotonic.h uRealTime.h

## Define which libraries should be built.

LIB = ${LIBDIR}/uKernel.a
LIB-D = ${LIBDIR}/uKernel-d.a
.IF ${MULTI} == TRUE
	LIB-M = ${LIBDIR}/uKernel-m.a
	LIB-M-D = ${LIBDIR}/uKernel-m-d.a
.END

#LIB1 = ${LIBDIR}/uKernelNDB.a
#LIB1-D = ${LIBDIR}/uKernelNDB-d.a
#.IF ${MULTI} == TRUE
#	LIB1-M = ${LIBDIR}/uKernelNDB-m.a
#	LIB1-M-D = ${LIBDIR}/uKernelNDB-m-d.a
#.END

## Define which dependencies should be built.

DEPEND = ${OBJDIR}/depend.mk
DEPEND-D = ${OBJDIR}/depend-d.mk
.IF ${MULTI} == TRUE
	DEPEND-M = ${OBJDIR}/depend-m.mk
	DEPEND-M-D = ${OBJDIR}/depend-m-d.mk
.END

## Define the things that can be defined based upon previous definitions.

.INCLUDE : ../MakeDefinitions

## Add to the list of things to clean.

CLEAN += ${SRCDIR}/uPageSize.h

## Do any adjusting for different gcc release

#GCC_PATH = ${shell gcc -v 2>&1 | sed -f GCC_PATH}
#MODOBJ += ${OBJDIR}/{_eh.o}

## Define the specific recipes.

all .SEQUENTIAL : ${OBJDIR} ${LIBDIR} ${LIBRARIES} ${MODULES};

install .SEQUENTIAL : ${OBJDIR} ${LIBDIR} ${LIBRARIES} ${MODULES} ${INSTALLLIBDIR} ${INSTALLLIBDIR}/{${MODULES:f}} ${INSTALLLIBDIR}/{${LIBRARIES:f}} ${INSTALLINCDIR} ${INSTALLINCDIR}/{${HEADERS:f}};

depend : ${DEPENDS};

${DEPENDS} : ${OBJDIR} ${SRCDIR}/uPageSize.h

## Define special rules

${LIBOBJ} ${LIBOBJ-D} ${LIBOBJ-M} ${LIBOBJ-M-D} : ${SRCDIR}/uPageSize.h

${SRCDIR}/uPageSize.h : ${OBJDIR}/uPageSize
	$< > $@

${OBJDIR}/uPageSize : ${SRCDIR}/uPageSize.cc
	g++ -D__${TVENDOR}__ -D__${TOS}__ -D__${TCPU}__ -O -I. $< -o $@
	strip $@

#${LIBOBJ} ${LIBOBJ-D} ${LIBOBJ-M} ${LIBOBJ-M-D} : ${OBJDIR}/_eh.o
#
#${OBJDIR}/_eh.o :
#	ar -x ${GCC_PATH}/libgcc.a _eh.o
#	mv _eh.o $@

## Define default dependencies and recipes for object files.

.INCLUDE : ../MakeRecipes

## Include the dependencies for object files and libraries.

.INCLUDE .IGNORE : ${DEPENDS}

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