>Synopsis: make: empty expansion of $(<D) and $(<F)
>Category: user
>Environment:
System : OpenBSD 5.8
Details : OpenBSD 5.8 (GENERIC.MP) #1: Wed Oct 14 19:40:42 CEST 2015
[email protected]:/binpatchng/work-binpatch58-i386/src/sys/arch/i386/compile/GENERIC.MP
Architecture: OpenBSD.i386
Machine : i386
>Description:
I'm having a problem with OpenBSD's make, where the local
variables $(<D) and $(<F) expand to empty. This is the rule that's
misbehaving:
.c.o:
cd $(<D) && $(CC) $(cflags) -c $(<F)
Nothing in make's man page leads me to think an empty expansion would be
expected. The same rule works on GNU and NetBSD makes.
Now, this was observed on OpenBSD 5.8, but a search for the changes and
fixes between that version and 6.0 doesn't show any changes for make.
>How-To-Repeat:
=== TEST MAKEFILE ===
a.o: # just touch 'a.c' before running this makefile
.c.o:
cd $(<D) && $(CC) $(cflags) -c $(<F)
=== END TEST MAKEFILE ===
=== OPENBSD MAKE REPLY ===
cd && cc -c
cc: no input files
*** Error 1 in /home/ndr (makefile:4 'a.o')
=== END OPENBSD MAKE REPLY ===
=== GNU MAKE REPLY ===
cd . && cc -c a.c
=== END GNU MAKE REPLY ===
=== NETBSD MAKE REPLY ===
cd . && cc -c a.c
=== END NETBSD MAKE REPLY ===
>Fix: