# Makefile - makefile for target/src/arch/arm
#
# Copyright (c) 1996-2013 Wind River Systems, Inc.
#
# The right to copy, distribute, modify or otherwise make use
# of this software may be licensed only pursuant to the terms
# of an applicable Wind River license agreement.
#
# modification history
# --------------------
# 03f,12may13,yjw  Update for ARMv7M
# 03e,19oct12,jdw  Remove sllALib.s from build
# 03d,17jul12,j_b  Add Cortex-A15 cache modules
# 03c,16dec11,rec  WIND00273229 - some files are incorrectly added into
#                  ARMARCH7 library
# 03b,17sep10,rec  add cpuPwrArchLib.o
# 03a,21may10,m_h  Thumb-2 Support
# 02z,24mar10,j_b  remove ARMARCH7 sources from ARMARCH6 build (CQID: 205003)
# 02y,20oct09,z_l  add Cortex-A9 support.
# 02x,19aug09,kk   use _WRS_CONFIG_SMP for selection instead (CQ:WIND00177119)
# 02w,25feb09,j_b  merge ARM SMP support:
#                               Reinstate arch-specific atomic functions
#                               for use when ARM_HAS_LDREX_STREX
#                  12nov07,jmp  Added vxdbgCpuArchLib.o for SMP builds.
#                  11jul07,j_b  add mmu11MPCore files
#                  02jul07,m_h  Adding MPCore Cache Support
#                  18jun07,m_h  Add vxCpuArchLib.c and vxCpuALib.s
# 02v,27feb09,m_h  ARMARCH7 Support
# 02u,30jul08,j_b  add ARMv7/Cortex-A files to ARMARCH6
# 02t,26jun08,j_b  add ARMv7/Cortex-A support
# 02s,21nov08,j_b  remove arch-specific atomic functions (WIND00144546)
# 02r,30may07,to   added cacheArm946eMiniLib.o and mpu946eMiniLib.o
# 02q,09may07,zl   removed unixALib from build
# 02p,05may07,m_h  Add Atomic Instructions
# 02o,14sep06,slk  add vxMemProbeArchLib.c and vxMemProbeArchALib.s
# 02n,01aug06,jb   Revert 920t to arch4
# 02m,14jun06,m_h  MPU Support
# 02l,12jul06,wap  Add vxBus components
# 02k,22may06,m_h  946 Support
# 02j,25jan06,m_h  Manzano Support
# 02i,11nov05,jb   Adding 920/922
# 02h,13sep05,h_k  removed cacheAim1136jfALib, sem*Lib and workQALib. (SPR
#                  #112139)
# 02g,28mar05,jb   Adding ARMARCH6 and 1136 support
# 02f,17feb05,scm  add OSM support module...
# 02e,19dec04,jb   Palifying mmu and removing unsupported arch/processors
# 02d,18jan05,jb   Add objVerify Support
# 02c,13sep04,rec  add archSysctl
# 02b,25aug04,scm  convert trcLib over to trcArchLib
# 02a,10aug04,scm  remove MPU archs...
# 01z,01apr04,scm  adjust to incorporate cacheAim...
# 01y,18feb04,m_h  Added in_cksum.o
# 01x,25nov03,scm  correct typo...
# 01w,15oct03,scm  add syscall/rtp support...
# 01v,18dec02,jb   Adding ARM10 support
# 01u,14dec01,to   sync with T3. clean up. bring back lost mod-hist.
# 01t,05dec01,rec  ARCHV5 changes
# 01s,13nov01,to   add cacheArchVars and mmuArchVars
# 01r,23oct01,jn   put arm elf reloc unit into arch directory
# 01s,09nov01,t_m  Update for ARMARCH5
# 01r,25oct01,tam  updated for repackaging
# 01s,09oct01,rec  archive OBJS_ARMARCH5_COMMON files in OBJS_ARMARCH4
# 01r,25sep01,rec  archv5 changes
# 01q,23jul01,scm  change XScale name to conform to coding standards...
# 01p,04may01,scm  add support for STRONGARM...
# 01o,11dec00,scm  replaces references to ARMSA2 with XScale
# 01n,31aug00,scm  add initial sa2 support
# 01n,07mar01,t_m  merge in XScale changes
# 01m,19jul00,jpd  added ARM946E support.
# 01l,30jul98,jpd  added ARM740T, ARM920T support.
# 01k,20jan99,cdp  removed support for old ARM libraries.
# 01j,24nov98,cdp  added support for generic ARMARCH3/4/4_T;
#              jpd  added cacheALib2.o, mmuALib2.o and mmuMapLib.o.
# 01i,20apr98,dbt  replaced wdbArchLib.o with wdbDbgArchLib.o
# 01h,20mar98,cdp  undo 01g (add sem*Lib and workQALib back to optimised list).
# 01g,21oct97,kkk  take out sem*Lib.o and workQLib.o from optimized list.
# 01f,29may97,jpd  Finished adding assembler optimised files.
# 01e,22apr97,jpd  Removed assembler optimised files from ARM7TDMI_T.
# 01d,16apr97,cdp  Added support for ARM7TDMI_T.
# 01c,11apr97,jpd  Added assembler optimised files.
# 01b,29jan97,jpd  Added cacheArchLib.o for ARM7TDMI.
# 01a,28nov96,cdp  created from 01a of MakeSkel.
#
# DESCRIPTION
# This file contains the makefile rules for building the VxWorks
# architecture-dependent library.
#

TGT_DIR=$(WIND_BASE)/target

LIB_BASE_NAME   = arch

# Including defs.library to pick up the _WRS_CONFIG_SMP define.
# defs.library must be included after LIB_BASE_NAME.

include $(TGT_DIR)/h/make/defs.library

DOC_FILES =

OBJS_COMMON = \
               archSysctl.o dbgArchLib.o dbgArmLib.o dsmLib.o \
               elfArm.o excALib.o excArchLib.o excArchShow.o fppArchLib.o \
               intALib.o intArchLib.o in_cksum.o mpuGlobalMap.o \
               objALib.o objArchLib.o rtpALib.o rtpSigArchLib.o \
               sigCtxALib.o sigCtxLib.o syscallALib.o syscallArchLib.o \
               sysOsmLib.o taskArchLib.o trcALib.o trcArchLib.o \
               vxALib.o vxAtomicALib.o vxbAccessArchALib.o vxbAccessArchLib.o \
               vxCpuArchLib.o vxCpuALib.o vxCpuIdArchALib.o \
               vxLib.o vxMemProbeArchALib.o vxMemProbeArchLib.o \
               wdbDbgArchLib.o windALib.o

ifdef _WRS_CONFIG_SMP
OBJS_COMMON += vxdbgCpuArchLib.o
endif

OBJS_ARM_OPTIM = \
               bALib.o dllALib.o ffsALib.o \
               qPriBMapALib.o qPriHeapALib.o 

OBJS_ARMARCH4_COMMON = \
               cacheArchVars.o cacheALib2.o \
               cacheAimArch4DClearDisable.o cacheAimArch4DInvalidateAll.o \
               cacheAimArch4PipeFlush.o \
               cacheAimArch4Common.o cacheAimArch4Identify.o \
               cacheAim920tLib.o cacheAim920tALib.o \
               mmuArchVars.o mmuALib2.o mmuMapLib.o \
               mmu920tLib.o mmu920tALib.o

OBJS_ARMARCH5_COMMON = \
               cacheArchVars.o cacheALib2.o \
               cacheAimArch5Common.o \
               cacheAimArch5DFlush.o cacheAimArch5DInvalidateAll.o \
               cacheAimArch5PipeFlush.o cacheAimArch5DInvalidate.o \
               cacheAimArch5IMB.o cacheAimArch5IClearDisable.o \
               cacheAimArch5IInvalidateAll.o cacheAimArch5DClear.o \
               cacheAimArch5IInvalidate.o cacheAimArch5Identify.o \
               cacheAim926eLib.o cacheAim926eALib.o \
               cacheAim946eLib.o cacheAim946eALib.o \
               mmuArchVars.o mmuALib2.o mmuMapLib.o \
               mmu926eLib.o mmu926eALib.o \
               mpu946eLib.o mpu946eALib.o mpu946eShow.o \
               mpu940tLib.o mpu940tALib.o mpu940tShow.o \
               vfpALib.o vfpArchLib.o vfpArchLibShow.o \
               cacheArm946eMiniLib.o mpu946eMiniLib.o

OBJS_ARMARCH6_COMMON = \
               cacheArchVars.o cacheALib2.o \
               cacheAimArch6Common.o \
               cacheAimArch6DClearAll.o cacheAimArch6DClearDisable.o \
               cacheAimArch6DClear.o cacheAimArch6DFlush.o \
               cacheAimArch6DFlushAll.o cacheAimArch6DInvalidateAll.o \
               cacheAimArch6DInvalidate.o cacheAimArch6IClearDisable.o \
               cacheAimArch6Identify.o cacheAimArch6IInvalidateAll.o \
               cacheAimArch6IInvalidate.o cacheAimArch6IMB.o \
               cacheAimArch6PipeFlush.o \
               cacheAim1136jfLib.o \
               cacheAim11MPCoreLib.o cacheAim11MPCoreALib.o \
               mmuArchVars.o mmuALib2.o mmuMapLib.o \
               mmu1136jfLib.o mmu1136jfALib.o \
               mmu11MPCoreLib.o mmu11MPCoreALib.o \
               vfpALib.o vfpArchLib.o vfpArchLibShow.o

OBJS_ARMARCH7_COMMON = \
               cacheArchVars.o cacheALib2.o \
               cacheAimArch7Common.o \
               cacheAimArch7DClearAll.o cacheAimArch7DFlushAll.o \
               cacheAimArch7DFlushPoU.o cacheAimArch7Identify.o \
               cacheAimArch7DInvalidateAll.o \
               cacheAimCortexA8Lib.o cacheCortexA8ALib.o \
               cacheAimCortexA9Lib.o cacheCortexA9ALib.o \
               cacheAimCortexA15Lib.o cacheCortexA15ALib.o \
               cacheAimArch6IInvalidateAll.o \
               cacheAimArch6DClear.o cacheAimArch6DFlush.o \
               cacheAimArch6DInvalidate.o cacheAimArch6IClearDisable.o \
               cacheAimArch6IInvalidate.o \
               cacheAimArch6PipeFlush.o cpuPwrArchLib.o \
               mmuArchVars.o mmuALib2.o mmuMapLib.o \
               mmuCortexA8ALib.o mmuCortexA8Lib.o \
               vfpALib.o vfpArchLib.o vfpArchLibShow.o

OBJS_ARMARCH7_T2_COMMON = $(OBJS_ARMARCH7_COMMON)

# NOTE: Some of the "common" objects are implemented for ARMv7M in the
#       .../arm-m directory and are not in this list.
OBJS_ARMARCH7M_COMMON = \
               archSysctl.o dbgArchLib.o dbgArmLib.o dsmLib.o \
               elfArm.o \
               in_cksum.o \
               objALib.o objArchLib.o  \
               sysOsmLib.o trcALib.o trcArchLib.o \
               vxALib.o vxAtomicALib.o vxbAccessArchLib.o \
               vxCpuArchLib.o vxCpuALib.o vxCpuIdArchALib.o \
               vxLib.o vxMemProbeArchALib.o vxMemProbeArchLib.o \
               cpuPwrArchLib.o

OBJS_XSCALE_COMMON = \
               cacheArchVars.o cacheALib2.o \
               cacheAimXSCALECommonLib.o cacheAimXSCALEALib.o \
               mmuArchVars.o mmuALib2.o mmuMapLib.o \
               mmuXSCALELib.o mmuXSCALEALib.o \
               vfpALib.o vfpArchLib.o vfpArchLibShow.o

OBJS_MANZANO_COMMON = \
               cacheArchVars.o cacheALib2.o \
               cacheAimManzanoCommonLib.o cacheAimManzanoALib.o \
               mmuArchVars.o mmuALib2.o mmuMapLib.o \
               mmuManzanoLib.o mmuManzanoALib.o \
               vfpALib.o vfpArchLib.o vfpArchLibShow.o

OBJS_ARMARCH4        = $(OBJS_COMMON) $(OBJS_ARM_OPTIM) $(OBJS_ARMARCH4_COMMON)

OBJS_ARMARCH5        = $(OBJS_COMMON) $(OBJS_ARM_OPTIM) $(OBJS_ARMARCH5_COMMON)

OBJS_ARMARCH6        = $(OBJS_COMMON) $(OBJS_ARM_OPTIM) $(OBJS_ARMARCH6_COMMON)

OBJS_ARMARCH7_T2     = $(OBJS_COMMON) $(OBJS_ARM_OPTIM) \
					$(OBJS_ARMARCH7_T2_COMMON)

OBJS_ARMARCH7        = $(OBJS_COMMON) $(OBJS_ARM_OPTIM) $(OBJS_ARMARCH7_COMMON)

OBJS_XSCALE          = $(OBJS_COMMON) $(OBJS_ARM_OPTIM) $(OBJS_XSCALE_COMMON)

OBJS_MANZANO          = $(OBJS_COMMON) $(OBJS_ARM_OPTIM) $(OBJS_MANZANO_COMMON)

OBJS_ARMARCH7M	     = $(OBJS_ARMARCH7M_COMMON) $(OBJS_ARM_OPTIM)

include $(TGT_DIR)/h/make/defs.singleCpuVariant

ifeq ($(findstring manzano,$(LIB_DIR_TAG)),manzano)
#
### Specialization of the build for XSCALE Manzano
#
#
OBJS=$(OBJS_MANZANO)

else


# Standard build
OBJS=$(OBJS_$(CPU))
endif

include $(TGT_DIR)/h/make/rules.library
