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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:04:38+00:00 2026-05-23T03:04:38+00:00

This is an offshoot to my other question . Is there something special I

  • 0

This is an offshoot to my other question.

Is there something special I have to do in order to make this work with export variables?

So I’m running this off of a Makefile that includes a master Makefile in another location. In this local Makefile, I have:

include /path/to/master/Makefile/
export TOOL = A

Now in my Master Makefile I have:

ifeq ( $(TOOL), A )
    echo "Tool A will be run..."
    [syntax for toolA]
else
    echo "Tool B will be run..."
    [syntax for toolB]
endif

But when I run gmake, toolB is always run! I checked the variable $(TOOL) and it shows A. What am I doing wrong?

Thanks!!

EDIT: Adding Makefile example.

For my problem, moving the include to after the export fixed my problem. But this is an existing Makefile, and having the include at the very top has always worked!

The include statement is up top in the local, and all the exports at the bottom. Only my new export line fails. Does anyone know why?

Local Makefile

export TOOL A
include /path/to/master/Makefile
export VERSION IMP-IR5

Master Makefile

export VERSION IAP-100

ci:
ifeq ( $(TOOL), A )
    echo "Tool A will be run..."
    [syntax for toolA]
    echo $(VERSION)
else
    echo "Tool B will be run..."
    [syntax for toolB]
    echo $(VERSION)
endif

Output

echo "Tool A will be run..."
Tool A will be run...
echo IMP-IR5
IMP-IR5

But if I switch the top to lines in the local Makefile (like it was originally):

include /path/to/master/Makefile
export TOOL A
export VERSION IMP-IR5

I get:

echo "Tool B will be run..."
Tool B will be run...
echo IMP-IR5
IMP-IR5

Why does IMP-IR5 go through but not tool A? So confused…

  • 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-05-23T03:04:38+00:00Added an answer on May 23, 2026 at 3:04 am

    Try moving your export TOOL = A line above the include statement in your local Makefile. Also change ifeq ( $(TOOL), A ) to ifeq ($(TOOL),A).

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

Sidebar

Related Questions

This may be an unusual question, but are there any resources people have come
This is an offshoot of this question: Chrome counts characters wrong in textarea with
This is a complex question, because there are a lot of moving parts. My
This is an offshoot of this question . How do I use a Login
This is an offshoot of a previous question which started to snowball. If I
This is an offshoot question that's related to another I asked here . I'm
This is an offshoot from a previous question, is this bad practice (using the
This post is an offshoot of my previous post . However I have not
This has been a rather problematic issue on numerous occasions. We have alot of
This is probably a stupid question, but how much of a security risk is

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.