this post was submitted on 12 Sep 2023
6 points (100.0% liked)

C Programming Language

972 readers
1 users here now

Welcome to the C community!

C is quirky, flawed, and an enormous success.
... When I read commentary about suggestions for where C should go, I often think back and give thanks that it wasn't developed under the advice of a worldwide crowd.
... The only way to learn a new programming language is by writing programs in it.

© Dennis Ritchie

🌐 https://en.cppreference.com/w/c

founded 1 year ago
MODERATORS
 

I'll explain myself. I'm doing a small project using a few dependencies, so I have to add them when I call gcc. Everything else is really easy. I just have c files and header files. I find it really cumbersome to have to tell make what headers go with what c files when they have the same name. I don't see why we don't have a build system where you simply have to give a project folder with the name of source file with the main() function, give the name of the output executable, the external dependecies to be called with gcc, and that's it. Everything else can be automatically detected and linked apropriately, even with multiple folders inside the project folder. Does something like that exist that's simple to use, or is this doable in make?

you are viewing a single comment's thread
view the rest of the comments
[–] lysdexic@programming.dev 1 points 1 year ago* (last edited 1 year ago) (1 children)

I don’t see why we don’t have a build system where you simply have to give a project folder with the name of source file with the main() function, give the name of the output executable, the external dependecies to be called with gcc, and that’s it.

But we do. Check out CMake.

https://cmake.org/examples/

Originally CMake was a higher level abstraction over make, and generated makefiles based from the high-level project description. Nowadays it supports other build automation tools, such as Ninja, Visual Studio, Xcode, etc.

[–] UFODivebomb@programming.dev 1 points 1 year ago (1 children)

Ah cmake. Boring but definitely works reliably for C/C++

[–] lysdexic@programming.dev 1 points 1 year ago (1 children)

What do you mean by "boring" ?

[–] UFODivebomb@programming.dev 1 points 1 year ago

It's boring like a good tool should be: does what it says. No fuss. No cloud of hype.