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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:09:35+00:00 2026-06-06T01:09:35+00:00

(this is similar to GNU make: Execute target but take dependency from file but

  • 0

(this is similar to GNU make: Execute target but take dependency from file but slightly different).

When I try to force to build a target, make automatically thinks that this target is out of date and forces a run of all targets which depend on it.

In my case, the target is a recursive make call which does a lot of work and might just return with "nothing to be done":

 .PHONY: intermediate.dat
 intermediate.dat:
      $(MAKE) expensive_chain_which_finally_creates_intermediate.dat

 step1.dat: intermediate.dat
      sleep 10
 
 step2.dat: step1.dat
      sleep 15
 
 step3.dat: step2.dat
      sleep 10

 all: step3.dat
      sleep 5

In this case, "make all" runs for 40 seconds although intermediate.dat might not have changed (recursive make returned "nothing to be done"). However, if the recursive make updated intermediate.dat, the target shall be out of date.

Is there really no way to do this?

  • 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-06T01:09:38+00:00Added an answer on June 6, 2026 at 1:09 am

    Make intermediate.dat depend on a phony target instead of being phony itself.

     .PHONY : always-remake
    
     intermediate.dat : always-remake
    

    IIRC, the last time I solved the problem, the .PHONY didn’t work as intended and I used:

     always-remake :
         @true
    

    instead. However, I can’t recall why, so try the .PHONY first.

    The problem with making intermediate.dat itself phony is that make never checks the existence/date of a phony file, which is behaviour that you want. You only need to trigger the rebuild rule, which is done by a prerequisite that is out of date; a phony prerequisite is always out of date, so it does the job.

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

Sidebar

Related Questions

This is similar to (but different from) this question . Here is some simple
I have checked this similar question, but the suggestions did not solve my problem:
I found this similar question here , but this is really old. Was it
This is similar to: How to open a file using JavaScript? Goal: to retrieve/open
This is similar to this question, which is about a bash file . We've
This seems similar to a number of other questions posted, but is actually a
My question is a little bit similar to this but it is about TCL
I've scowered this site trying to find a similar issue, but so far no
Note: This similar SO question talks about how to build the same class, but
I have already looked at this similar question but i am still wondering if

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.