[En-Nut-Discussion] Allow to specify dependancies

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Jul 3 13:13:31 CEST 2012


I just checked in to SVN a patch for tools/nutconf/src/nutcomponent.c and
tools/qnutconf/src/nutcomponent.c to allow to specify dependancies. The CM3
NXP and STM32 drivers make often use of a device-instance specific setup file
that includes a instance-independant device driver. Changing the
instance-independant device driver and recompiling the library has no
effect, as make doesn't know about this inclusion. So now in the .nut file
one can specify these dependancies like

      sources = { "cm3/dev/stm/ih_stm32_exti9_5.c" },
      depends = { "cm3/dev/stm/ih_stm32_exti.c" },

which will result in the Makefile in a line

cm3/dev/stm/ih_stm32_exti9_5.o: cm3/dev/stm/ih_stm32_exti.c

after the all: target.

There is a one-to-one relation between the list in sources and depends, the
first source file gets a dependcy on the first file in the depends list, the
second source to the second depends until there are no more file in one of
the lists. E.r.

       sources = { "cm3/dev/stm/ih_stm32_exti0.c",
                   "cm3/dev/stm/ih_stm32_exti4.c" },
       depends = { "cm3/dev/stm/ih_stm32_exti.c",

results in
cm3/dev/stm/ih_stm32_exti0.o: cm3/dev/stm/ih_stm32_exti.c
cm3/dev/stm/ih_stm32_exti1.o: cm3/dev/stm/ih_stm32_exti.c
cm3/dev/stm/ih_stm32_exti2.o: cm3/dev/stm/ih_stm32_exti.c
cm3/dev/stm/ih_stm32_exti3.o: cm3/dev/stm/ih_stm32_exti.c
cm3/dev/stm/ih_stm32_exti4.o: cm3/dev/stm/ih_stm32_exti.c

This doesn't solve the problem with nut/os/nutinit.c including e.g
nut/arch/cm3/os/nutinit_cm3.c, But by manually adding
        sources = { "nutinit.c" },
>>        depends = { "../arch/cm3/os/nutinit_cm3.c" },
        targets = { "nutinit.o" },

this can be fixed locally. An automatic solution is welcome.

Any objections?

Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the En-Nut-Discussion mailing list