Add additional processing in an automake build for one object

Clash Royale CLAN TAG#URR8PPP
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
add a comment |
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
add a comment |
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
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
automake
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
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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