############################################################################
# arch/mips/src/pic32mx/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.  The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################

# The start-up, "head", file

HEAD_ASRC = pic32mx_head.S

# Common MIPS files

CMN_ASRCS  = mips_syscall0.S fork.S
CMN_CSRCS  = mips_allocateheap.c mips_copystate.c mips_createstack.c
CMN_CSRCS += mips_doirq.c mips_exit.c mips_getintstack.c mips_initialize.c
CMN_CSRCS += mips_initialstate.c mips_irq.c mips_lowputs.c mips_mdelay.c
CMN_CSRCS += mips_modifyreg8.c mips_modifyreg16.c mips_modifyreg32.c
CMN_CSRCS += mips_nputs.c mips_releasestack.c mips_registerdump.c
CMN_CSRCS += mips_swint0.c mips_stackframe.c mips_switchcontext.c
CMN_CSRCS += mips_saveusercontext.c mips_udelay.c mips_usestack.c
CMN_CSRCS += mips_fork.c

# Configuration dependent common files

ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += mips_schedulesigaction.c mips_sigdeliver.c
endif

ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y)
CMN_CSRCS += mips_idle.c
endif

# Use of common/mips_etherstub.c is deprecated.  The preferred mechanism is to
# use CONFIG_NETDEV_LATEINIT=y to suppress the call to mips_netinitialize() in
# mips_initialize().  Then this stub would not be needed.

ifneq ($(CONFIG_PIC32MX_ETHERNET),y)
ifeq ($(CONFIG_NET),y)
CMN_CSRCS += mips_etherstub.c
endif
endif

# Required PIC32MX files

CHIP_CSRCS  = pic32mx_irq.c pic32mx_decodeirq.c pic32mx_exception.c
CHIP_CSRCS += pic32mx_gpio.c pic32mx_lowconsole.c pic32mx_lowinit.c
CHIP_CSRCS += pic32mx_serial.c pic32mx_spi.c

# Configuration-dependent PIC32MX files

ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += pic32mx_timerisr.c
endif

ifeq ($(CONFIG_PIC32MX_GPIOIRQ),y)
CHIP_CSRCS += pic32mx_gpioirq.c
endif

ifeq ($(CONFIG_PIC32MX_USBDEV),y)
CHIP_CSRCS += pic32mx_usbdev.c
endif

ifeq ($(CONFIG_PIC32MX_ETHERNET),y)
CHIP_CSRCS += pic32mx_ethernet.c
endif