ADS 1.2 thumb makfile generate | developer.brewmp.com ADS 1.2 thumb makfile generate | developer.brewmp.com

Developer

ADS 1.2 thumb makfile generate

#============================================================================
# Name:
# $(TARGET).MAK
#
# Description:
# Makefile to build the $(TARGET) downloadable module.
#
# The following nmake targets are available in this makefile:
#
# all - make .elf and .mod image files (default)
# clean - delete object directory and image files
# filename.o - make object file
#
# The above targets can be made with the following command:
#
# nmake /f $(TARGET).mak [target]
#
# Assumptions:
# 1. The environment variable ADSHOME is set to the root directory of the
# arm tools.
# 2. The version of ADS is 1.2 or above.
#
# Notes:
# None.
#
#
# Copyright © 2000-2001 QUALCOMM Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#----------------------------------------------------------------------------
#============================================================================
ARM_HOME =$(ARMHOME)
BREW_HOME =$(BREWDIR)
TARGET =revival
OBJS =AEEAPP~1.o AEEMOD~1.o Applet.o Core.o Device.o EVENTH~1.o BACKGR~1.o Util.o DDBitmap.o DIBitmap.o DIBITM~1.o DIBITM~2.o Music.o Sound.o Game.o AI.o City.o CityBean.o CONSTA~1.o Dialog.o DINITS~1.o Form.o FormBean.o Intro.o MAINCA~1.o Map.o Menu.o MESSAG~1.o Saver.o UnitBean.o Utils.o GameLib.o DByte.o DInteger.o DMath.o DObject.o DPRIMI~1.o DRuntime.o DShort.o DString.o DSTRIN~1.o DSystem.o DTHROW~1.o DCanvas.o DDisplay.o DGRAPH~1.o DImage.o DGAMEC~1.o DMIDlet.o DRECOR~1.o D7ZIPI~1.o DBYTEA~1.o DBYTEA~2.o DDATAI~1.o DDATAO~1.o DINPUT~1.o DOUTPU~1.o DENUME~1.o DHASHT~1.o DVector.o
APP_INCLUDES =-I $(BREWDIR)\inc

#-------------------------------------------------------------------------------
# Target file name and type definitions
#-------------------------------------------------------------------------------

EXETYPE = elf # Target image file format
MODULE = mod # Downloadable module extension

#-------------------------------------------------------------------------------
# Target compile time symbol definitions
#
# Tells the SDK source stuffs that we're building a dynamic app.
#-------------------------------------------------------------------------------

DYNAPP = -DDYNAMIC_APP

#-------------------------------------------------------------------------------
# Software tool and environment definitions
#-------------------------------------------------------------------------------

AEESRCPATH = $(BREW_HOME)\src
AEEINCPATH = $(BREW_HOME)\inc

ARMBIN = $(ARM_HOME)\bin # ARM ADS application directory
ARMINC = $(ARM_HOME)\include # ARM ADS include file directory
ARMLIB = $(ARM_HOME)\lib # ARM ADS library directory

ARMCC = $(ARMBIN)\armcc # ARM ADS ARM 32-bit inst. set ANSI CPP compiler
ARMCPP = $(ARMBIN)\armcpp # ARM ADS ARM 32-bit inst. set ANSI CPP compiler
THUMBCC = $(ARMBIN)\tcc
THUMBCPP = $(ARMBIN)\tcpp
LD = $(ARMBIN)\armlink # ARM ADS linker
HEXTOOL = $(ARMBIN)\fromelf # ARM ADS utility to create hex file from image

OBJ_CMD = -o # Command line option to specify output filename

#-------------------------------------------------------------------------------
# Processor architecture options
#-------------------------------------------------------------------------------

CPU = -cpu ARM7TDMI # ARM7TDMI target processor

#-------------------------------------------------------------------------------
# ARM Procedure Call Standard (APCS) options
#-------------------------------------------------------------------------------

ROPI = -ropi # Read-Only(code) Position independence
INTERWRK = -interwork # Allow ARM-Thumb interworking

APCS = -apcs /$(ROPI)/$(INTERWRK)/norwpi

#-------------------------------------------------------------------------------
# Additional compile time error checking options
#-------------------------------------------------------------------------------

CHK = -fa # Check for data flow anomolies

#-------------------------------------------------------------------------------
# Compiler output options
#-------------------------------------------------------------------------------

OUT = -c # Object file output only

#-------------------------------------------------------------------------------
# Compiler/assembler debug options
#-------------------------------------------------------------------------------

DBG = -g # Enable debug

#-------------------------------------------------------------------------------
# Compiler optimization options
#-------------------------------------------------------------------------------

OPT = -Ospace -O2 # Full compiler optimization for space

#-------------------------------------------------------------------------------
# Compiler code generation options
#-------------------------------------------------------------------------------

END = -littleend # Compile for little endian memory architecture
ZA = -zo # LDR may only access 32-bit aligned addresses

CODE = $(END) $(ZA)

#-------------------------------------------------------------------------------
# Include file search path options
#-------------------------------------------------------------------------------

INC = -I. -I$(AEEINCPATH) $(APP_INCLUDES)

#-------------------------------------------------------------------------------
# Compiler pragma emulation options
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
# Linker options
#-------------------------------------------------------------------------------

LINK_CMD = -o #Command line option to specify output file
#on linking

ROPILINK = -ropi #Link image as Read-Only Position Independent

LINK_ORDER = -first AEEMod_Load

#-------------------------------------------------------------------------------
# HEXTOOL options
#-------------------------------------------------------------------------------

BINFORMAT = -bin

#-------------------------------------------------------------------------------
# Compiler flag definitions
#-------------------------------------------------------------------------------

CFLAGS0 = $(OUT) $(DYNAPP) $(CPU) $(APCS) $(CODE) $(CHK) $(DBG)
CFLAGS = $(CFLAGS0) $(OPT)

#-------------------------------------------------------------------------------
# Linker flag definitions
#-------------------------------------------------------------------------------

# the -entry flag is not really needed, but it keeps the linker from reporting
# warning L6305W (no entry point). The address
#LFLAGS = $(ROPILINK) -rwpi -entry 0x8000#

#----------------------------------------------------------------------------
# Default target
#----------------------------------------------------------------------------

all : $(TARGET).$(MODULE)

#----------------------------------------------------------------------------
# Clean target
#----------------------------------------------------------------------------

# The object subdirectory, target image file, and target hex file are deleted.

clean :
@echo ---------------------------------------------------------------
@echo CLEAN
-del /f $(OBJS)
-del /f $(TARGET).$(EXETYPE)
-del /f $(TARGET).$(MODULE)
@echo ---------------------------------------------------------------

#============================================================================
# DEFAULT SUFFIX RULES
#============================================================================

# The following are the default suffix rules used to compile all objects that
# are not specifically included in one of the module specific rules defined
# in the next section.

# The following macros are used to specify the output object file, MSG_FILE
# symbol definition and input source file on the compile line in the rules
# defined below.

SRC_CPP_FILE = $(@F:.o=.cpp) # Input source file specification
SRC_C_FILE = $(@F:.o=.c) # Input source file specification
OBJ_FILE = $(OBJ_CMD) $(@F) # Output object file specification

.SUFFIXES :
.SUFFIXES : .o .dep .c .cpp

#--------------------------------------------------------------------------
# C code inference rules
#----------------------------------------------------------------------------
.cpp.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(THUMBCPP) $(CFLAGS) $(INC) $(OBJ_FILE) $(SRC_CPP_FILE)
@echo ---------------------------------------------------------------
{$(AEESRCPATH)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(AEESRCPATH)\$(SRC_C_FILE)
@echo ---------------------------------------------------------------
#===============================================================================
# MODULE SPECIFIC RULES
#===============================================================================
APP_OBJS = $(OBJS)
#----------------------------------------------------------------------------
# Lib file targets
#----------------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
@echo ---------------------------------------------------------------
@echo TARGET $@
$(HEXTOOL) $(TARGET).$(EXETYPE) $(BINFORMAT) $(TARGET).$(MODULE)
$(TARGET).$(EXETYPE) : $(APP_OBJS)
@echo ---------------------------------------------------------------
@echo TARGET $@
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LFLAGS) $(APP_OBJS) $(LINK_ORDER)
#----------------------------------------------------------------------------
# Applet Specific Rules
#----------------------------------------------------------------------------
RULE1 = j:\brew\sdk\main\sdk\src
{$(RULE1)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(RULE1)\$(SRC_C_FILE)
@echo ---------------------------------------------------------------
RULE2 = j:\Projects\HE0FB1~1\revival
{$(RULE2)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(THUMBCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(RULE2)\$(SRC_C_FILE)
@echo ---------------------------------------------------------------

#--------------------------------------------------------------------------
# C code inference rules
#----------------------------------------------------------------------------
.cpp.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(THUMBCPP) $(CFLAGS) $(INC) $(OBJ_FILE) $(SRC_CPP_FILE)
@echo ---------------------------------------------------------------
{$(AEESRCPATH)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(AEESRCPATH)\$(SRC_C_FILE)
@echo ---------------------------------------------------------------
#===============================================================================
# MODULE SPECIFIC RULES
#===============================================================================
APP_OBJS = $(OBJS)
#----------------------------------------------------------------------------
# Lib file targets
#----------------------------------------------------------------------------
$(TARGET).$(MODULE) : $(TARGET).$(EXETYPE)
@echo ---------------------------------------------------------------
@echo TARGET $@
$(HEXTOOL) $(TARGET).$(EXETYPE) $(BINFORMAT) $(TARGET).$(MODULE)
$(TARGET).$(EXETYPE) : $(APP_OBJS)
@echo ---------------------------------------------------------------
@echo TARGET $@
$(LD) $(LINK_CMD) $(TARGET).$(EXETYPE) $(LFLAGS) $(APP_OBJS) $(LINK_ORDER)
#----------------------------------------------------------------------------
# Applet Specific Rules
#----------------------------------------------------------------------------
RULE1 = j:\brew\sdk\main\sdk\src
{$(RULE1)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(ARMCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(RULE1)\$(SRC_C_FILE)
@echo ---------------------------------------------------------------
RULE2 = j:\Projects\HE0FB1~1\revival
{$(RULE2)}.c.o:
@echo ---------------------------------------------------------------
@echo OBJECT $(@F)
$(THUMBCC) $(CFLAGS) $(INC) $(OBJ_FILE) $(RULE2)\$(SRC_C_FILE)
@echo ---------------------------------------------------------------

It is generated mod file of the smaller size, than in ARM mode is, but phone is crashes!
Please, where can be a mistake??

It is generated mod file of the smaller size, than in ARM mode is, but phone is crashes!
Please, where can be a mistake??

Jack,
instead of posting the makefile which is a bit too much to digest, can you post the salient parts of the commands that it executes instead. For example,
c:\apps\arm\rvct30\bin\armcc -DHACK_AECHAR -DDYNAMIC_APP --cpu ARM7TDMI-S --apcs /interwork --littleend -g -Ospace -O2 -IC:\PROGRA~1\BREW31~1.5\sdk\inc -IC:\Bananas\Projects\BREW\Libraries\Utils\inc -IC:\Apps\ARM\RVCT30\RVCT\Data\3.0\651\include\windows -c -o build\rvct30\src\brew\AEEAppGen.os build\rvct30\src\brew\AEEAppGen.c
and so forth.
obviously if you have 50 files in your project, don't paste the compile line for all of them, just a suitable sample.
That'll make it much easier to see what the problem is.

Jack,
instead of posting the makefile which is a bit too much to digest, can you post the salient parts of the commands that it executes instead. For example,
c:\apps\arm\rvct30\bin\armcc -DHACK_AECHAR -DDYNAMIC_APP --cpu ARM7TDMI-S --apcs /interwork --littleend -g -Ospace -O2 -IC:\PROGRA~1\BREW31~1.5\sdk\inc -IC:\Bananas\Projects\BREW\Libraries\Utils\inc -IC:\Apps\ARM\RVCT30\RVCT\Data\3.0\651\include\windows -c -o build\rvct30\src\brew\AEEAppGen.os build\rvct30\src\brew\AEEAppGen.c
and so forth.
obviously if you have 50 files in your project, don't paste the compile line for all of them, just a suitable sample.
That'll make it much easier to see what the problem is.

Hi ,
This post really helped me to generate mod file with thumbmode. I just wan some one to giv look to above make file , for some options that can be changed to reduce more code.
Hoping for some quick replies.
regards
Ashu

Hi ,
This post really helped me to generate mod file with thumbmode. I just wan some one to giv look to above make file , for some options that can be changed to reduce more code.
Hoping for some quick replies.
regards
Ashu