Skip to Main Content
Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)
book

Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)

by Zed A. Shaw
July 2015
Intermediate to advanced content levelIntermediate to advanced
380 pages
10h 15m
English
Addison-Wesley Professional
Content preview from Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)

Exercise 28. Intermediate Makefiles

In the next three exercises you’ll create a skeleton project directory to use in building your C programs later. This skeleton directory will be used for the rest of the book. In this exercise, I’ll cover just the Makefile so you can understand it.

The purpose of this structure is to make it easy to build medium-sized programs without having to resort to configure tools. If done right, you can get very far with just GNU make and some small shell scripts.

The Basic Project Structure

The first thing to do is make a c-skeleton directory, and then put a set of basic files and directories in it that many projects have. Here’s my starter:

Exercise 28 Session

$ mkdir c-skeleton $

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern C for Absolute Beginners: A Friendly Introduction to the C Programming Language

Modern C for Absolute Beginners: A Friendly Introduction to the C Programming Language

Slobodan Dmitrović

Publisher Resources

ISBN: 9780133124385Purchase Link