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

# Build configuration for wince_arm. The build host is a Win32 PC and
# the build target is a WinCE/ARM device.

host_os   = win32
host_arch = i386

ide_project_ext   = vcp
ide_workspace_ext = vcw

#Change for different versions of WinCE, 3.00 is for PocketPC 2002
export CE_SUBSYSTEM=windowsce,3.00
export CE_VERSION=300

#for PocketPC 2002 it is WIN32_PLATFORM_PSPC
export CE_PLATFORM=WIN32_PLATFORM_PSPC

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 = win32
    arch      = arm
    compiler  = visCPP

    export MSW_FIRST_FOR_DOUBLE     := true
    export MSW_FIRST_FOR_DOUBLE__BY := wince_arm.cfg

    CPP_DEF_FLAGS = -DARM=1 -DCROSS_GENERATOR=1 -DEVC_ASM_QUIRK=1
endif

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

    export MSW_FIRST_FOR_DOUBLE     := false
    export MSW_FIRST_FOR_DOUBLE__BY := wince_arm.cfg

    export ENABLE_C_INTERPRETER            := true
    export ENABLE_C_INTERPRETER__BY        := wince_arm.cfg
    export ENABLE_INTERPRETER_GENERATOR    := false
    export ENABLE_INTERPRETER_GENERATOR__BY:= wince_arm.cfg
    export TARGET_MSW_FIRST_FOR_DOUBLE     := true
    export TARGET_MSW_FIRST_FOR_DOUBLE__BY := wince_arm.cfg
    export TARGET_MSW_FIRST_FOR_LONG       := false
    export TARGET_MSW_FIRST_FOR_LONG__BY   := wince_arm.cfg
    carch                                   = arm
    iarch                                   = c
    CPP_DEF_FLAGS                          += -DARM -DCROSS_GENERATOR=1

endif

ifeq ($(IsTarget),true)
    # target/{cldc_vm.exe, cldc_vm_r.exe, cldc_vm_g.exe}.
    # These are pure WinCE/ARM binaries that run on the TARGET.
    os_family = wince
    arch      = arm
    compiler  = evc

    # Turn off ROM and INTERPRETER generators if possible to reduce size
    # of release and product builds
    ifneq (${ENABLE_MONET}, true)
    ifndef ENABLE_ROM_GENERATOR
    export ENABLE_ROM_GENERATOR             = false
    export ENABLE_ROM_GENERATOR__BY         = wince_arm.cfg
    endif
    endif
    ifndef ENABLE_INTERPRETER_GENERATOR
    export ENABLE_INTERPRETER_GENERATOR     = false
    export ENABLE_INTERPRETER_GENERATOR__BY = wince_arm.cfg
    endif

    export MSW_FIRST_FOR_DOUBLE     := true
    export MSW_FIRST_FOR_DOUBLE__BY := wince_arm.cfg

    CPP_DEF_FLAGS += -DARM
    LOOP_GEN_FLAGS         += +GenerateMicrosoftCode
endif

ifeq ($(IsProject),true)
    # project/cldc_vm.vcp, project/cldc_vm.vcw
    # These are EVC project files.
    os_family = wince
    arch      = arm
    compiler  = evc
endif

ifndef ENABLE_SOFT_FLOAT
export ENABLE_SOFT_FLOAT     := true
export ENABLE_SOFT_FLOAT__BY := wince_arm.cfg
endif
