Circular file dependency dropped weirdness












0















I'm running a little utility from a make file (using GNU Make 3.81). The utility converts one type of file to another. For example the file 'thefile.x' gets converted to 'thefile.x.y'.



The target and make rule is:



%.x.y: %.x
convertfile $< $@

all: file1.x.y file2.x.y


This actually works (the .x.y file is produced but I always get the message:



make: Circular thefile.x <- thefile.x.y dependency dropped.



This is just a minor issue as we don't want to see messages when everything is actually working.



Have looked at other 'circular dependency' Q&As and none of them seem to be the same problem I'm having. For other technical reasons I can't change the file naming conventions for this project.



After comment below I want to clarify what I'm doing and so reproduce the complete make file I'm using:



%.js.c: %.js
js2c $< $@

all: test1.js.c test2.js.c


Here is output when I run it and it has stuff to do:



C:worktimtest>make
make: Circular test1.js <- test1.js.c dependency dropped.
js2c test1.js test1.js.c
[RomFs] test1.js => test1.js.c
make: Circular test2.js <- test2.js.c dependency dropped.
js2c test2.js test2.js.c
[RomFs] test2.js => test2.js.c


Here is output when nothing to do:



make: Circular test1.js <- test1.js.c dependency dropped.
make: Circular test2.js <- test2.js.c dependency dropped.
make: Nothing to be done for `all'.









share|improve this question




















  • 1





    That is not a fully-formed makefile that shows the problem you're having. When I use this makefile and run touch file1.x, I don't see that warning.

    – MadScientist
    Nov 17 '18 at 5:35











  • See additional stuff in main question...

    – Tim Ring
    Nov 19 '18 at 10:23











  • Thanks. Now that your example uses the actual suffixes, the problem is clear.

    – MadScientist
    Nov 19 '18 at 13:19


















0















I'm running a little utility from a make file (using GNU Make 3.81). The utility converts one type of file to another. For example the file 'thefile.x' gets converted to 'thefile.x.y'.



The target and make rule is:



%.x.y: %.x
convertfile $< $@

all: file1.x.y file2.x.y


This actually works (the .x.y file is produced but I always get the message:



make: Circular thefile.x <- thefile.x.y dependency dropped.



This is just a minor issue as we don't want to see messages when everything is actually working.



Have looked at other 'circular dependency' Q&As and none of them seem to be the same problem I'm having. For other technical reasons I can't change the file naming conventions for this project.



After comment below I want to clarify what I'm doing and so reproduce the complete make file I'm using:



%.js.c: %.js
js2c $< $@

all: test1.js.c test2.js.c


Here is output when I run it and it has stuff to do:



C:worktimtest>make
make: Circular test1.js <- test1.js.c dependency dropped.
js2c test1.js test1.js.c
[RomFs] test1.js => test1.js.c
make: Circular test2.js <- test2.js.c dependency dropped.
js2c test2.js test2.js.c
[RomFs] test2.js => test2.js.c


Here is output when nothing to do:



make: Circular test1.js <- test1.js.c dependency dropped.
make: Circular test2.js <- test2.js.c dependency dropped.
make: Nothing to be done for `all'.









share|improve this question




















  • 1





    That is not a fully-formed makefile that shows the problem you're having. When I use this makefile and run touch file1.x, I don't see that warning.

    – MadScientist
    Nov 17 '18 at 5:35











  • See additional stuff in main question...

    – Tim Ring
    Nov 19 '18 at 10:23











  • Thanks. Now that your example uses the actual suffixes, the problem is clear.

    – MadScientist
    Nov 19 '18 at 13:19
















0












0








0








I'm running a little utility from a make file (using GNU Make 3.81). The utility converts one type of file to another. For example the file 'thefile.x' gets converted to 'thefile.x.y'.



The target and make rule is:



%.x.y: %.x
convertfile $< $@

all: file1.x.y file2.x.y


This actually works (the .x.y file is produced but I always get the message:



make: Circular thefile.x <- thefile.x.y dependency dropped.



This is just a minor issue as we don't want to see messages when everything is actually working.



Have looked at other 'circular dependency' Q&As and none of them seem to be the same problem I'm having. For other technical reasons I can't change the file naming conventions for this project.



After comment below I want to clarify what I'm doing and so reproduce the complete make file I'm using:



%.js.c: %.js
js2c $< $@

all: test1.js.c test2.js.c


Here is output when I run it and it has stuff to do:



C:worktimtest>make
make: Circular test1.js <- test1.js.c dependency dropped.
js2c test1.js test1.js.c
[RomFs] test1.js => test1.js.c
make: Circular test2.js <- test2.js.c dependency dropped.
js2c test2.js test2.js.c
[RomFs] test2.js => test2.js.c


Here is output when nothing to do:



make: Circular test1.js <- test1.js.c dependency dropped.
make: Circular test2.js <- test2.js.c dependency dropped.
make: Nothing to be done for `all'.









share|improve this question
















I'm running a little utility from a make file (using GNU Make 3.81). The utility converts one type of file to another. For example the file 'thefile.x' gets converted to 'thefile.x.y'.



The target and make rule is:



%.x.y: %.x
convertfile $< $@

all: file1.x.y file2.x.y


This actually works (the .x.y file is produced but I always get the message:



make: Circular thefile.x <- thefile.x.y dependency dropped.



This is just a minor issue as we don't want to see messages when everything is actually working.



Have looked at other 'circular dependency' Q&As and none of them seem to be the same problem I'm having. For other technical reasons I can't change the file naming conventions for this project.



After comment below I want to clarify what I'm doing and so reproduce the complete make file I'm using:



%.js.c: %.js
js2c $< $@

all: test1.js.c test2.js.c


Here is output when I run it and it has stuff to do:



C:worktimtest>make
make: Circular test1.js <- test1.js.c dependency dropped.
js2c test1.js test1.js.c
[RomFs] test1.js => test1.js.c
make: Circular test2.js <- test2.js.c dependency dropped.
js2c test2.js test2.js.c
[RomFs] test2.js => test2.js.c


Here is output when nothing to do:



make: Circular test1.js <- test1.js.c dependency dropped.
make: Circular test2.js <- test2.js.c dependency dropped.
make: Nothing to be done for `all'.






gnu-make






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 10:21







Tim Ring

















asked Nov 16 '18 at 17:11









Tim RingTim Ring

1,3561525




1,3561525








  • 1





    That is not a fully-formed makefile that shows the problem you're having. When I use this makefile and run touch file1.x, I don't see that warning.

    – MadScientist
    Nov 17 '18 at 5:35











  • See additional stuff in main question...

    – Tim Ring
    Nov 19 '18 at 10:23











  • Thanks. Now that your example uses the actual suffixes, the problem is clear.

    – MadScientist
    Nov 19 '18 at 13:19
















  • 1





    That is not a fully-formed makefile that shows the problem you're having. When I use this makefile and run touch file1.x, I don't see that warning.

    – MadScientist
    Nov 17 '18 at 5:35











  • See additional stuff in main question...

    – Tim Ring
    Nov 19 '18 at 10:23











  • Thanks. Now that your example uses the actual suffixes, the problem is clear.

    – MadScientist
    Nov 19 '18 at 13:19










1




1





That is not a fully-formed makefile that shows the problem you're having. When I use this makefile and run touch file1.x, I don't see that warning.

– MadScientist
Nov 17 '18 at 5:35





That is not a fully-formed makefile that shows the problem you're having. When I use this makefile and run touch file1.x, I don't see that warning.

– MadScientist
Nov 17 '18 at 5:35













See additional stuff in main question...

– Tim Ring
Nov 19 '18 at 10:23





See additional stuff in main question...

– Tim Ring
Nov 19 '18 at 10:23













Thanks. Now that your example uses the actual suffixes, the problem is clear.

– MadScientist
Nov 19 '18 at 13:19







Thanks. Now that your example uses the actual suffixes, the problem is clear.

– MadScientist
Nov 19 '18 at 13:19














1 Answer
1






active

oldest

votes


















1














You are seeing this because GNU make has a number of built-in rules. You can see a partial listing of them in the GNU make manual, or run make -p -f/dev/null to see a complete list.



One of these built-in rules tells make how to compile a program from a .c file. On POSIX systems programs don't have special suffixes, so this built-in rule says, basically:



%: %.c ; $(LINK.c) ...


So this rule tells make how to build any file foo from a file foo.c... this also means make can infer how to build a file foo.js from a file foo.js.c. Since you've also defined a rule for how to build foo.js.c from foo.js, that's a circular dependency and make evicts one of the rules (the built-in rule).



You need to prevent your .js files from being matched via match-anything patterns like the one above. There are two ways to do this as described in the manual. The one with the least side-effects is to add an empty pattern rule mentioning your new suffix, like this:



%.js:


That's it. Full details are available in the manual.






share|improve this answer
























  • Fantastic, I never thought of the inbuilt rules! Thanks

    – Tim Ring
    Nov 19 '18 at 14:18











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53342484%2fcircular-file-dependency-dropped-weirdness%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









1














You are seeing this because GNU make has a number of built-in rules. You can see a partial listing of them in the GNU make manual, or run make -p -f/dev/null to see a complete list.



One of these built-in rules tells make how to compile a program from a .c file. On POSIX systems programs don't have special suffixes, so this built-in rule says, basically:



%: %.c ; $(LINK.c) ...


So this rule tells make how to build any file foo from a file foo.c... this also means make can infer how to build a file foo.js from a file foo.js.c. Since you've also defined a rule for how to build foo.js.c from foo.js, that's a circular dependency and make evicts one of the rules (the built-in rule).



You need to prevent your .js files from being matched via match-anything patterns like the one above. There are two ways to do this as described in the manual. The one with the least side-effects is to add an empty pattern rule mentioning your new suffix, like this:



%.js:


That's it. Full details are available in the manual.






share|improve this answer
























  • Fantastic, I never thought of the inbuilt rules! Thanks

    – Tim Ring
    Nov 19 '18 at 14:18
















1














You are seeing this because GNU make has a number of built-in rules. You can see a partial listing of them in the GNU make manual, or run make -p -f/dev/null to see a complete list.



One of these built-in rules tells make how to compile a program from a .c file. On POSIX systems programs don't have special suffixes, so this built-in rule says, basically:



%: %.c ; $(LINK.c) ...


So this rule tells make how to build any file foo from a file foo.c... this also means make can infer how to build a file foo.js from a file foo.js.c. Since you've also defined a rule for how to build foo.js.c from foo.js, that's a circular dependency and make evicts one of the rules (the built-in rule).



You need to prevent your .js files from being matched via match-anything patterns like the one above. There are two ways to do this as described in the manual. The one with the least side-effects is to add an empty pattern rule mentioning your new suffix, like this:



%.js:


That's it. Full details are available in the manual.






share|improve this answer
























  • Fantastic, I never thought of the inbuilt rules! Thanks

    – Tim Ring
    Nov 19 '18 at 14:18














1












1








1







You are seeing this because GNU make has a number of built-in rules. You can see a partial listing of them in the GNU make manual, or run make -p -f/dev/null to see a complete list.



One of these built-in rules tells make how to compile a program from a .c file. On POSIX systems programs don't have special suffixes, so this built-in rule says, basically:



%: %.c ; $(LINK.c) ...


So this rule tells make how to build any file foo from a file foo.c... this also means make can infer how to build a file foo.js from a file foo.js.c. Since you've also defined a rule for how to build foo.js.c from foo.js, that's a circular dependency and make evicts one of the rules (the built-in rule).



You need to prevent your .js files from being matched via match-anything patterns like the one above. There are two ways to do this as described in the manual. The one with the least side-effects is to add an empty pattern rule mentioning your new suffix, like this:



%.js:


That's it. Full details are available in the manual.






share|improve this answer













You are seeing this because GNU make has a number of built-in rules. You can see a partial listing of them in the GNU make manual, or run make -p -f/dev/null to see a complete list.



One of these built-in rules tells make how to compile a program from a .c file. On POSIX systems programs don't have special suffixes, so this built-in rule says, basically:



%: %.c ; $(LINK.c) ...


So this rule tells make how to build any file foo from a file foo.c... this also means make can infer how to build a file foo.js from a file foo.js.c. Since you've also defined a rule for how to build foo.js.c from foo.js, that's a circular dependency and make evicts one of the rules (the built-in rule).



You need to prevent your .js files from being matched via match-anything patterns like the one above. There are two ways to do this as described in the manual. The one with the least side-effects is to add an empty pattern rule mentioning your new suffix, like this:



%.js:


That's it. Full details are available in the manual.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 19 '18 at 13:32









MadScientistMadScientist

46.5k55267




46.5k55267













  • Fantastic, I never thought of the inbuilt rules! Thanks

    – Tim Ring
    Nov 19 '18 at 14:18



















  • Fantastic, I never thought of the inbuilt rules! Thanks

    – Tim Ring
    Nov 19 '18 at 14:18

















Fantastic, I never thought of the inbuilt rules! Thanks

– Tim Ring
Nov 19 '18 at 14:18





Fantastic, I never thought of the inbuilt rules! Thanks

– Tim Ring
Nov 19 '18 at 14:18


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53342484%2fcircular-file-dependency-dropped-weirdness%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

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)