#
#   
#
# Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#

# Build configuration for generic_arm. The build host is a Win32 or Linux PC and
# the build target is a ADS/ARM device.


MakeDepsMain_generic     = ADSPlatform

MakeDepsOpts_generic     = -resolveVpath true

ifndef ENABLE_SOFT_FLOAT
export ENABLE_SOFT_FLOAT     = true
export ENABLE_SOFT_FLOAT__BY = generic_arm.cfg
endif

ifeq ($(ADS_LINUX_HOST),true)

    host_os              = linux
    host_compiler        = gcc

    ifneq ($(IsTarget), true)

    ifndef MERGE_SOURCE_FILES
    MERGE_SOURCE_FILES   = true
    endif

    ifndef SOURCE_MERGER_SIZE
    SOURCE_MERGER_SIZE   = 35
    endif

    # Always disable timer thread on 
    export ENABLE_TIMER_THREAD     := false
    export ENABLE_TIMER_THREAD__BY := generic_arm.cfg

    endif

else

    host_os              = win32
    host_compiler        = visCPP

endif

# IMPL_NOTE: don't forget endianess issues on Sparc Solaris
ifeq ($(ENABLE_C_INTERPRETER), true)
 host_arch           = c
else
 host_arch           = i386
endif

# The following two flags tells jvm.make to include the alternative
# platform/compiler makefiles:
#
# $(JVMWorkSpace)/build/ads/alt_platform.make
# $(JVMWorkSpace)/build/ads/alt_compiler.make

ALT_PLATFORM = ads
ALT_COMPILER = ads

ifeq ($(IsLoopGen),true)
    # LoopGen: an .exe that runs on the HOST. It has
    # an ARM assembler loop generator and will generate the ARM
    # assembler loop.
    os_family          = $(host_os)
    arch               = arm
    compiler           = $(host_compiler)
    CPP_DEF_FLAGS      = -DARM -DCROSS_GENERATOR=1 
endif

ifeq ($(IsRomGen),true)
    # RomGem: an .exe that runs on the HOST. It has
    # an i386 assembler or C loop. It runs on the HOST to
    # generate the (machine independent) ROM.cpp file.
    os_family      = $(host_os)
    arch           = $(host_arch)
    compiler       = $(host_compiler)
    ROM_GEN_FLAGS  =

    ifeq ($(ADS_LINUX_HOST),true)
    LOOP_GEN_ARG   = +GenerateGNUCode +GenerateAssemblyCode
    endif

endif

ifeq ($(IsTarget),true)
    # target/{cldc_vm.axf, cldc_vm_r.axf, cldc_vm_g.axf}.
    # These are pure STUB/ARM binaries that run on the TARGET.
    os_family = generic
    arch      = arm
    compiler  = ads

#----------------------------------------------------------------------
# FSImage is the 'file system image'. Default the VM will access EEMBC.jar
# the eembc.jar has been mapped into /src/vm/os/$(os_family)/FSImage.c by
# TCL Script: /internal_misc/make_fs_image.tcl. If you want the VM to access
# specified jar files, you need to copy all jar files into a directory, 
# and define FSIMAGE_SRCS which points to this directory.  Then all files 
# in this directory are mapped in FSImage.c,
# such that they will be accessible by the OsFile_$(os_family) functions.
#
# Note 1: If your computer doesn't support TCL Script or you don't specified p
# the File System Image, please don't define FSIMAGE_SRCS

# Note 2: currently you may not have subdirectories inside
# $(FSIMAGE_SRCS).
#----------------------------------------------------------------------

ifndef FSIMAGE_SRCS
# FSIMAGE_SRCS=		#FSIMAGE_SRCS should be defined here
endif

FSImage.o: FSImage.c 
	@echo " ... $(notdir $<)" 
	@armcc -c $<

EXE_OBJS +=         FSImage.o

#    ifndef MERGE_SOURCE_FILES
#    MERGE_SOURCE_FILES  = true
#    endif

#    ifndef SOURCE_MERGER_SIZE
#    SOURCE_MERGER_SIZE  = 35
#    endif

#    ifeq ($(ENABLE_THUMB_VM), true)
#    LOOP_GEN_FLAGS += +GenerateThumbInterwork
#    endif

    ifeq ($(ENABLE_SOFT_FLOAT), true)
    CPP_DEF_FLAGS +=
    LINK_FLAGS    += 
    endif

    # Always disable timer thread on 
    export ENABLE_TIMER_THREAD     := false
    export ENABLE_TIMER_THREAD__BY := generic_arm.cfg
endif
