Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean to 'touch' a target in make?

Tags:

makefile

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

-t, --touch                 Touch targets instead of remaking them.
like image 696
Jake Petroules Avatar asked Aug 10 '10 01:08

Jake Petroules


2 Answers

It just means to update the file modification time, so that next time, it won't consider those files old.

like image 179
Mike Caron Avatar answered Nov 18 '22 03:11

Mike Caron


Touching a file means to effectively make a write to the file, but without changing any file data.

If the file doesn't exist, it'll be created as an empty file, otherwise its modification time will just be updated to the present time.

like image 4
thomasrutter Avatar answered Nov 18 '22 04:11

thomasrutter