Add additional processing in an automake build for one object

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












3















I'm trying to make a small change to an automake build.



The system to modify uses configure.ac and Makefile.am inputs.
For a single object file within one subdirectory I have to invoke
a script before compiling, to patch config info into the build.



I don't see the right location to allow such pre-processing
ahead of compiling this specific C file. What I've tried is
to insert an additional target into



all: all-am


But this seems not to be the way to go and in addition I wasn't able
to figure how to overload this generated line.










share|improve this question




























    3















    I'm trying to make a small change to an automake build.



    The system to modify uses configure.ac and Makefile.am inputs.
    For a single object file within one subdirectory I have to invoke
    a script before compiling, to patch config info into the build.



    I don't see the right location to allow such pre-processing
    ahead of compiling this specific C file. What I've tried is
    to insert an additional target into



    all: all-am


    But this seems not to be the way to go and in addition I wasn't able
    to figure how to overload this generated line.










    share|improve this question


























      3












      3








      3








      I'm trying to make a small change to an automake build.



      The system to modify uses configure.ac and Makefile.am inputs.
      For a single object file within one subdirectory I have to invoke
      a script before compiling, to patch config info into the build.



      I don't see the right location to allow such pre-processing
      ahead of compiling this specific C file. What I've tried is
      to insert an additional target into



      all: all-am


      But this seems not to be the way to go and in addition I wasn't able
      to figure how to overload this generated line.










      share|improve this question
















      I'm trying to make a small change to an automake build.



      The system to modify uses configure.ac and Makefile.am inputs.
      For a single object file within one subdirectory I have to invoke
      a script before compiling, to patch config info into the build.



      I don't see the right location to allow such pre-processing
      ahead of compiling this specific C file. What I've tried is
      to insert an additional target into



      all: all-am


      But this seems not to be the way to go and in addition I wasn't able
      to figure how to overload this generated line.







      automake






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 13 '12 at 8:23









      N.N.

      1,3721118




      1,3721118










      asked Nov 29 '11 at 12:45









      Wolfgang RostekWolfgang Rostek

      162




      162




















          1 Answer
          1






          active

          oldest

          votes


















          0














          You should be able to add in a special target for the object file in question in your Makefile.am. Something like:



          file.o: file.c
          $(CC) $(CFLAGS) -c file.c
          modification.sh file.o


          This should cause modification.sh to be run on the object file whenever it gets built.






          share|improve this answer























          • Thanks I will try that. What I found in between were the automake targets BUILD_SOURCES all-local This way I can inject similar things.

            – Wolfgang Rostek
            Nov 29 '11 at 16:36







          • 1





            This is probably the right way, but not that if your modification script fails, it will leave an unpatched but seemingly up to date file.o lying around. It might be better to chain the commands like file.c -> file.o.tmp -> file.o.

            – Peter Eisentraut
            Dec 2 '11 at 13:51











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f25640%2fadd-additional-processing-in-an-automake-build-for-one-object%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You should be able to add in a special target for the object file in question in your Makefile.am. Something like:



          file.o: file.c
          $(CC) $(CFLAGS) -c file.c
          modification.sh file.o


          This should cause modification.sh to be run on the object file whenever it gets built.






          share|improve this answer























          • Thanks I will try that. What I found in between were the automake targets BUILD_SOURCES all-local This way I can inject similar things.

            – Wolfgang Rostek
            Nov 29 '11 at 16:36







          • 1





            This is probably the right way, but not that if your modification script fails, it will leave an unpatched but seemingly up to date file.o lying around. It might be better to chain the commands like file.c -> file.o.tmp -> file.o.

            – Peter Eisentraut
            Dec 2 '11 at 13:51
















          0














          You should be able to add in a special target for the object file in question in your Makefile.am. Something like:



          file.o: file.c
          $(CC) $(CFLAGS) -c file.c
          modification.sh file.o


          This should cause modification.sh to be run on the object file whenever it gets built.






          share|improve this answer























          • Thanks I will try that. What I found in between were the automake targets BUILD_SOURCES all-local This way I can inject similar things.

            – Wolfgang Rostek
            Nov 29 '11 at 16:36







          • 1





            This is probably the right way, but not that if your modification script fails, it will leave an unpatched but seemingly up to date file.o lying around. It might be better to chain the commands like file.c -> file.o.tmp -> file.o.

            – Peter Eisentraut
            Dec 2 '11 at 13:51














          0












          0








          0







          You should be able to add in a special target for the object file in question in your Makefile.am. Something like:



          file.o: file.c
          $(CC) $(CFLAGS) -c file.c
          modification.sh file.o


          This should cause modification.sh to be run on the object file whenever it gets built.






          share|improve this answer













          You should be able to add in a special target for the object file in question in your Makefile.am. Something like:



          file.o: file.c
          $(CC) $(CFLAGS) -c file.c
          modification.sh file.o


          This should cause modification.sh to be run on the object file whenever it gets built.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 29 '11 at 16:02









          KeithBKeithB

          2,6291412




          2,6291412












          • Thanks I will try that. What I found in between were the automake targets BUILD_SOURCES all-local This way I can inject similar things.

            – Wolfgang Rostek
            Nov 29 '11 at 16:36







          • 1





            This is probably the right way, but not that if your modification script fails, it will leave an unpatched but seemingly up to date file.o lying around. It might be better to chain the commands like file.c -> file.o.tmp -> file.o.

            – Peter Eisentraut
            Dec 2 '11 at 13:51


















          • Thanks I will try that. What I found in between were the automake targets BUILD_SOURCES all-local This way I can inject similar things.

            – Wolfgang Rostek
            Nov 29 '11 at 16:36







          • 1





            This is probably the right way, but not that if your modification script fails, it will leave an unpatched but seemingly up to date file.o lying around. It might be better to chain the commands like file.c -> file.o.tmp -> file.o.

            – Peter Eisentraut
            Dec 2 '11 at 13:51

















          Thanks I will try that. What I found in between were the automake targets BUILD_SOURCES all-local This way I can inject similar things.

          – Wolfgang Rostek
          Nov 29 '11 at 16:36






          Thanks I will try that. What I found in between were the automake targets BUILD_SOURCES all-local This way I can inject similar things.

          – Wolfgang Rostek
          Nov 29 '11 at 16:36





          1




          1





          This is probably the right way, but not that if your modification script fails, it will leave an unpatched but seemingly up to date file.o lying around. It might be better to chain the commands like file.c -> file.o.tmp -> file.o.

          – Peter Eisentraut
          Dec 2 '11 at 13:51






          This is probably the right way, but not that if your modification script fails, it will leave an unpatched but seemingly up to date file.o lying around. It might be better to chain the commands like file.c -> file.o.tmp -> file.o.

          – Peter Eisentraut
          Dec 2 '11 at 13:51


















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f25640%2fadd-additional-processing-in-an-automake-build-for-one-object%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)