EmbDev.net

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


von A. S. (aleksazr)


Rate this post
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

von Oliver (Guest)


Rate this post
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

von A. S. (aleksazr)


Rate this post
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)

von ... (Guest)


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

But better you change the makefile.

von olibert (Guest)


Rate this post
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.

von A. S. (aleksazr)


Rate this post
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.

von Johann L. (gjlayde)


Rate this post
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-implementation.html#Translation-implementation

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

von ... (Guest)


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

von ... (Guest)


Rate this post
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."

von Rolf Magnus (Guest)


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

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.