EmbDev.net

Forum: ARM programming with GCC/GNU tools Show filename while compiling


Author: A. S. (aleksazr)
Posted on:

Rate this post
0 useful
not useful
When I compile a larger list of files, i.e. a library,
MS VC shows something like "compiling source.c"
while GCC doesn't show anything, only warnings/errors.

Can I make GCC show the filenames?

Thanks

Author: Oliver (Guest)
Posted on:

Rate this post
0 useful
not useful
???

As gcc is a command line tool only, you control which files are 
compiled, by typing their names in the command.

If you use make with a makefile, gcc should be called individually for 
each source file, and you cann see the command line for each source 
file.

Oliver

Author: A. S. (aleksazr)
Posted on:

Rate this post
0 useful
not useful
I use the makefile, yes, with -s option (silent, probably).

Otherwise the screen is full of garbage (well, lots of unimportant 
information).

MS VC, on the other hand, simply shows "compiling source.c",
and not the complete path and each and every single command line option.

Thats what I want, just a simple "compiling source.c".

It can't be done? (w/o changing the makefile, and adding echo)

Author: ... (Guest)
Posted on:

Rate this post
0 useful
not useful
You can try something like this:
make -s CC="@echo \"compiling $@\"; gcc" CXX="@echo \"compiling $@\"; g++"

But better you change the makefile.

Author: olibert (Guest)
Posted on:

Rate this post
0 useful
not useful
gcc is blank compiler but as mentioned already make is used
to process the files.

It displays already which file is being compiled like here..

make  all-am
make[1]: Entering directory `/home/blah/src/banner-1.3.2'
gcc -DHAVE_CONFIG_H -I. -I. -I. -I.    -g -O2 -c banner.c
gcc  -g -O2   -o banner  banner.o

..but I think there is a misconception what make is intended for.
The approach is totally different compared to the MS stuff.

For instance make is also used for building sendmail config
files or NIS maps. These have nothing to do with compiling.
make provides a macro language to process files this includes
compiling but it is not limited to that.

You can edit the Makefile to add "compiling <blah"> but nobody
else would do so because the information is already provided
by a regular make run.

Author: A. S. (aleksazr)
Posted on:

Rate this post
0 useful
not useful
MS VC is the one that shows "compiling source.c", not the makefile.
GCC should be able to do the same, AFAIC.

But, I'll have to change the makefile, its not that hard after all.

Author: Johann L. (gjlayde)
Posted on:

Rate this post
0 useful
not useful
A. S. wrote:
> MS VC is the one that shows "compiling source.c", not the makefile.
> GCC should be able to do the same, AFAIC.

No.

There is no reason for a diagnostic message for a file that compiles 
fine.

http://gcc.gnu.org/onlinedocs/gcc/Translation-impl...

GCC does not print garbage, it's your Makefile setup.  Write a proper 
Makefile to fit your needs.

Author: ... (Guest)
Posted on:

Rate this post
0 useful
not useful
And also for MS, most messages came from MSBuild (slightly M$ equivalent 
to make), not from the compiler.

Author: ... (Guest)
Posted on:

Rate this post
0 useful
not useful
> There is no reason for a diagnostic message for a file that compiles fine.
For big projects it is sometimes nice to see the compiling progress to 
estimate the time you have for your coffee and/or cigarette :)
But as you already said: "Write a proper makefile to fit your needs."

Author: Rolf Magnus (Guest)
Posted on:

Rate this post
0 useful
not useful
Or use cmake to generate a Makefile. It does exactly that.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.