cexp makefile
Till Straumann
strauman at slac.stanford.edu
Tue Aug 8 01:14:26 UTC 2006
There is a tool 'ldep' that generates the built-in symbol table
in source form ('.c' file) as a by-product of library dependency
analysis.
I use rules (allsyms.c is my symbol table; note that rules in this message
are simplified)
# -lxxx -lyyy -> o-optimize/libxxx.nm o-optimize/libyyy.nm
NMFILES=$(patsubst %.a,$(ARCH)/%.nm,$(sort $(patsubst -l%,lib%.a,$(filter -l%,$(ALL_LIBS)))))
# analyze library interdependencies and remove unwanted pieces;
# generate (-C) C file containing a symbol table definition for inclusion
# with cexp. The references from this code will trigger linkage of the
# desired library pieces...
$(ARCH)/allsyms.c: $(NMFILES)
$(LDEP) -C -F $(addprefix -o,$(NMFILES)) $(addprefix -x,$(EXCLUDE_LISTS))
# generate 'nm' file from library for input to ldep
$(ARCH)/%.nm: %.a
$(NM) -g -fposix $^ >$@
The idea is that you list all libraries you want to incorporate
into your application in 'ALL_LIBS'.
ldep then analyzes the library interdependencies and recursively
removes
a) 'dangling' unresolved symbol references
b) pieces you want to exclude from your application explicitely
(as specified in EXCLUDE_LISTS).
More information about LDEP, it's source code and a full RTEMS Makefile
is distributed with GeSys (generic system application) available from
http://www.slac.stanford.edu/~strauman/rtems/software.html
HTH
-- Till
On Mon, 2006-08-07 at 15:21 -0700, Allan Hessenflow wrote:
> Are there any example makefiles that use the RTEMS application makefile
> framework for building an application including cexp with a built-in
> symbol table? I can build an app that works with some manual steps,
> but am having trouble seeing how to fit the symbol table build into
> the RTEMS application makefiles in a reasonably clean manner.
>
> allan
>
More information about the users
mailing list