Trepan-Debuggers / Trepan-Debuggers/remake
Debugger: Errors at searching path for included makefiles
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 850
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
I have a directory [aaa] with Makefile & sub-directory as illustrated.

(The directory was compressed and please download from aaa.tar.gz )
At the beginnig, invoke remake in folder [aaa].
In folder [aaa], Makefile[1] would be read , and invoke remake in foler [bbb] with searching path added (-I'absolute_path'/aaa).
In folder [bbb], Makefile[2] would be read, include another.mk in folder [aaa] with searching path, and invoke remake in folder [ccc].
In folder [ccc], Makefile[2] would be re-read again, and include anotther.mk in folder [aaa] with searching path.
Without debugger, all is fine; however, with debugger step by step executed, the the path of included another.mk in Makefile[2] is wrong at first (but still includable) in folder [bbb]. Finally, in folder [ccc], the another.mk in Makefile[2] is not includable and debugger catch an error.
The following is the message given by remake. I also print the variable [.INCLUDE_DIRS] in every recipe in Makefile[1] & [2] to inspect the searching path of included files. It seems that the searching path was not correctly added to sub-folders.
remake -X
Reading makefiles...
Updating makefiles...
-> (/home/kwlee/aaa/another.mk:1)
Makefile:
remake<0> s
Updating goal targets...
-> (/home/kwlee/aaa/Makefile:1)
all:
remake<1> s
File 'all' does not exist.
Must remake target 'all'.
/usr/local/include /usr/local/include /usr/include
Makefile:2: target 'all' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
remake -I/home/kwlee/aaa -C bbb
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
++ (/home/kwlee/aaa/Makefile:1)
all
remake<2> s
Reading makefiles...
remake[1]: Entering directory '/home/kwlee/aaa/bbb'
Updating makefiles...
-> (/home/kwlee/aaa/bbb/another.mk:1)
Makefile:
remake<<0>> s
Updating goal targets...
-> (/home/kwlee/aaa/bbb/Makefile:8)
all:
remake<<1>> s
File 'all' does not exist.
Must remake target 'all'.
/home/kwlee/aaa /usr/local/include /usr/local/include /usr/include
Makefile:9: target 'all' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
remake -C ccc -f ../Makefile
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
++ (/home/kwlee/aaa/bbb/Makefile:8)
all
remake<<2>> s
Reading makefiles...
remake[2]: Entering directory '/home/kwlee/aaa/bbb/ccc'
Updating makefiles...
File 'another.mk' does not exist.
Must remake target 'another.mk'.
../Makefile:14: another.mk: No such file or directory
remake[2]: *** No rule to make target 'another.mk'. Stop.
remake[2]: Leaving directory '/home/kwlee/aaa/bbb/ccc'
Makefile:9: *** [all] error 2
#0 all at /home/kwlee/aaa/bbb/Makefile:8
***Entering debugger because we encountered a fatal error.
** Exiting the debugger will exit make with exit code 2.
!! (/home/kwlee/aaa/bbb/Makefile:8)
all
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Download the aaa.tar.gz reproduction and run remake -X from aaa, following the nested -I and -C invocations into bbb and ccc. Compare .INCLUDE_DIRS and the resolution of another.mk with and without debugger stepping. Done means nested execution keeps the intended include path so another.mk remains includable in ccc.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100