36
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
ImageCraft Assembler
The rules (for example,
obj/%.o : %.asm project.mk
and
obj/%.o : %.c project.mk
) in
the
local.dep
file shown above are the same rules found in the master
Makefile
with one addition
each. The addition in the redefined rules is to add each object (target) to a library called
PSoC-
ToolsLib.a
. For example:
$(foreach library_file, $(filter-out obj/main.o,
$@), $(Add_To_MyCustomLib))
The MAKE keyword
foreach
causes one piece of text (the first argument) to be used repeatedly,
each time with a different substitution performed on it. The substitution list comes from the second
foreach
argument.
In this second argument, there is another MAKE keyword/function called
filter-out
. The
fil-
ter-out
function removes
obj/main.o
from the list of all targets being built (for example,
obj/
%.o
). This was one of the goals for this example. You can filter out additional files by adding those
files to the first argument of
filter-out
such as:
$(filter-out obj/main.o obj/excludeme.o, $@)
.
The MAKE symbol combination
$@
is a shortcut syntax that refers to the list of all the targets (for
example,
obj/%.o
).
The third argument in the
foreach
function is expanded into a sequence of commands, for each
substitution, to update or add the object file to the library. This
local.dep
example is prepared to han-
dle both C and assembly source files and put them in the library,
PSoCToolsLib.a
. The library is cre-
ated/updated in the project root folder in this example. However, you can provide a full path to
another folder. For example:
$(LIBCMD) -a c:\temp\PSoCToolsLib.a $(library_file
.
Another goal was to not include the
boot.asm
file in the library. This is easy given that the master
Makefile
contains a separate rule for the
boot.asm
source file, which is not redefined in
local.dep
.
You can cut and paste this example and place it in a
local.dep
file in the root folder of any project. To
view messages in the Build tab of the Output Status window regarding the behavior of your custom
process, go to Tools > Options > Builder tab and click a check at “Use verbose build messages.“
Use the Project > Settings > Linker tab fields to add the library modules/library path if you want other
PSoC Designer projects to link in your custom library.
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...