Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Depend on the make file itself

In the event that a Makefile itself is changed, a safe bet would be to consider all targets out of date.

Is there a clever way to add this dependency? Are there any alternatives?

like image 838
Matt Joiner Avatar asked Nov 11 '10 02:11

Matt Joiner


People also ask

What is a Makefile depend?

A Makefile rule that typically scans all C/C++ source files in a directory, and generates rules that indicate that an object file depends on certain header files, and must be recompiled if they are recompiled.

What is the use of make file?

Makefile sets a set of rules to determine which parts of a program need to be recompile, and issues command to recompile them. Makefile is a way of automating software building procedure and other complex tasks with dependencies. Makefile contains: dependency rules, macros and suffix(or implicit) rules.

What is a make file target?

A simple makefile consists of “rules” with the following shape: target … : prerequisites … recipe … … A target is usually the name of a file that is generated by a program; examples of targets are executable or object files. A target can also be the name of an action to carry out, such as ' clean ' (see Phony Targets).

What is all in make file?

The name of all is not fixed. It's just a conventional name; all target denotes that if you invoke it, make will build all what's needed to make a complete build. This is usually a dummy target, which doesn't create any files, but merely depends on the other files.


1 Answers

Make sure the object files depend on the makefile:

$(OBJFILES) : Makefile 

Where Makefile is the name of the make file.

like image 192
Per Knytt Avatar answered Sep 23 '22 07:09

Per Knytt