Thread: makefile parameters

  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?
    jv

  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, 09: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, 03:54 PM
  4. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 03:32 PM
  5. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 01:07 PM