[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make -t fails to touch directories
From: |
Quinn Grier |
Subject: |
make -t fails to touch directories |
Date: |
Fri, 8 Mar 2024 16:23:36 -0800 |
User-agent: |
Mozilla Thunderbird |
Here's an example:
$ ls
Makefile
$ cat Makefile
# Constructs a directory foo that contains a file bar.
foo: bar
rm -f -r foo
mkdir foo
cp bar foo
$ touch bar
$ make foo
rm -f -r foo
mkdir foo
cp bar foo
$ touch bar
$ make -t foo
touch foo
make: touch: open: foo: Is a directory
$ make --version | head -n 1
GNU Make 4.4.1
I tracked this down in the source code with "git grep 'touch: open'" and
found that touch is implemented in src/remake.c by reading one byte from
the target and writing it back, which fails if the target already exists
as a directory.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- make -t fails to touch directories,
Quinn Grier <=