On Fri, Oct 07, 2016 at 09:03:40AM -0400, Dario Niedermann wrote:
> >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.
<D and <F are currently not implemented. Probably an oversight as there
are define's for it hanging around in the src and they are mentioned in
the manual. I have half of a diff for this in my tree, although I don't
promise I'll finish it as there is too much on my plate now.
I suggest you use something like this in the meantime:
.SUFFIXES: .c .o
.c.o:
${CC} ${CFLAGS} -o $@ $<
natano
>
> 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:
>
>