Skip to contentSkip to conversation

how to see cpp(C preprocessor) output for a file?

DISCUSSION [email protected] 2 participants 6 messages Dec 14, 2021 – Dec 15, 2021

lore
Share & tools
lore
#0 lore raw

Hello,

Is there any way I can see the cpp output of a file (for example arch/arm/lib/vsprintf.c) after the build? (in the Makefile option for example)

I see some code not executed though I think I have all the configs for the lines.

Thanks!

Chan Kim

#1 lore raw
Quoted 5 lines · On 14/12/2021 09.23, [email protected] wrote:

Hello,

Is there any way I can see the cpp output of a file (for example arch/arm/lib/vsprintf.c) after the build? (in the Makefile option for example)

make foo/bar/baz.i

for any foo/bar/baz.c file which normally produces foo/bar/baz.o.

If you have a arch/bla/xyz.S file, you can similarly do

make arch/bla/xyz.s

to run the preprocessor on the .S code. And if you want to see the assembly generated from a .c file,

make foo/bar/baz.s

also works.

Rasmus

author
#2 lore raw

Wow that would be very helpful.
Thank you!
Chan

Quoted 29 lines

-----Original Message-----
From: Rasmus Villemoes <[email protected]>
Sent: Tuesday, December 14, 2021 9:23 PM
To: [email protected]; [email protected]
Subject: Re: how to see cpp(C preprocessor) output for a file?

Quoted 5 lines · On 14/12/2021 09.23, [email protected] wrote:

Hello,

Is there any way I can see the cpp output of a file (for example arch/arm/lib/vsprintf.c) after the build? (in the Makefile option for example)

make foo/bar/baz.i

for any foo/bar/baz.c file which normally produces foo/bar/baz.o.

If you have a arch/bla/xyz.S file, you can similarly do

make arch/bla/xyz.s

to run the preprocessor on the .S code. And if you want to see the assembly generated from a .c file,

make foo/bar/baz.s

also works.

Rasmus

author
#3 lore raw
In reply to Rasmus Villemoes

But when I do
make CROSS_COMPILE=aarch64-none-elf- lib/tiny-printf.1
make: *** No rule to make target 'lib/tiny-printf.1'. Stop. It doesn't work for me..
But make x/y/z.s works.

Quoted 41 lines

-----Original Message-----
From: Chan Kim <[email protected]>
Sent: Tuesday, December 14, 2021 11:56 PM
To: 'Rasmus Villemoes' <[email protected]>; 'u- [email protected]' <[email protected]>
Subject: RE: how to see cpp(C preprocessor) output for a file?

Wow that would be very helpful.
Thank you!
Chan

Quoted 30 lines

-----Original Message-----
From: Rasmus Villemoes <[email protected]>
Sent: Tuesday, December 14, 2021 9:23 PM
To: [email protected]; [email protected]
Subject: Re: how to see cpp(C preprocessor) output for a file?

Quoted 6 lines · On 14/12/2021 09.23, [email protected] wrote:

Hello,

Is there any way I can see the cpp output of a file (for example arch/arm/lib/vsprintf.c) after the build? (in the Makefile option for
example)

make foo/bar/baz.i

for any foo/bar/baz.c file which normally produces foo/bar/baz.o.

If you have a arch/bla/xyz.S file, you can similarly do

make arch/bla/xyz.s

to run the preprocessor on the .S code. And if you want to see the assembly generated from a .c file,

make foo/bar/baz.s

also works.

Rasmus

#4 lore raw
Quoted 3 lines · Chan Kim

But when I do
make CROSS_COMPILE=aarch64-none-elf- lib/tiny-printf.1
make: *** No rule to make target 'lib/tiny-printf.1'. Stop.

letter i , not digit 1

Rasmus

author
#5 lore raw

Ah, sorry, thanks!
Chan

Quoted 14 lines

-----Original Message-----
From: Rasmus Villemoes <[email protected]>
Sent: Wednesday, December 15, 2021 4:29 PM
To: Chan Kim <[email protected]>; [email protected]
Subject: Re: how to see cpp(C preprocessor) output for a file?

Quoted 3 lines · Chan Kim

But when I do
make CROSS_COMPILE=aarch64-none-elf- lib/tiny-printf.1
make: *** No rule to make target 'lib/tiny-printf.1'. Stop.

letter i , not digit 1

Rasmus