Add -MP option

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Add -MP option

tinycc-devel mailing list
Hi,

While looking into ways to improve my build system (prevent it from breaking when moving headers) I came across the -MP option.

Since tcc currently doesn't support I've written a small patch to enable it.

Please note that tcc's '-MP' implies '-MD' while gcc complains.

- bauen1




_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

0001-Added-MP-option.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Add -MP option

Christian Jullien-3
Hi,

Giving your patch a try, I see minor format differences with what gcc does. I prefer your format :o). So it look good.

How complex is it to support -MM which only generates dependencies for includes mentioned in your source file?

gcc -MM
Show dependencies of compilation units, excluding system header files. The printed output of dependencies is suitable to be copy-pasted into a Makefile.

In this case, you should also support -M option which is what you currently do.

gcc -M
Show dependencies of compilation units, including system header files. The printed output of dependencies is suitable to be copy-pasted into a Makefile.

C.

-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=[hidden email]] On Behalf Of bauen1 via Tinycc-devel
Sent: Saturday, February 01, 2020 12:08
To: [hidden email]
Cc: bauen1
Subject: [Tinycc-devel] Add -MP option

Hi,

While looking into ways to improve my build system (prevent it from breaking when moving headers) I came across the -MP option.

Since tcc currently doesn't support I've written a small patch to enable it.

Please note that tcc's '-MP' implies '-MD' while gcc complains.

- bauen1





_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Add -MP option

tinycc-devel mailing list
Thanks for the feedback,

On 2/4/20 12:07 PM, Christian Jullien wrote:
> Hi,
>
> Giving your patch a try, I see minor format differences with what gcc does. I prefer your format :o). So it look good.
>
> How complex is it to support -MM which only generates dependencies for includes mentioned in your source file?
>
> gcc -MM
> Show dependencies of compilation units, excluding system header files. The printed output of dependencies is suitable to be copy-pasted into a Makefile.

TinyCC doesn't currently keep track of the depth of includes as far as I can see, but it should be easy to add.

(Simply not adding entries generated by recursive calls of `tcc_add_file_internal` should work for this)

>
> In this case, you should also support -M option which is what you currently do.
>
> gcc -M
> Show dependencies of compilation units, including system header files. The printed output of dependencies is suitable to be copy-pasted into a Makefile.
Currently `gen_makedeps` opens a file, so a bit refactoring would be required, but possible.

>
> C.
>
> -----Original Message-----
> From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=[hidden email]] On Behalf Of bauen1 via Tinycc-devel
> Sent: Saturday, February 01, 2020 12:08
> To: [hidden email]
> Cc: bauen1
> Subject: [Tinycc-devel] Add -MP option
>
> Hi,
>
> While looking into ways to improve my build system (prevent it from breaking when moving headers) I came across the -MP option.
>
> Since tcc currently doesn't support I've written a small patch to enable it.
>
> Please note that tcc's '-MP' implies '-MD' while gcc complains.
>
> - bauen1
>
>
>
>

I did however achieve what I need, having system headers part of the makefile was an explicit goal for my project.
Due to lack of time I won't implement -M and -MM unless someone explicitly requests me to do so.

- bauen1


_______________________________________________
Tinycc-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel