URL: <https://savannah.gnu.org/bugs/?61171>
Summary: Unexpected warning "Circular test.mm <- test.mm.o dependency dropped." Project: make Submitted by: None Submitted on: Thu 16 Sep 2021 04:45:12 PM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 3.81 Operating System: POSIX-Based Fixed Release: None Triage Status: None _______________________________________________________ Details: Running `make` version 3.81 i386-apple-darwin11.3.0 on the `Makefile`: ``` test: test.mm.o c++ -framework Foundation -o $@ $^ test.mm.o: test.mm c++ -ObjC++ -c -o $@ $< ``` and having in place the following ObjectiveC++ source file `test.mm`: ``` #include <iostream> #include "Foundation/Foundation.h" int main() { NSLog(@"test"); std::cout << "test\n"; } ``` results in the warning: ``` make: Circular test.mm <- test.mm.o dependency dropped. c++ -ObjC++ -c -o test.mm.o test.mm c++ -framework Foundation -o test test.mm.o ``` Invoking `make -p` reveals that there seems to be a build-in implicit rule for `pattern stem: `test.mm'` which could be the root cause. The same behavior can be reproduced with an even simpler `Makefile`: ``` test.mm.o: test.mm touch $@ ``` Note that, e.g., the following `Makefile` executes without the warning: ``` test.mm.o: test.c touch $@ ``` provide any file named `test.c` is in place. Also the same `Makefile` with `test.c` replaced by `test.cc`, `test.cpp`, or `test.m` does not show a warning. I do not know if the build-in implicit rule for `%.mm` mentioned above is intended like so. But even in case it is, it seems inconsistent with the ones for `%.c`, `%.cc`, `%.cpp`, `%.m`, which do not cause a circular dependency. An obvious workaround is adding another target: ``` test.mm: @echo "workaround" ``` or similar. Thanks for looking into this if you find the time! And big thanks to all for your awesome work! _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?61171> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/