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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:01:46+00:00 2026-06-04T17:01:46+00:00

So, I have the following code: OBJ := $(addprefix ‘obj_’, $(basename $(notdir /build/common.mk))) so

  • 0

So, I have the following code:

OBJ := $(addprefix 'obj_', $(basename $(notdir /build/common.mk)))

so now OBJ1 is “obj_common”

ifeq ($(OBJ),obj_common)
    @echo equal (**don't know how to format indent in this website..assume there is.**)
endif

the ifeq can’t compare $(OBJ) to obj_common, at least it didn’t echo…

(However, if I get rid of addprefix function as follow:)

OBJ := $(basename $(notdir /build/common.mk))

so now OBJ1 is “common”

ifeq ($(OBJ),common)
    @echo equal
endif

this code would echo, which means they can compare and are equal.

I need to reference the variable $(OBJ_common) (I have a big list of this kind of variable, so I can’t manually input the string by hand), but now addprefix function makes this string not a string…
Could anyone please help me resolve the issue? If my question is not clear, please let me know. Thank you very much.

  • 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-04T17:01:51+00:00Added an answer on June 4, 2026 at 5:01 pm

    Well, the mistake is in the following statement:

    OBJ := $(addprefix 'obj_', $(basename $(notdir /build/common.mk)))
    so now OBJ1 is "obj_common"
    

    In fact, OBJ1 becomes 'obj'_common because of quotes that you used in the first argument to addprefix.

    So without the quotes it should work fine:

    OBJ := $(addprefix obj_, $(basename $(notdir /build/common.mk)))
    

    Tip

    Use warning and error functions for debugging your scripts:

    OBJ := ...
    $(warning so now OBJ1 is [$(OBJ1)])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code segment: var run = 0; var obj = {'item1':0,'item2':5,'item3':10};
I have seen it discussed somewhere that the following code results in obj being
I have the following code (I am using the jQquery libary): var obj =
I have the following code: vector<vector<Obj> > vectObjVects(10); vectObjVects[0].reserve(100); During runtime, at the third
I have the following code: function someMethod() { $(obj).click(function {}); } someMethod is called
I have the following code: class IncidentTag: def __init__(self,tag): self.tag = tag def equals(self,obj):
Lets say I have the following code: for (Object obj : Node.getIterable()) { //Do
consider I have the following code in python module a.py : def func(): obj
Say, I have the following Python code if obj is None: identifier = None
I have the following code MyObject * func1() { MyObject * obj = new

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.