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 8026585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:32:28+00:00 2026-06-04T23:32:28+00:00

As the title, in makefile GNU, what is the diff between obj_$(variable) and $(addprefix

  • 0

As the title, in makefile GNU, what is the diff between obj_$(variable) and $(addprefix “obj_”, $(variable)). I am sure there is the difference, because the first one can be compared to a string, and the latter one cannot be recognized as a string. Please let me know if I am wrong. I want to make the second one work as a string, so I can use $($(addprefix “obj_”, $(variable))) as a variable (now it doesn’t work).

Thank you guys.

  • 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-04T23:32:29+00:00Added an answer on June 4, 2026 at 11:32 pm

    Test it by yourself:

    print_values = \
        $(warning Let the value of '$$(variable)' to be [$(variable)]) \
        $(warning then the value of obj_$$(variable) is [obj_$(variable)]) \
        $(warning $$(addprefix  "obj_", $$(variable)) is [$(addprefix "obj_", $(variable))]) \
        $(warning )
    
    variable := foo
    $(print_values)
    
    variable := foo bar baz
    $(print_values)
    
    variable :=
    variable += foo
    $(print_values)
    

    You will get the following output:

    makefile:10: Let the value of '$(variable)' to be [foo]
    makefile:10: then the value of obj_$(variable) is [obj_foo]
    makefile:10: $(addprefix  "obj_", $(variable)) is ["obj_"foo]
    makefile:10: 
    makefile:13: Let the value of '$(variable)' to be [foo bar]
    makefile:13: then the value of obj_$(variable) is [obj_foo bar]
    makefile:13: $(addprefix  "obj_", $(variable)) is ["obj_"foo "obj_"bar]
    makefile:13: 
    makefile:17: Let the value of '$(variable)' to be [ foo]
    makefile:17: then the value of obj_$(variable) is [obj_ foo]
    makefile:17: $(addprefix  "obj_", $(variable)) is ["obj_"foo]
    makefile:17: 
    

    P.S. As I told you in the answer to another your question, quotes are definitely not what you want.

    Use plain obj_:

    $(addprefix obj_,$(variable))
    

    Instead of:

    $(addprefix "obj_",$(variable))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Title says it all: What is the difference between a UserTransaction and an EntityTransaction
Title said it all. im just wandering if there something i can use in
Title pretty much sums it up. Is there a technical name given to a
Title says it pretty much all : is there a way to get the
I'm not sure if the title explain the real problem. I have a shell
Title is basic enough, why can't I: Dictionary<string, string> dic = new Dictionary<string, string>();
Title. It's only allowed to save to a certain directory, but is there a
Title sums it up. URL isn't an EKEvent property but figured maybe there's some
As title, how can I change default view without placing home.ctp in apps/views/pages/ folder?
The title should say it all, then I can solidify 2 more ticks on

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.