What does it mean to “touch” a target in make?

For example, from the mingw32-make.exe --help option:

-t, --touch Touch targets instead of remaking them. 
+6
makefile
source share
3 answers

It simply means updating the file modification time, so the next time it will not consider these files as old.

+6
source share

Touching a file means writing to it without recording any actual data.

If the file does not exist, it will be created as an empty file, otherwise its modification time will simply be updated to date.

+3
source share

Touching a file means creating it if it does not exist yet and updates the date it was modified, so using -t will probably make make assume that everything has been compiled, but not everything has been compiled.

0
source share

All Articles