Makefile

Automatically detect changes in header files in a Makefile

Last updated: 26 Feb 2017 - 21:41

GNU Make is still a brilliant tool for managing embedded software project build systems. The main strength of the system is the way you can define the dependencies of each stage and then let Make figure out what's changed (based on file dates) and build all the bits required. You may be familiar with rules of the form:

file1.o: file1.c
    gcc -c file1.c -o file1.o

Where file1.o is the object file, file1.c is the source file. This declares that if file1.c is changed, file1.o must be re-made.

Section:
Tutorials
Tags:
c,
embedded,
Makefile

Contact

Email: nathan@nathandumont.com

Mastodon: @hairymnstr@mastodon.social