makefile recursion all subsystems always up to date
I'm trying to create a recursive makefile but the make just reports all my subsystems are up to date when there are no object files, executables or even makefiles in the subdirectories.
coco:
if [ ! -f ./CoCo/makefile ]; then cp ./CoCo/Makefiles/Linux/makefile ./CoCo ;fi
$(MAKE) -C CoCo
becker:
if [ ! -f ./becker/makefile ]; then cp ./becker/Makefiles/Linux/makefile ./becker ;fi
$(MAKE) -C becker
...
The first thing I would like to do in each subsystem is ensure the makefile exists and if it doesn't then copy it from the appropriate location.
Next I would like it to change to the subdirectory and perform the make.
Lastly how would I make all subsystems with one command like (make all)?
recursion makefile
add a comment |
I'm trying to create a recursive makefile but the make just reports all my subsystems are up to date when there are no object files, executables or even makefiles in the subdirectories.
coco:
if [ ! -f ./CoCo/makefile ]; then cp ./CoCo/Makefiles/Linux/makefile ./CoCo ;fi
$(MAKE) -C CoCo
becker:
if [ ! -f ./becker/makefile ]; then cp ./becker/Makefiles/Linux/makefile ./becker ;fi
$(MAKE) -C becker
...
The first thing I would like to do in each subsystem is ensure the makefile exists and if it doesn't then copy it from the appropriate location.
Next I would like it to change to the subdirectory and perform the make.
Lastly how would I make all subsystems with one command like (make all)?
recursion makefile
1
In case you triedmake beckerit probably reports "all up to date" because there is a directory with namebeckerand it exists and has no dependencies, so nothing to rebuild. As formake cocoI don't know since the dir is apparentlyCoCoand case matters in linux... Does it work same formake coco?
– igagis
Jan 20 at 13:42
What is "the appropriate location"?
– Beta
Jan 20 at 18:00
The appropriate location is the source of the cp command.
– Walter ZAMBOTTI
Jan 21 at 13:28
@igagis Yes it does the same for CoCo. I get the impression I need to explicitly perform the if with a shell!
– Walter ZAMBOTTI
Jan 21 at 13:30
@igagis You were correct. Mingw on Windows is not case sensitive.
– Walter ZAMBOTTI
Jan 21 at 15:26
add a comment |
I'm trying to create a recursive makefile but the make just reports all my subsystems are up to date when there are no object files, executables or even makefiles in the subdirectories.
coco:
if [ ! -f ./CoCo/makefile ]; then cp ./CoCo/Makefiles/Linux/makefile ./CoCo ;fi
$(MAKE) -C CoCo
becker:
if [ ! -f ./becker/makefile ]; then cp ./becker/Makefiles/Linux/makefile ./becker ;fi
$(MAKE) -C becker
...
The first thing I would like to do in each subsystem is ensure the makefile exists and if it doesn't then copy it from the appropriate location.
Next I would like it to change to the subdirectory and perform the make.
Lastly how would I make all subsystems with one command like (make all)?
recursion makefile
I'm trying to create a recursive makefile but the make just reports all my subsystems are up to date when there are no object files, executables or even makefiles in the subdirectories.
coco:
if [ ! -f ./CoCo/makefile ]; then cp ./CoCo/Makefiles/Linux/makefile ./CoCo ;fi
$(MAKE) -C CoCo
becker:
if [ ! -f ./becker/makefile ]; then cp ./becker/Makefiles/Linux/makefile ./becker ;fi
$(MAKE) -C becker
...
The first thing I would like to do in each subsystem is ensure the makefile exists and if it doesn't then copy it from the appropriate location.
Next I would like it to change to the subdirectory and perform the make.
Lastly how would I make all subsystems with one command like (make all)?
recursion makefile
recursion makefile
asked Jan 20 at 6:33
Walter ZAMBOTTIWalter ZAMBOTTI
406
406
1
In case you triedmake beckerit probably reports "all up to date" because there is a directory with namebeckerand it exists and has no dependencies, so nothing to rebuild. As formake cocoI don't know since the dir is apparentlyCoCoand case matters in linux... Does it work same formake coco?
– igagis
Jan 20 at 13:42
What is "the appropriate location"?
– Beta
Jan 20 at 18:00
The appropriate location is the source of the cp command.
– Walter ZAMBOTTI
Jan 21 at 13:28
@igagis Yes it does the same for CoCo. I get the impression I need to explicitly perform the if with a shell!
– Walter ZAMBOTTI
Jan 21 at 13:30
@igagis You were correct. Mingw on Windows is not case sensitive.
– Walter ZAMBOTTI
Jan 21 at 15:26
add a comment |
1
In case you triedmake beckerit probably reports "all up to date" because there is a directory with namebeckerand it exists and has no dependencies, so nothing to rebuild. As formake cocoI don't know since the dir is apparentlyCoCoand case matters in linux... Does it work same formake coco?
– igagis
Jan 20 at 13:42
What is "the appropriate location"?
– Beta
Jan 20 at 18:00
The appropriate location is the source of the cp command.
– Walter ZAMBOTTI
Jan 21 at 13:28
@igagis Yes it does the same for CoCo. I get the impression I need to explicitly perform the if with a shell!
– Walter ZAMBOTTI
Jan 21 at 13:30
@igagis You were correct. Mingw on Windows is not case sensitive.
– Walter ZAMBOTTI
Jan 21 at 15:26
1
1
In case you tried
make becker it probably reports "all up to date" because there is a directory with name becker and it exists and has no dependencies, so nothing to rebuild. As for make coco I don't know since the dir is apparently CoCo and case matters in linux... Does it work same for make coco?– igagis
Jan 20 at 13:42
In case you tried
make becker it probably reports "all up to date" because there is a directory with name becker and it exists and has no dependencies, so nothing to rebuild. As for make coco I don't know since the dir is apparently CoCo and case matters in linux... Does it work same for make coco?– igagis
Jan 20 at 13:42
What is "the appropriate location"?
– Beta
Jan 20 at 18:00
What is "the appropriate location"?
– Beta
Jan 20 at 18:00
The appropriate location is the source of the cp command.
– Walter ZAMBOTTI
Jan 21 at 13:28
The appropriate location is the source of the cp command.
– Walter ZAMBOTTI
Jan 21 at 13:28
@igagis Yes it does the same for CoCo. I get the impression I need to explicitly perform the if with a shell!
– Walter ZAMBOTTI
Jan 21 at 13:30
@igagis Yes it does the same for CoCo. I get the impression I need to explicitly perform the if with a shell!
– Walter ZAMBOTTI
Jan 21 at 13:30
@igagis You were correct. Mingw on Windows is not case sensitive.
– Walter ZAMBOTTI
Jan 21 at 15:26
@igagis You were correct. Mingw on Windows is not case sensitive.
– Walter ZAMBOTTI
Jan 21 at 15:26
add a comment |
1 Answer
1
active
oldest
votes
try adding .PHONY: coco becker to the beginning of your makefile, then it should run those targets even tough directories with same names exist
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fstackoverflow.com%2fquestions%2f54274163%2fmakefile-recursion-all-subsystems-always-up-to-date%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
try adding .PHONY: coco becker to the beginning of your makefile, then it should run those targets even tough directories with same names exist
add a comment |
try adding .PHONY: coco becker to the beginning of your makefile, then it should run those targets even tough directories with same names exist
add a comment |
try adding .PHONY: coco becker to the beginning of your makefile, then it should run those targets even tough directories with same names exist
try adding .PHONY: coco becker to the beginning of your makefile, then it should run those targets even tough directories with same names exist
answered Jan 21 at 16:13
igagisigagis
779517
779517
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f54274163%2fmakefile-recursion-all-subsystems-always-up-to-date%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
1
In case you tried
make beckerit probably reports "all up to date" because there is a directory with namebeckerand it exists and has no dependencies, so nothing to rebuild. As formake cocoI don't know since the dir is apparentlyCoCoand case matters in linux... Does it work same formake coco?– igagis
Jan 20 at 13:42
What is "the appropriate location"?
– Beta
Jan 20 at 18:00
The appropriate location is the source of the cp command.
– Walter ZAMBOTTI
Jan 21 at 13:28
@igagis Yes it does the same for CoCo. I get the impression I need to explicitly perform the if with a shell!
– Walter ZAMBOTTI
Jan 21 at 13:30
@igagis You were correct. Mingw on Windows is not case sensitive.
– Walter ZAMBOTTI
Jan 21 at 15:26