Makefiles and compilers

Hello everyone
I've recently moved from windows to linux and i have already changed my programming habits from using only one IDE to terminal programming , invoke the compiler and linker by myself and dealing with makefiles.

I've already read some simple tutorials about the Gcc compiler and the GNU make , but they were only simple examples just to get you started.(compile source code , link it with libraries and stuff like that but in the simplest way)

I can write my own makefiles for my programs but but every time im reading someone's else makefiles they are nothing like mine.Too complicated and i cant understand much.
Also moving to linux i think the first compiler you run into is Gcc.But i dont know if is the most preferable compiler by the programmers and if it is better/worse than other compilers.

What i want to know is what tools are used the most by programmers under linux?

I started reading about the GNU make and the GCC compiler but since im not working on large projects i dont have the chance to practice too much of what i've learned about make and gcc and all i do is to use the same commands for the compiler and my makefiles are very simple and always the same thing(despite of what i see from others)
So what is the best way to learn more advanced topics about compilers and makefiles?And maybe provide some good tutorials to read

Thanks
GCC is the most common compiler you'll run into on Linux and BSD. It's the core GNU tool.

GNU Make, what can I say. Keep things as simple as possible and only add complexity where required. Having said that, there is a standard set of targets that one might expect in a Linux package. And not surprisingly, there's a set of packages to assist in keeping with this standard. They're autoconf, automake and libtool.

A good tutorial is here:
http://www.openismus.com/documents/linux/automake/automake.shtml
http://www.openismus.com/documents/linux/building_libraries/building_libraries.shtml

Some more blurb is here:
http://www.linuxselfhelp.com/gnu/autoconf/html_chapter/autoconf_3.html
http://www.adp-gmbh.ch/misc/tools/configure/configure_in.html
http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html
closed account (S6k9GNh0)
I generally use the following:

Text Editor - vim, scite
Build System - cmake, plain build script
Compiler - gcc, clang
Linker - ld

I'd say the hardest thing about build systems is understand what you can do with them. You can read the documentation and learn how to build your specific project but it'll be a bit later that you learn you can do quite a bit more. Also, understand that build systems tend to be designed for distribution and are often overkill. A plain build script to start off with isn't really a bad thing.

Compilers tend to be straight forward, you feed it input, it gives you output. It's not quite that simple but it's not far from it either.

Also, I'd learn about how linkers resolve symbols and how the dynamic loaders works on all systems.
Last edited on
Topic archived. No new replies allowed.