Page 1 of 1

GNU make is broken?

Posted: Tue Jun 09, 2009 9:19 am
by earlz
Ok, I'm trying to make my project so it easily compiles with both BSD and GNU make, so I am going strictly by the POSIX make standard from http://www.opengroup.org/onlinepubs/009 ... /make.html

I have this piece of code that I'm pretty sure follows that standard, and compiles with BSD make, but not GNU make.

Code: Select all

${ASM_OBJS}: ${*:objs/%=src/%}.asm
	${ASM} ${ASMFLAGS} ${*:objs/%=src/%}.asm -o $*.o
in GNU make it will expand, the prerequisite will expand only to '.asm' it will not include the filename as it should with the $* bit.
am I interpreting this wrong or is GNU make really broken?

Re: GNU make is broken?

Posted: Wed Jun 10, 2009 4:39 am
by Solar
I couldn't find any reference to that kind of macro expansion in the GNU make manual, so I'd say GNU make isn't "broken" (because it never claimed to be able to do so) but merely not fully POSIX compliant in this regard. (Quite a few things in the Linux userspace aren't.)

Re: GNU make is broken?

Posted: Wed Jun 10, 2009 1:29 pm
by whowhatwhere
Since lookign into the TENDRA project, I've started looking into using bmake. It's netbsd's make, so it's got to be really portable.

Re: GNU make is broken?

Posted: Wed Jun 10, 2009 5:40 pm
by earlz
are you sure bmake isn't BSD make(as in, the one all the BSD projects use such as OpenBSD, NetBSD, etc etc)