[riot-notifications] [RIOT-OS/RIOT] make: Allow for true pseudo-submodules (#10970)

Gaëtan Harter notifications at github.com
Mon Jul 29 16:49:33 CEST 2019


> > The `wildcard` should be around everything else.
> 
> What do you mean by "everything else"?

I meant around the value: `$(wildcard $(patsubst ...)`

> > It would be equivalent to by default doing SUBMODULE_NOFORCE = 1 handled below.
> > It would in the current state prevent wrong module name detection which there currently is.
> 
> This onl is used by `makefiles/periph.mk` and seems to me more like a patch on top of the deeper problem that `SUBMODULES` basically makes it impossible to have true pseudo-submodules.
> I don't understand the meaning your last sentence means.

I think, the reason to not allow real pseudomodules by default and so not do the `SUBMODULE_NOFORCE` behavior was to provide errors on non existing submodule.

<details><summary><code>USEMODULE=core_not_an_existing_submodule make --no-print-directory -C examples/hello-world/</code></summary>

```
USEMODULE=core_not_an_existing_submodule make --no-print-directory -C examples/hello-world/
Building application "hello-world" for "native" with MCU "native".

"make" -C /home/harter/work/git/RIOT/boards/native
"make" -C /home/harter/work/git/RIOT/boards/native/drivers
"make" -C /home/harter/work/git/RIOT/core
make[2]: *** No rule to make target 'not_an_existing_submodule.c', needed by '/home/harter/work/git/RIOT/examples/hello-world/bin/native/core/not_an_existing_submodule.o'.  Stop.
/home/harter/work/git/RIOT/Makefile.base:20: recipe for target 'ALL--/home/harter/work/git/RIOT/core' failed
make[1]: *** [ALL--/home/harter/work/git/RIOT/core] Error 2
/home/harter/work/git/RIOT/examples/hello-world/../../Makefile.include:473: recipe for target '/home/harter/work/git/RIOT/examples/hello-world/bin/native/application_hello-world.a' failed
make: *** [/home/harter/work/git/RIOT/examples/hello-world/bin/native/application_hello-world.a] Error 2
```
</details>

So the same way as you have an error when you ask for a non existing module.

<details><summary><code>USEMODULE=not_an_existing_module make --no-print-directory -C examples/hello-world/</code></summary>

```
USEMODULE=not_an_existing_module make --no-print-directory -C examples/hello-world/
Building application "hello-world" for "native" with MCU "native".

"make" -C /home/harter/work/git/RIOT/boards/native
"make" -C /home/harter/work/git/RIOT/boards/native/drivers
"make" -C /home/harter/work/git/RIOT/core
"make" -C /home/harter/work/git/RIOT/cpu/native
"make" -C /home/harter/work/git/RIOT/cpu/native/periph
"make" -C /home/harter/work/git/RIOT/cpu/native/vfs
"make" -C /home/harter/work/git/RIOT/drivers
"make" -C /home/harter/work/git/RIOT/drivers/periph_common
"make" -C /home/harter/work/git/RIOT/sys
"make" -C /home/harter/work/git/RIOT/sys/auto_init
gcc: error: /home/harter/work/git/RIOT/examples/hello-world/bin/native/not_an_existing_module.a: No such file or directory
/home/harter/work/git/RIOT/examples/hello-world/../../Makefile.include:470: recipe for target '/home/harter/work/git/RIOT/examples/hello-world/bin/native/hello-world.elf' failed
make: *** [/home/harter/work/git/RIOT/examples/hello-world/bin/native/hello-world.elf] Error 1
```
</details>

Which would not for a `periph_` as this does not produce any error 

    USEMODULE=periph_beer_tap make --no-print-directory -C examples/hello-world/`


I started working on it too for https://github.com/RIOT-OS/RIOT/pull/11781/files#r303438572 and I remembered this PR existed.
It would somehow require listing all the valid module names when using `SUBMODULES` so the `SUBMODULES` and the `PSEUDOMODULES` for that file. (listing the `SUBMODULES` instead of doing `= 1` is for me a good thing).
Or list them all as `SUBMODULES` directly to make it simpler.
I am not sure how to do it to be consistent with other modules that have `pseudo-modules`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10970#issuecomment-516024084
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190729/a91100ab/attachment-0001.htm>


More information about the notifications mailing list