Add file to Makefile

Ralf Corsepius ralf.corsepius at
Sat Aug 16 03:42:31 UTC 2008

On Sat, 2008-08-16 at 01:08 +0300, Leon Pollak wrote:
> Hello, all.
> Please, where can I read about how can I add an *.h file to the BSP build 
> tree.
Inside of the autotools' fine manuals.

In your case, reading about *_HEADERS and *_SOURCES in "info
automake" (rsp. is your friend.

As an introduction to the autotools, esp. for complete new-comers,
reading the "Goat book" ( is still
worth it.

> I searched bsp_howto.pdf, wiki - did not find.
> Tried to add it to - does not help, it is not copied to the build 
> tree...:-(
> Sorry to disturb, but these autotools are the great mystery for me...:-(
... your question is a mystery to me :-)

My guess is you are talking about "preinstalling" a header inside of the
build tree?

This question would only be marginally related to the autotools, it's an
RTEMS's build-system "feature" (More precisely: a hack to work-around
some issues with RTEMS historical source-tree structure/layout).

In this case, the detailed answer would be:

1. Edit your changes into your BSP's

Add your *.h to the *_HEADERS variable in your BSP's,
corresponding to the location where you want to install it to.

# cd c/src/lib/libbsp/<cpu>/<bsp>

Invoke an editor and add something similar to this to
include_foo_HEADERS += <source-subdir>/bar.h

2. Recreate ""
# cd c/src/lib/libbsp/<cpu>/<bsp>
# <top_sourcedir>/bootstrap -p

3. Regenerate autotool generated files:
# cd c/src/lib/libbsp/<cpu>/<bsp>
# <top_sourcedir>/bootstrap -r

Note 1: All these steps are a one-time effort. 
Afterwards, when building RTEMS, with maintainer-mode enabled (configure
--enable-maintainer-mode), all generated files will be updated
automatically, when necessary during the next "make run".

Note 2: When modifying an existing BSP, steps 2.+ 3. are optional and
will automatically be performed during the next "make run" when having
configured your build-tree with --enable-maintainer-mode.


More information about the users mailing list