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

  • Home
  • SEARCH
  • 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 1046701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:11:16+00:00 2026-05-16T16:11:16+00:00

For those unfamiliar with IDL (interface description language), it abstracts data description for use

  • 0

For those unfamiliar with IDL (interface description language), it abstracts data description for use across platforms (java, c, c++, etc). My project has dependencies Foo.c, Foo.h, FooHelper.c, and FooHelper.h which are generated from Foo.idl. How do I run an arbitrary command when Foo.idl changes, but still include Foo.c, FooHelper.c, in the build process?

My current attempts add a rule to the Makefile.am — the hope is that the rule is copied over to the generated Makefile.

I have tried:

Foo.idl : Foo.idl
 ${the_generate_command}

and then added Foo.idl to my_program_SOURCES but it doesn’t run the_generate_command when building.

I have had success generating from the IDL with

Foo.c Foo.h FooHelper.h FooHelper.c : Foo.idl
 ${the_generate_command}

But it won’t add Foo.c, FooHelper.c to the compile process, so they’re never built, just generated by the_generate_command!

All the code (including the idl) is in $PROJECT_DIR/src.

  • 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-16T16:11:17+00:00Added an answer on May 16, 2026 at 4:11 pm

    rq’s answer is almost correct, but misses a couple of subtleties. Try this:

    bin_PROGRAMS = myprogram
    myprogram_SOURCES = Foo.c Foo.h FooHelper.h FooHelper.c $(OTHER_SOURCES)
    BUILT_SOURCES = Foo.c Foo.h FooHelper.h FooHelper.c
    EXTRA_DIST = Foo.idl
    MAINTAINERCLEANFILES = Foo.c Foo.h FooHelper.h FooHelper.c
    
    Foo.c: Foo.idl
        $(THE_GENERATE_COMMAND)
    
    Foo.h FooHelper.h FooHelper.c: Foo.c
        @if test -f $@; then \
            touch $@; \
        else \
    ## Recover from the removal of $@
            rm -rf $<; \
            $(MAKE) $(AM_MAKEFLAGS) $<; \
        fi
    

    The additional rules to “generate” Foo.h, FooHelper.h and FooHelper.c from Foo.c ensure that parallel builds won’t try and run $(THE_GENERATE_COMMAND) twice. It is an idiom detailed in the Automake manual which will work for parallel builds. There is still a little fragility here: if the user removes (say) FooHelper.h and FooHelper.c and starts a parallel make, it may run the $(MAKE) $(AM_MAKEFLAGS) $< recovery part of the rule multiple times in parallel. As the manual says, this race can only going to happen if the user manually mutilates the build tree, and even then it’s nothing a make clean; make cannot fix.

    The BUILT_SOURCES line ensures that Foo.c, Foo.h, FooHelper.h and FooHelper.c are built before trying to build myprogram (see this section of the Automake manual to see why just adding them to myprog_SOURCES is insufficient). The EXTRA_DIST variable ensures that the .idl file will be captured by make dist (reference).

    MAINTAINERCLEANFILES specifies additional files to delete when running make maintainer-clean; this is to comply with the GNU Makefile Standards. See also the variable’s description in the Automake manual.

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

Sidebar

Related Questions

Those icons you can find in the sdk/platforms/data/res/drawable-hdpi... such as ic_delete. How would you
To those unfamiliar, javabat is a website that hosts dozens of small java coding
I have a massive, unfamiliar Java codebase that I need to use in one
Those who invented Android and Java didn't invented for themselves. Since I started developing
(For those who haven't heard of it, Pivotal Tracker is a simple, story-based project
For those people that use NHibernate and similar stuff, why do you use it?
I'm currently specing out a project that stored threaded comment trees. For those of
For those unfamiliar with the classic magic square algorithm: A magic square is a
I would like to use redis to query data from commandline, scripts, web and
For those unfamiliar with CVS, cvs -nq update shows something like this. $ cvs

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.