[En-Nut-Discussion] Hoe to add dependency on included files?

Ulrich Prinz ulrich.prinz at googlemail.com
Sat Dec 17 13:13:08 CET 2011


Already thought about that problem. We could include the correct files
in the .nut control files. And then they might be cleand correctly. On
the other hand I donÄt understand why they are not cleand correctly as
they should be.

The make generates the nutinit.o where the nutinit.c resides. So make
clean should delete it there too except the clean sequence is not
correctly implemented in the Makefile.

The benefit of the c file including c files is that you have a central
station where you can see what is done. The problem is, that these
constructions are most time very ugly and may confuse editors.

I can live with both options but would prefer another one that might be
most descriptive:

The .nut file should set the right nutinit_ARCH.c for building and
that's it.

>From linker view it is totally unimportant how a file is named as long
as it supplies the needed functions.

Still we have to check if this is the best way with respect to the
different architectures we support. We face a lot of code overhead and
speed decrease because of the width of different architectures.

If we export functions like
int MyFunc( int, int)
we force AVR to always use its two 16 bit registers to be used and
always 16 bit math is applied to the values.

So we could say
int8_t MyFunc( int8_t, int8_t)
but then we produce a lot of overhead for ARM and some overhead for Cortex.

Unfortunately AVR is the architecture that needs most care to be taken
to keep speed high and flash footprint low.

I have actually no idea of how to split and merge that without
compromizes on the one or on the other side.


Am 12.12.2011 13:55, schrieb Uwe Bonnes:
> Hello,
> working with the devnit_m3n tree, please forgive if already fixed in
> trunk...
> ../nut/os/nutinit.c
> includes e.g.
> #elif defined(__arm__) && defined(__CORTEX__)
> #include "../arch/cm3/os/nutinit_cm3.c"
> Changing "../arch/cm3/os/nutinit_cm3.c" and running "make" in the build tree
> doesn't rebuild nutinit.o. I workaround by deleting os/nutinit.o and
> rebuilding.
> Is there an easy way to add the included files to the dependancy? Or, as
> there is no code in nut/os/nutinit.c, but only includes, could we drop this
> wrapper file and use the included files direct?
> Thanks

More information about the En-Nut-Discussion mailing list