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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:05:10+00:00 2026-05-24T22:05:10+00:00

I have a somewhat complicated Makefile which runs perl scripts and other tools and

  • 0

I have a somewhat complicated Makefile which runs perl scripts and other tools and generates some 1000 files. I would like to edit/modify some of those generated files after all files are generated. So I thought I can simply add a new rule to do so like this:

(phony new rule): $LIST_OF_FILES_TO_EDIT
    file_modifier ...

however, the point here is some of those generated files which I’d like to edit ($LIST_OF_FILES_TO_EDIT) are used in the same make process to generate a long list of files. So I have to wait to make sure those files are no longer needed in the make process before I can go ahead and edit them. But I don’t know how to do that. Not to mention that it is really hard to find out what files are generated by the help of $LIST_OF_FILES_TO_EDIT.

If it was possible to mention in the Makefile that this rule should be only run as the last rule, then my problem would be solved. but as far as I know this is not possible. So anyone has an idea?

Some points:

  • List of files to edit ($LIST_OF_FILES_TO_EDIT) is determined dynamically (not known before make process)

  • I am not sure I have picked a good title for this question. 🙂

  • 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-24T22:05:11+00:00Added an answer on May 24, 2026 at 10:05 pm

    1) If you’re going to modify the files like that, it might behoove you to give the targets different names, like foo_unmodified and foo_modified, so that the Make’s dependency handling will take care of this.

    2) If your phony new rule is the one you invoke on the command line (“make phonyNewRule”), then Make will build whatever else it’s going to build before executing the file_modifier command. If you want to build targets not on that list, you could do it this way:

    (phony new rule): $(LIST_OF_FILES_TO_EDIT) $(OTHER_TARGETS)
        file_modifier ...
    

    3) If your dependencies are set up correctly, you can find out which targets depend on $(LIST_OF_FILES_TO_EDIT), but it’s not very tidy. You could just touch one of the files, run make, see which targets it built, repeat for all files. You could save a little time by using Make arguments: “make -n -W foo1 -W foo2 -W foo3 … -W foo99 all”. This will print the commands Make would run– I don’t know of any way to get it to tell you which targets it would rebuild.

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

Sidebar

Related Questions

I have a somewhat complicated assortment of tables for which I need to do
I have a somewhat complicated branching structure at work (at least for me). It
OK, I have a somewhat complicated system in C++. In a nutshell, I need
I'm creating a System-Tray only application. It's somewhat complicated to have the icon without
Ok SQL and Oracle gurus I have a somewhat complicated query that I'm trying
I have somewhat interesting development situation. The client and deployment server are inside a
Does VS2008 have somewhat C++0x standard support? DUPLICATE Visual Studio support for new C
I have a somewhat messily-formatted Objective-C code base. Is there a way to have
I have several somewhat separate programs, that conceptually can fit into a single project.
I am learning about SOAP implementation and have become somewhat confused regarding the appropriate

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.