Simple Embedded Code Example : Target Description File

Target Description File

This section describes details of the target description file. Some of the key words are actually strings that are basically copied to the Makefile that is created along with the generated code. For clarity, we call their type: makefile string. To use this feature, you should have certain basic knowledge about Makefile language and syntax. Examples of possible values for important key words are included in the sample code listing.

In particular, if you want to use $STM_ROOT as part of the value of a string or a makefile string key word, it is necessary to use a duplicate $ sign to correctly express the variable type. For example: “$$STM_ROOT”

Note that some of the keywords contain OS path information. You should be aware of the correct directory separator character to use for the target operating system.

The internal double quote character shown here should be replaced by the single quote character. For example, the line “ /D “PRT” should be “ /D ‘PRT’ “.

Example Code:

The following example is taken from the vxworks.rtrg file for the target OS: VxWorks.

 
{
#UNIX-like target OS:yes
#Link command:"LINK = $(LD)"
#System libraries:""
#Library extension:".a"
#Executable extension:""
#Output file keyword:"-o "
#Intrinsics library:"$(STM_ROOT)/lib/VxWorks/libintrinsics$(CPU).a"
#Scheduler library:"$(STM_ROOT)/lib/VxWorks /libscheduler$(CPU).a"
#Simulated scheduler library:"$(STM_ROOT)/lib/VxWorks /libsim_scheduler$(CPU).a"
#Debugger library:"$(STM_ROOT)/lib/VxWorks /libdbg$(CPU).a"
#GBA library:"$(STM_ROOT)/lib/VxWorks /libgba$(CPU).a"
#Panel library:"$(STM_ROOT)/lib/VxWorks /libpgertl$(CPU).a"
#Remote panel library:"$(STM_ROOT)/lib/VxWorks /librpgertl$(CPU).a"
#Additional libraries:""
#Object extension:".o"
#Archiv command:"$(AR) $(ARFLAGS) "
#File existing command:""
#File deleting command:"$(RM) "
#Make command:"$(MAKE) -f"
#Main file directory:"$(STM_ROOT)/lib/VxWorks/"
#CPU name:"CPU = I80486"
#Ranlib command:""
#K&R C compiler name:""
#K&R C compiler flags:
"STM_CFLAGS = -O -I$( STM_ROOT )/etc/prt/c -I$( STM_ROOT )/etc/sched -DPRT -DVxWorks"
"TOOL = gnu"
"include $(WIND_BASE)/target/h/make/defs.bsp"
"include $(WIND_BASE)/target/h/make/make.$(CPU)$(TOOL)"
"include $(WIND_BASE)/target/h/make/defs.$(WIND_HOST_TYPE)"
"include $(WIND_BASE)/target/h/make/rules.bsp"
"INCLUDE_QUALIFIER=-I"
"CC_OPTIM += $(STM_CFLAGS)"
#ANSI C compiler name:""
#ANSI C compiler flags:
"STM_CFLAGS= -O -I$( STM_ROOT )/etc/prt/ansic -I$( STM_ROOT )/etc/ansisched -DPRT - VxWorks"
"TOOL = gnu"
"include $(WIND_BASE)/target/h/make/defs.bsp"
"include $(WIND_BASE)/target/h/make/make.$(CPU)$(`TOOL)"
"include $(WIND_BASE)/target/h/make/defs.$(WIND_HOST_TYPE)"
"include $(WIND_BASE)/target/h/make/rules.bsp"
"INCLUDE_QUALIFIER=-I"
"CC_OPTIM += $(STM_CFLAGS)"
#Link flags:"-r "
#Make script name:""
#Run script name:"%STM_ROOT%\misc\VxWorks\run_windsh mary"
}