Summary: make fails to recognize dependency and substitute
Submitted by: None
Submitted on: Thu 20 Feb 2020 09:00:41 AM UTC
Severity: 3 - Normal
Item Group: Bug
Assigned to: None
Discussion Lock: Any
Component Version: 4.3
Operating System: POSIX-Based
Fixed Release: None
Triage Status: None
I have a typical C++ project with inc, src and test directories.
In test, I have 3 tests: utils.cpp exception.cpp object.cpp and the Makefile
at the bottom (also attached).
I have encountered two problems:
- If I put definition of BR and src variables above the rule they are used,
they are not properly substituted and Makefile does not work at all. I thought
make variables are recursive and this should not make a difference.
- The below Makefile works as expected, but for example when I change
utils.cpp, make does not recognize the change and does not rebuild utils