Closed absolutelynothinghere closed 1 month ago
Can you provide an example of what doesn't work? I tried this:
$ cat M32
.POSIX:
.PRAGMA: target_name
.SUFFIXES: .x .z
.x.z:
@echo $< $* $@
@echo $(<D) $(*D) $(@D)
@echo $(<F) $(*F) $(@F)
/tmp/1.z: /tmp/1.x
$ touch /tmp/1.x
$ ./make -f M32
/tmp/1.x /tmp/1 /tmp/1.z
/tmp /tmp /tmp
1.x 1 1.z
$
and it seems to do stuff that looks correct.
Makefile:
COMMAND1 = echo "$(?F)"
COMMAND2 = echo "$(@F)"
COMMAND3 = echo "$(*F)"
COMMAND4 = echo "$(<F)"
build/test.o: src/test.c src/test.h src/foo.c
@$(COMMAND1)
@$(COMMAND2)
@$(COMMAND3)
@$(COMMAND4)
pdpmake output:
test.c test.h foo.c
test.o
gmake output:
test.c test.h foo.c
test.o
test
test.c
This isn't about the F
and D
modifiers. Even with:
COMMAND3 = echo "$*"
COMMAND4 = echo "$<"
your Makefile will output blank lines.
According to POSIX $*
and $<
are only required to work in inference rules, which is why I used them in that context in my example above.
Evidently GNU make allows $*
and $<
in target rules but pdpmake
doesn't. It could, but it would be a non-POSIX extension.
I see, thank you for the explanation.
Having this feature would definitely be nice but it's completely up to you, feel free to close the issue if it's not on the roadmap.
I'll keep this issue open as a reminder.
pdpmake
now supports $<
and $*
in target rules as a non-POSIX extension.
Hello again,
pdpmake currently implements the alternative forms of
$?
which are$(?F)
and$(?D)
, however it does not implement the alternative forms of the internal macros$<
and$*
(maybe$%
too I haven't tested)As per the specification (emphasis mine):
Currently both GNU Make and BSD Make implement this.