#
# ----------------------------------------------------------------------
#    T2EX Software Package
#
#    Copyright 2012 by Ken Sakamura.
#    This software is distributed under the latest version of T-License 2.x.
# ----------------------------------------------------------------------
#
#    Released by T-Engine Forum(http://www.t-engine.org/) at 2012/12/12.
#    Modified by T-Engine Forum at 2013/02/20.
#    Modified by TRON Forum(http://www.tron.org/) at 2015/06/04.
#
# ----------------------------------------------------------------------
#

#
# This software package is available for use, modification, 
# and redistribution in accordance with the terms of the attached 
# T-License 2.x.
# If you want to redistribute the source code, you need to attach 
# the T-License 2.x document.
# There's no obligation to publish the content, and no obligation 
# to disclose it to the TRON Forum if you have modified the 
# software package.
# You can also distribute the modified source code. In this case, 
# please register the modification to T-Kernel traceability service.
# People can know the history of modifications by the service, 
# and can be sure that the version you have inherited some 
# modification of a particular version or not.
#
#    http://trace.tron.org/tk/?lang=en
#    http://trace.tron.org/tk/?lang=ja
#
# As per the provisions of the T-License 2.x, TRON Forum ensures that 
# the portion of the software that is copyrighted by Ken Sakamura or 
# the TRON Forum does not infringe the copyrights of a third party.
# However, it does not make any warranty other than this.
# DISCLAIMER: TRON Forum and Ken Sakamura shall not be held
# responsible for any consequences or damages caused directly or
# indirectly by the use of this software package.
#
# The source codes in bsd_source.tar.gz in this software package are 
# derived from NetBSD or OpenBSD and not covered under T-License 2.x.
# They need to be changed or redistributed according to the 
# representation of each source header.
#

#
#       Makefile for gmake
#       T-Kernel/System Manager (system-dependent description)
#

# T-Engine type
MACHINE = em1d
TETYPE = tef

# Memory management type
ifneq ($(T2EX_MM),)
MEMMGR = t2ex
else
MEMMGR = nommu
endif

# default rules
include ../../../../etc/makerules

# source files (system-dependent)
SRC = chkplv.c power.c cache.c

# Extension source files
VPATH   += ../../../extension/memory/$(MEMMGR)
HEADER  += ../../../extension/memory/$(MEMMGR)
SRC += memmgr.c segmgr.c

# Extension source files (T2EX specific)
ifeq ($(MEMMGR), t2ex)
CFLAGS  += -DT2EX_MM_USE_TASKEXCEPTION=$(T2EX_MM_USE_TASKEXCEPTION)
VPATH   += ../../../extension/memory/$(MEMMGR)/sysdepend/$(MACHINE)
HEADER  += ../../../extension/memory/$(MEMMGR)/sysdepend/$(MACHINE)
SRC += space.c excmgr.c excentry.S
ifneq ($(T2EX_MM_USE_DEFAULT_FAULT_HANDLER), 0)
SRC += exchdr.c
endif
endif

# include main makefile (common description)
include ../../src_t2ex/Makefile.common
