How do I convert a C program to an .exe file?

Amaan Cheval amaan.cheval at gmail.com
Sat May 12 06:39:48 UTC 2018


Hey!

It looks like you're trying to compile the testsuite within the core
repository itself. This isn't how it's done because the core repo
provides the basis for specific BSP targets - for eg. how would the
Makefile for the core repo know which cross-compiler to use, with
which configure options you provided, etc.? This is generally called
an in-tree build (i.e. within the source-tree itself). My
understanding is that RTEMS does not do any in-tree builds whatsoever.

You need an out-of-tree build (i.e. where you have "build-dir-sparc"
and "rtems-kernel" directories as siblings, for eg.). This is
described as a quickstart in the docs here:
https://docs.rtems.org/branches/master/user/start/index.html

Since you want to also build the testsuite, i.e. an ".exe", you need
to also supply the "--enable-tests" option to the "configure" command.

This is the procedure for the testsuite, which is what you seem to
want. For compiling with RTEMS _in general_, for eg. with the
examples-v2 repo:
https://git.rtems.org/examples-v2/

You need to use the RTEMS_MAKEFILE_PATH variable. For eg.

make RTEMS_MAKEFILE_PATH=~/repos/rtems/b-i386/i386-rtems5/c/pc386/make

Where b-i386 is the name of my build-directory, i386-rtems5 is the
name of the target architecture (same as the "--target" option to the
configure command earlier), and "pc386" is the name of the BSP (same
as the "--enable-rtemsbsp" option in the configure command earlier).

What I've listed above is the "developer" method. For most users, the
RSB will be used to install both the target tools (for eg.
i386-rtems5-gcc) _and_ the RTEMS kernel itself. See the note about
RTEMS Releases here:

> The RSB found in a release will automatically build and install RTEMS. If you do not want a released version of the RSB to build RTEMS add --without-rtems to the command line. The development version requires adding --with-rtems to build RTEMS. Use this option to create a single command to build the tools and RTEMS.
> The source used in release builds is downloaded from the RTEMS FTP server. This ensures the source is always available for a release.

Source:
https://docs.rtems.org/branches/master/rsb/quick-start.html#building

For future reference: this seems like a question more suitable for the
rtems-users mailing list, I believe.

Hope that helps!

On Sat, May 12, 2018 at 9:11 AM, Danxue Huang <danxue.huang at gmail.com> wrote:
> Hi there,
>
> How do I convert a C program to an .exe file? I already got a "Makefile", I
> tried to run "make" but it doesn't work, the output is as below. Thank you
> so much for checking for me!
>
> dannie at dannie-VirtualBox:~/development/rtems/kernel/rtems/testsuites/samples/hello$
> make
> Makefile:14: /Makefile.inc: No such file or directory
> Makefile:16: /make/leaf.cfg: No such file or directory
> make: *** No rule to make target '/make/leaf.cfg'.  Stop.
>
> Best,
> Dannie
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list