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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:59:35+00:00 2026-05-23T01:59:35+00:00

With Make, I do something like generated.c: input.txt generator ./generator input.txt > generated.c How

  • 0

With Make, I do something like

generated.c: input.txt generator
    ./generator input.txt > generated.c

How would I get equivalent functionality out of autotools? (removing generated.c on cleaning would also be a bonus).

  • 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-23T01:59:36+00:00Added an answer on May 23, 2026 at 1:59 am

    I’m assuming that input.txt is a source file that is distributed, that you do not want to distribute generated.c (i.e., it must be built by each user), and that generator is a program built by your package too.

    EXTRA_DIST = input.txt
    bin_PROGRAMS = prog
    noinst_PROGRAMS = generator
    
    # Source files for the generator
    generator_SOURCES = generator.c ...
    
    # Source files for prog
    prog_SOURCES = prog.c ...
    nodist_prog_SOURCES = generated.c 
    
    # generated.c is a built source that must be cleaned
    CLEANFILES = generated.c
    
    # Build rule for generated.c
    generated.c: $(srcdir)/input.txt generator$(EXEEXT)
            ./generator$(EXEEXT) $(srcdir)/input.txt
    

    In some situations, like when generating header files, it is important to generate the file before the rest of the sources are compiled, so it can be included. In that case you should also list the generated file in the variable BUILT_SOURCES (The Automake manual has many example in its Built sources section. In the above case it is not necessary.

    EDIT: I have fixed the above Makefile.am example to declare generator as a non-installed program.

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

Sidebar

Related Questions

I make a distributed embedded application that will make use of several micro-controllers. The
I have a snippet to create a 'Like' button for our news site: <iframe
I am playing with TFS 2010, and am trying to setup a build process
I am trying to load a html page through UIWebview.I need to disable all
I want to use a temp directory that will be unique to this build.
I'm doing some changes on my routes, and suddenly the following is appearing in
I am writing a query to fetch results for all the values in a
After having read Ian Boyd 's constructor series questions ( 1 , 2 ,

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.