GNU make is broken?

Programming, for all ages and all languages.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

GNU make is broken?

Post 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?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: GNU make is broken?

Post 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.)
Every good solution is obvious once you've found it.
whowhatwhere
Member
Member
Posts: 199
Joined: Sat Jun 28, 2008 6:44 pm

Re: GNU make is broken?

Post 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.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: GNU make is broken?

Post 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)
Post Reply