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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:50:21+00:00 2026-05-30T18:50:21+00:00

I’m using a tool chain where I do not know the names of all

  • 0

I’m using a tool chain where I do not know the names of all of the intermediate files.

E.g. I know that I start out with a foo.s, and go through several steps to get a foo.XXXX.sym and a foo.XXXX.hex, buried way down deep. And then running other tools on foo.XXXX.hex and foo.XXXX.sym, I eventually end up with something like final.results.

But, the trouble is that I don’t know what the XXXX is. It is derived from some other parameters, but may be significantly transformed away from them.

Now, after running the tool/steps that generate foo.XXXX.{sym,hex}, I now typically scan the overall result directory looking for foo.*.{sym,hex}. I.e. I have code that can recognize the intermediate outputs, I just don’t know exactly what the names will be.

I typically use make or scons – actually, I prefer scons, but my team highly prefers make. I’m open to other build tools.

What I want to do is be able to say (1) “make final.results”, or “scons final.results”, (2) and have it scan over the partial tree; (3) figure out that, while it does not know the full path, it definitely knows that it has to run the first step, (4) after that first step, look for and find the foo.XXX.* files; (5) and plug those into the dependency tree.

I.e. I want to finish building the dependency tree after the build has already started.

A friend got frustrated enough with scons’ limitations in this area that he wrote his own build tool. Unfortunately it is proprietary.

I guess that I can create a first build graph, say in make with many .PHONY targets, and then after I get through the first step, generate a new makefile with the new names, and have the first make invoke the newly generated second makefile. Seems clumsy. Is there any more elegant way?

  • 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-30T18:50:22+00:00Added an answer on May 30, 2026 at 6:50 pm

    Make constructs the graph before running any rule, so there won’t be a perfect answer. Here are some reasonably clean solutions.

    1) use PHONY intermediates and wildcards in the commands. (You can’t use Make wildcards because make expands them before running rules.)

    final.results: middle                                                         
        # build $@ using $(shell ls foo.*.sym) and $(shell ls foo.*.hex)
    
    .PHONY: middle
    middle: foo.s
        # build foo.XXXX.sym and foo.XXXX.hex from $<
    

    2) Use recursive Make (which is not as bad as people say, and sometimes very useful.)

    SYM = $(wildcard foo.*.sym)
    HEX = $(wildcard foo.*.hex)
    
    # Note that this is is the one you should "Make".
    # I've put it first so it'll be the default.
    .PHONY: first-step
    first-step: foo.s
        # build foo.XXXX.sym and foo.XXXX.hex from $<
        @$(MAKE) -s final.results                                               
    
    final.results:                                                                
        # build $@ using $(SYM) and $(HEX)
    

    3) Similar to 2, but have a rule for the makefile which will cause Make to run a second time.

    SYM = $(wildcard foo.*.sym)
    HEX = $(wildcard foo.*.hex)
    
    final.results:                                                                
        # build $@ using $(SYM) and $(HEX)
    
    Makefile: foo.s
        # build foo.XXXX.sym and foo.XXXX.hex from $<
        @touch $@
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And

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.