[CMake] Cross compiling arm-elf on Windows host

Harald Kipp harald.kipp at egnite.de
Mon Sep 21 03:58:30 EDT 2009


Alexander Neundorf wrote:
> On Sunday 20 September 2009, Harald Kipp wrote:
>> Alexander Neundorf wrote:
>>> On Sunday 20 September 2009, Harald Kipp wrote:

>>>> add_library(nutfs STATIC basename dirent dirname) 
> I would recommend to use the full filename, i.e. including the suffix. So 
> probably basename.c etc.

Oops, I temporarily removed the extensions after finding make target
extensions like .c.o.


>>>>   Scanning dependencies of target nutfs
>>>>   [ 33%] Building C object fs/CMakeFiles/nutfs.dir/basename.c.obj
>>>>   Das System kann den angegebenen Pfad nicht finden.
>>> Try "VERBOSE=1 make" to see the full command which is executed.
>> I'll try to do this tommorrow.

As expected, make fails at the cd command using slashes instead of
backslashes:

[ 33%] Building C object fs/CMakeFiles/nutfs.dir/basename.c.obj
cd C:/ethernut-4.9.6/nutbld/fs &&
C:/Programme/yagarto/bin/arm-elf-gcc.exe    -o
CMakeFiles/nutfs.dir/basename.c.obj   -c C:/ethernut-4.9.6/nut/fs/basename.c
Das System kann den angegebenen Pfad nicht finden.

  (English: The system cannot find the specified path)

make[2]: *** [fs/CMakeFiles/nutfs.dir/basename.c.obj] Error 1
make[2]: Leaving directory `C:/ethernut-4.9.6/nutbld'
make[1]: *** [fs/CMakeFiles/nutfs.dir/all] Error 2
make[1]: Leaving directory `C:/ethernut-4.9.6/nutbld'
make: *** [all] Error 2


>>> You might try the nmake makefiles in case you have nmake.
>> I'll try this as well.

Unfortunately no luck. The generated Makefiles cannot be processed by
GNU make, because nmake partly uses a different syntax, like

!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF

Furthermore it adds the /nologo command line option when calling
$(MAKE), which is rejected by GNU make.


>> One reason for looking at CMake as an alternative to GNU autotools is,
>> that we do not want to force Windows users to install Cygwin or force OS
>> X users to install fink. It'd be great if CMake can help here.
> 
> Should do.

Sigh. Right now I do not see the light at the end of the tunnel. May be
I should explain my goal in more detail.

Our package exists of the RTOS source code, which may be build for
different targets (AVR, ARM, AVR32). Furthermore it contains the source
code of the "Configurator" tool, which creates several C header files
and Makefiles based on a target board config file. Running these
makefiles will create the RTOS for this specific target board.

Btw. the Configurator is based on the wxWidgets version of the eCos
configtool, but we replaced tcl by Lua.

On Linux and OS X we use GNU autotools to create the Configurator
executable. On Windows there is no such capability and the average user
must stick with the pre-build executable.

Then the Configurator must be executed manually to create the header and
Makefile files. Finally make will create the target binaries. These
steps are equal on all host platforms.

We could have used autotools to create the target binaries as well, but
not on Windows without installing a *nix environment.

The idea is to use CMake to automatically to

1. build the Configurator tool binary, checking the compiler available,
wxWidgets version etc.

2. run the Configurator for a specified target board, creating the C
headers and possibly one or more .cmake files for building the target
binaries

3. build the RTOS and sample applications, checking the cross compiler,
target run time library etc.

Thanks again for your time,

Harald




More information about the CMake mailing list