views:

210

answers:

7

I know a little bit of C from high school and uni (mostly forgotten). I would like to learn C for Unix developemnt. I have a book of Dietel but there is not any information on how to use make, configure, Makefile and Posix API.

I would like to have some resources, books, web sites, PDF, anything, to get started. I want to use gnu tools. Even C project, clear to read to learn by coding instead by reading only.

Thank you.

+1  A: 

There's an old book you might look into:

Programming With Gnu Tools

Andy White
+2  A: 

Some online manuals that you might find helpful:

GNU Make Manual

Documentation for binutils

codaddict
+1  A: 

Kernighan & Pike's book The Unix Programming Environment. It's a little dated, but still has useful parts.

GreenMatt
It seems very very old
rtacconi
The book uses pre-ANSI C: probably not the best place to learn about programming in C on Unix. It's still a very good book, of course.
Alok
Thanks to note that uses pre-ANSI C
rtacconi
I bought that book although I discovered that there is a version online and the book's web site has the code updated to ANSI C.
rtacconi
+2  A: 

I found Understanding UNIX/LINUX Programming: A Guide to Theory and Practice by Bruce Molay to be an excellent introduction to Unix system programming.

The book is easy to read and goes to the right depth for providing basic understanding of the UNIX operating system and how to to program for it.

The ideas and principles are introduced in the context of a practical problem and then solved by the development of complete programs (written in C). Illustrations are used effectively to re-enforce understanding.

jschmier
Do you think that 'Advanced Programming in the UNIX Environment' is more difficult than the one you suggested?
rtacconi
I can't say that I've ever read 'Advanced Programming in the UNIX Environment' as thoroughly as the book I linked above, but if my memory serves me correctly, it is a bit more advanced than the one I suggested. 'Understanding UNIX/LINUX Programming' provides a great introduction and can serve as a basic reference later. I picked up my copy again this afternoon for a quick refresh on a topic. If you have a chance, browse through each of them at a local book store and see which one suits you better.
jschmier
+1  A: 

Aside from reading the official documentation for make/gcc/etc, I learned most of my development tools by using them. I would recommend installing a Linux distribution, installing the development tools, and then attempting to build several open-source projects. You can browse around on sourceforge.net, for instance, and find an active project that runs on Linux and is written in the language(s) you are interested in. Each project will come with instructions on how to build it. After you are able to successfully build several projects (even from step-by-step instructions), you should start to get a decent grasp of the basic build tools. Once you feel comfortable with building from instructions, try reading through a project's makefiles (easiest to start with a smaller project), using the official make documentation when you need help (codaddict provided links in his post).

The ultimate test of your knowledge would be to take an existing C project that you have and writing a makefile from scratch (or adapting a makefile from another project) that will build it successfully. Start simple, perhaps a single C file. Slowly enlarge your project to several source files, then add a sub-folder containing source files, then try linking to an external library, etc etc. Start simple and work your way up, using makefiles from existing projects as guidelines.

I'm a "learn by doing" kind of person, so this method worked for me. YMMV.

bta
Thanks, you have described an interesting path.
rtacconi
+2  A: 

I would suggest skipping the build tools for now and get a good IDE. This will allow you to focus on the real issue -- programming.

Netbeans is reasonable and works on every platform -- and it uses make as a back-end, so you can examine the scripts if you feel like it.

Hassan Syed
I installed Netbeans and I like it! Nice answer.
rtacconi
+1  A: 

I was in a similar boat as you; I inherited some old code written in 'C' for a Linux system and although I had some cursory experience in 'C', I really did not have any practical experience. Doing some searching on Amazon led me to Beginning Linux Programming and its contents were worth its weight in gold for me, and hopefully for you. The book is on its 4th revision so its quite up to date and it covers all the necessary topics that other dated books of its type go over; I found the chapter on Processes & Signals well written and quite enlightening.

Beginning Linux Programming

SiegeX
It seems a very interesting book.
rtacconi