BSD make and GNU make problem [Archive] - C Board

PDA

View Full Version : BSD make and GNU make problem


Skarr
09-01-2002, 06:27 AM
Hi

I'm working on a FreeBSD platform, but I'd like to use GNU make.
I know that CFLAGS works on BSD make, but how do I specify gcc flags in GNU make?

Thanks

/Skarr

starX
09-01-2002, 08:33 AM
I've got the GNU make manual in front of me, and it lists CFLAGS as one of the variables used in built in rules. Not that I've personally used this feature, but you might be able to use it the same way as your BSD version.

starX
www.axisoftime.com

Skarr
09-01-2002, 09:24 AM
Hmm, doesn't work for me.

Skarr
09-09-2002, 11:21 AM
Could you post a simple Makefile where it works with gmake?

starX
09-10-2002, 12:31 PM
This from page 101 of the manual:


foo : foo.o bar.o
cc -o foo foo.o bar.o $(CFLAGS) $(LDFLAGS)


An example on setting the CFLAGS variable specifically is on page 36:


CFLAGS = $(include_dirs) -0
include_dirs = -Ifoo -Ibar


Hope this helps you somewhat. Goodluck.

starX
www.axisoftime.com