Skip to content

A demonstration of a Makefile system for C/C++ projects which recompile source files when relevant headers are updated

Notifications You must be signed in to change notification settings

C0Florent/smart_makefile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Makefile

A "smart" build system for C/C++ built using GNU make, which rebuilds sources if headers they depend on are updated.

This was presented along with this slideshow (which is in French) on the 29th of May, 2024.


This repository contains several examples of Makefiles, all in seperate directories.

example1

This contains a basic example where a "simple" Makefile doesn't update properly the object files when headers are changed.

example1_auto

This is a slightly improved version of the example1 where header dependencies are manually described. This sure rebuilds when needed, but is not scalable for growing projects

rules

A simple demonstration of how Makefile rules can call each other and how they decide if their target is up to date or not

live_demo

The simplest version of a scalable Makefile which tracks dependencies and updates object files when needed. It was built live during a presentation, and actually only consists in the "simple" Makefile of example1 with 4 actual code lines added


Resources

This build system is inspired by this article written by Paul D. Smith. You can check out his website at https://mad-scientist.net/

If you have any question on how this works or how to make improvements for your own usage, make sure to check out the GNU make documentation, which is very structured and accessible in many different formats.

About

A demonstration of a Makefile system for C/C++ projects which recompile source files when relevant headers are updated

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published