0

is there a way to compile all .cfiles in the current directory - including all .c files in all subfolders.

Trying out the Wildcard like gcc -c *.c searches only in the current directory...

Thank you in advance...

MWeb
  • 41
  • 1
  • 8
  • I think the MSYS environment should have the [`find`](http://man7.org/linux/man-pages/man1/find.1.html) command. That could be used. – Some programmer dude Dec 15 '17 at 08:33
  • 1
    `find $WORKSPACE -name "*.c" -exec gcc -c "{}" \;` works very well for me, thanks! My only further problem is, that when using this code snippet in Jenkins no error will be returned if one file isn't compilable... – MWeb Dec 15 '17 at 11:53
  • 1
    Perhaps you should be researching the topic of *makefiles*? You can still find source files using similar techniques (even though I rather recommend you explicitly list the files you need, think of the case if you have an experimental source file that you don't want to build with), but error when building one source file will lead to the whole `make` process being aborted. – Some programmer dude Dec 15 '17 at 11:57
  • Works wonderful with a makefile, thank you very much!! – MWeb Dec 19 '17 at 13:11

0 Answers0