makefile parameters

This is a discussion on makefile parameters within the Linux Programming forums, part of the Platform Specific Boards category; Hi is there a way to retrieve several parameters passed to the make command from within a makefile I tried ...

  1. #1
    Registered User ivandn's Avatar
    Join Date
    Oct 2001
    Posts
    49

    makefile parameters

    Hi is there a way to retrieve several parameters passed to the make command from within a makefile

    I tried using @0 @1 @2 but this didn't seem to work.

    Thanks
    Ivan

  2. #2
    Registered User jasrajva's Avatar
    Join Date
    Oct 2001
    Posts
    99
    dont know the nswer to that one
    but i am just curious

    why do you need multiple params?

  3. #3
    Unregistered
    Guest
    Makefiles can take named parameters on the command line.



    Makefile:
    -------------------------------------------------
    Code:
    all:
            echo $(PARAMETER1)
            echo $(NAMED_PARAMETER)
            echo $(NAME)


    From the shell:

    [jabba@/users/dp/bryanc]
    $ make NAME=bryan NAMED_PARAMETER=whatever PARAMETER=foo
    echo

    echo whatever
    whatever
    echo bryan
    bryan

  4. #4
    Registered User ivandn's Avatar
    Join Date
    Oct 2001
    Posts
    49
    Very Cool!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile Problem: None rule to make target
    By chris24300 in forum Linux Programming
    Replies: 25
    Last Post: 06-17-2009, 10:45 AM
  2. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 11:50 PM
  3. unix makefile won't work but works in Dev C++
    By jk1998 in forum C++ Programming
    Replies: 1
    Last Post: 06-09-2007, 04:54 PM
  4. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 04:32 PM
  5. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 02:07 PM

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