Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:08:18+00:00 2026-06-03T13:08:18+00:00

In the manual: The eval function is very special: it allows you to define

  • 0

In the manual:

The eval function is very special: it allows you to define new
makefile constructs that are not constant; which are the result of
evaluating other variables and functions. The argument to the eval
function is expanded, then the results of that expansion are parsed as
makefile syntax.

It’s important to realize that the eval argument is expanded twice;
first by the eval function, then the results of that expansion are
expanded again when they are parsed as makefile syntax. This means you
may need to provide extra levels of escaping for “$” characters when
using eval.

the “expanded twice” confuses me.

for example, i create a makefile :

define func
    tmp = $(OBJPATH)/$(strip $1)
    objs += $$(tmp)
    $$(tmp) : $2
        gcc $$^ -o $$@
endef

all : foo

$(eval $(call func, foo, 1.c))    

how will the eval function be expanded ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:08:20+00:00Added an answer on June 3, 2026 at 1:08 pm

    The easiest way to understand it is to replace the eval with info:

    $(info $(call func, foo, 1.c))
    

    That will display as output the result of the first expansion, so you can see what make will actually be parsing. You didn’t provide the values for the OBJPATH variable, but if it was obj for example then in your case the first expansion (of the call function) results in:

    tmp = obj/foo
    objs += $(tmp)
    $(tmp) : 1.c
        gcc $^ -o $@
    

    Then the make parser will evaluate this, and in the process it will expand it again, so things like $(tmp) are expanded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In manual there is create_function function and you can pass result from that function
http://php.net/manual/en/function.mysql-escape-string.php Why is that?
Since the SOAP manual on php.net is not very noob friendly and I could
MySQL manual is not very detailed about what expressions it supports, so I am
JavaScript has lexical scoping which means that non-local variables accessed from within a function
In manual it said that InnoDB has row-level locking, so why if I select
The manual does not answer this question : it says the name of the
According to php manual nor php://input neither $HTTP_RAW_POST_DATA work with multipart/form-data POST-requests. php://input allows
On the manual page; http://dev.mysql.com/doc/refman/5.0/en/mysql-insert-id.html It is said that Returns the value generated for
Perforce manual says that if you want to automatically expand RCS keywords in file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.