BSD make and GNU make problem

This is a discussion on BSD make and GNU make problem within the Linux Programming forums, part of the Platform Specific Boards category; Hi I'm working on a FreeBSD platform, but I'd like to use GNU make. I know that CFLAGS works on ...

  1. #1
    Skarr
    Guest

    BSD make and GNU make problem

    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

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    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

  3. #3
    Skarr
    Guest
    Hmm, doesn't work for me.

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    Could you post a simple Makefile where it works with gmake?
    I like traffic lights. I like traffic lights. I like traffic lights, but only when they're green.

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    This from page 101 of the manual:

    Code:
    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:

    Code:
    CFLAGS = $(include_dirs) -0
    include_dirs = -Ifoo -Ibar
    Hope this helps you somewhat. Goodluck.

    starX
    www.axisoftime.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help me understand GNU Make please
    By yougene in forum C Programming
    Replies: 6
    Last Post: 06-14-2009, 07:36 PM
  2. Establishing 'make clean' with GNU make
    By Jesdisciple in forum C Programming
    Replies: 9
    Last Post: 04-11-2009, 09:10 AM
  3. GNU make - generating dynamic dependencies
    By OriginalCopy in forum Linux Programming
    Replies: 0
    Last Post: 05-15-2008, 10:41 AM
  4. how gnu make tells if file's been changed?
    By thinhare in forum C Programming
    Replies: 2
    Last Post: 03-19-2008, 03:10 AM
  5. How to make console Mode apps like 'GNU less'?
    By gibsosmat in forum C Programming
    Replies: 4
    Last Post: 10-31-2007, 07:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21