Error with Makefile leaf template

Travis Wheatley travis.wheatley at
Mon May 2 20:53:41 UTC 2016

So far I have successfully built RTEMs and have loaded and executed sample code on to my target platform. Now it’s time to set up a build environment for the application I will be developing. I located the …rtems4.12/make/README file and believe I have followed the instructions. I have created a directory in which to locate my application and have created a basic hello.c source file. I copied the Makefile.leaf file from the Templates folder into my application folder and have modified it to add my source files as indicated. I have also set up the requisite RTEMS_MAKEFILE_PATH and RTEMS_ROOT environment variables. At compile time an o-optimize (or o-debug depending on the make invocation) is created. However, in the case of “make all” I get the following when the build process attempts to run powerpc-rtems4.12-nm using ‘o-optimize/howdy’ as an input. I assume that it should be using ‘o-optimize/howdy.exe’ instead. Thus I am wondering if this is a bug in the build rules somewhere or if there is some subtlety I am missing when modifying the leaf makefile.

Also, I notice that the hello.exe file is rather large and there is no “ralf” file produced from this build process whereas the sample code that comes with RTEMS is rather small, produces a .ralf file in addition to the binary and gets linked with an entry point of 0x4000. Once again, I am wondering if there is something I am missing in setting up the makefile from the template or if the make process doesn’t really finish due to the errors I am seeing.

Here is the output I seen when I do “make all"

~/development/rtems/MyApp$ make all
powerpc-rtems4.12-gcc --pipe -B/home/firefly/development/rtems/bsps/4.12/powerpc-rtems4.12/qoriq_t2080rdb/lib/ -specs bsp_specs -qrtems   -Wall  -O2 -g -ffunction-sections -fdata-sections     -mcpu=e6500 -m32 -msdata=sysv -fno-common -D__ppc_generic -DHAS_UBOOT       -Wl,--gc-sections    -mcpu=e6500 -m32 -msdata=sysv -fno-common -D__ppc_generic -DHAS_UBOOT   -o o-optimize/howdy.exe  o-optimize/howdy.o       
powerpc-rtems4.12-nm -g -n o-optimize/howdy > o-optimize/howdy.num
powerpc-rtems4.12-nm: 'o-optimize/howdy': No such file
make: *** [o-optimize/howdy] Error 1
firefly at firefly-VirtualBox:~/development/rtems/MyApp$ 

Running “make debug” results in a different compile time error:

firefly at firefly-VirtualBox:~/development/rtems/MyApp$ make debug
make -f Makefile MAKEFILE=Makefile VARIANT=DEBUG
make[1]: Entering directory `/home/firefly/development/rtems/MyApp'
make[1]: *** No rule to make target `/home/firefly/development/rtems/bsps/4.12/powerpc-rtems4.12/qoriq_t2080rdb/lib/librtemsbsp_g.a', needed by `o-debug/howdy'.  Stop.
make[1]: Leaving directory `/home/firefly/development/rtems/MyApp'
make: *** [debug] Error 2

Here is what my makefile looks like:

# 	Template leaf node Makefile

# C source names, if any, go here -- minus the .c

# C++ source names, if any, go here -- minus the .cc


# Assembly source names, if any, go here -- minus the .S



include $(RTEMS_CUSTOM)
include $(RTEMS_ROOT)/make/leaf.cfg

# (OPTIONAL) Add local stuff here using +=


# CFLAGS_DEBUG_V are used when the `make debug' target is built.

LD_LIBS   +=

# Add your list of files to delete here.  The config files
#  already know how to delete some stuff, so you may want
#  to just run 'make clean' first to see what gets missed.
#  'make clobber' already includes 'make clean'


all:	${ARCH} $(SRCS) $(PGMS)

# The following links using C rules.
${ARCH}/howdy: ${OBJS} ${LINK_FILES}

# The following links using C++ rules to get the C++ libraries.
# Be sure you BSP has a make-cxx-exe rule if you use this.
# ${ARCH}/xxx-your-program-here: ${OBJS} ${LINK_FILES}
# 	$(make-cxx-exe)

# Install the program(s), appending _g or _p as appropriate.
# for include files, just use $(INSTALL_CHANGE)
install:  all

— Travis Wheatley

More information about the users mailing list