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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:47:04+00:00 2026-06-08T05:47:04+00:00

I want to write a rule that looks something like this: foo.out: (out of

  • 0

I want to write a rule that looks something like this:

foo.out: (out of date if foo.in is newer than foo.out.stamp)
    # update foo.out if and only if the new foo.out has different contents
    # than the old foo.out (a change to foo.in may or may not change foo.out)
    && touch foo.out.stamp

I can’t do this:

foo.out.stamp: foo.in
    # update foo.out if and only if the new foo.out has different contents
    # than the old foo.out (a change to foo.in may or may not change foo.out)
    && touch foo.out.stamp

foo.out: foo.out.stamp

Because if foo.in changes, but the recipe for foo.out.stamp does not change foo.out, make will always view foo.out as out of date.

Is there any way to write this kind of rule?

Edit: Explanation of why I don’t unconditionally touch foo.out:

I am working with Vala. The Vala compilation process looks something like this:

  1. For each .vala file, generate a .vapi file (similar to a header file).
  2. For each .vala file, generate a .c file (this requires the individual .vala file and every .vapi file to be given to the compiler)
  3. Continue the typical .c -> .o -> executable/library process.

For steps #1 and #2, the Vala compiler only updates the .vapi/.c file if its contents have been changed. This is to prevent needless .c -> .o recompilation.

In makefile terms:

  • A .vapi file is out of date if the .vala file has changed since the last time the Vala compiler regenerated the .vapi file (not the last time that the .vapi file was modified).
  • A .c file is out of date if the .vala or any .vapi file has changed since the last time the Vala compiler regenerated the .c file (not the last time that the .c file was modified).
  • 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-08T05:47:07+00:00Added an answer on June 8, 2026 at 5:47 am

    I ended up solving this by adding a top-level rule that ensures the stamps are always up to do, and empty rules for the real output files:

    all: %.out.stamp
    
    %.out: ;
    

    Technically that isn’t exactly what I did, because I am not writing the Makefiles by hand (I am working with cmake). In CMake terms, I added a custom target that depends on all the .vapi.stamp and .dep (similar to a .c.stamp) files. The CMake target that builds the executable/library from the .c files depends on this target.

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

Sidebar

Related Questions

I want to write a rule that redirects all URLs of a certain pattern
I've got a rule to match a string that looks like so: STRING :
I want to rewrite requests like: mydomain.com/this/is/a/test to: mydomain.com/url.php?i=this,is,a,test How can I write a
How do I write a mod_rewrite rule that is the opposite of this: RewriteRule
I am trying to figure out how to rewrite URLs from something like this:
I want to write a rule in prolog, which basically says If a user
I want to write an JUnit @Rule (version 4.10) to setup some objects (an
I have a string: Range(T4).Value = Rule 13s voilation I want to write 13s
I want to write a program in Prolog that confirms if a b-tree of
I want to write a (gmake) makefile for a compiler that - unlike gcc

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.