help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to debug shell cmds?


From: Jens Schweikhardt
Subject: Re: How to debug shell cmds?
Date: Wed, 29 Jan 2003 09:09:13 +0100
User-agent: Mutt/1.4i

On Wed, Jan 29, 2003 at 08:31:01AM +0100, Dusan Juhas wrote:
# Hello,
# I'd like to force make utility to stop everytime
# a shell command with a certain pattern is invoked
# (for debug purpose).
# Is it possible to do so without changing Makefile?
# 
# Eg: pattern is mkdir
# Makefile:
# ...
# $(PLATFORM)_obj/%.o:  %.c
#         @echo "... $<"
#         @mkdir $(PLATFORM)_obj > /dev/null 2>&1 || true
# ...
# 
# I'd like to stop on line @mkdir... to see what happend
# and then restart 'make' exactly on this line.

Untested, and it does involve Makefile changes, but as we say in Germany,
you can't ask for "Wash my fur but don't get me wet" :-)

- Change all occurences of mkdir to $(MKDIR), which is good Makefile
  engineering anyway. Then on the commandline:
- If debugging: make MKDIR='echo mkdir breakpoint reached; read dummy; mkdir'
  else          make MKDIR=mkdir
- Hit Enter at each breakpoint to continue.

If you must insist on not frobbing the Makefile, you can overload the
mkdir program with a shell script that does just the same as above and
then making sure it's first in the shell's PATH. I trust you know how to
do this.

Regards,

        Jens
-- 
Jens Schweikhardt  http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)







reply via email to

[Prev in Thread] Current Thread [Next in Thread]