Enhanced GNU Make - tracing, error reporting, debugging, profiling and more
C Groff Perl Makefile Batchfile M4 Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config Setup for unittests and add our first (lame) test. Jun 5, 2015
debugger Save and show breakoint mask Oct 7, 2015
doc More aggressive doc elimination Jun 14, 2015
glob Files from GNU Make 4.1 release. Dec 29, 2014
htdocs Give process id in output line when jobs != 1. Sep 23, 2011
packaging Give process id in output line when jobs != 1. Sep 23, 2011
po Update POTFILES.in for new sources. Travis 3rd try Dec 29, 2014
profile Wrong URL for location of callgrind format Jun 5, 2015
tests Disable archive tests for now Aug 5, 2016
unittest Add install from source instructions and... Jul 18, 2016
w32 Files from GNU Make 4.1 release. Dec 29, 2014
.cvsignore Changes from Ralf Wildenhues. Aug 1, 2009
.gitignore Setup for unittests and add our first (lame) test. Jun 5, 2015
.purify * Fix memory leaks, fd leaks, and some long-standing bugs recognizing… Jul 20, 1999
.travis.yml
AUTHORS Files from GNU Make 4.1 release. Dec 29, 2014
COPYING * Update to GPLv3 Jul 4, 2007
ChangeLog.1 Update copyright years. Oct 25, 2009
ChangeLog.2 * Update to GPLv3 Jul 4, 2007
INSTALL Files from GNU Make 4.1 release. Dec 29, 2014
INSTALL-from-source.md Add install from source instructions and... Jul 18, 2016
Makefile.am
Makefile.ami Files from GNU Make 4.1 release. Dec 29, 2014
NEWS Get ready for release remake-4.1+dbg-1.1 Jun 23, 2015
NEWS.remake
NMakefile.template - Many fixup patches from Savannah. Jul 19, 2010
README.Amiga
README.VMS Files from GNU Make 4.1 release. Dec 29, 2014
README.customs Files from GNU Make 4.1 release. Dec 29, 2014
README.md Remove gitter link. Jun 6, 2015
README.remake Update misc docs. Mar 26, 2011
README.template Remove OS-specific build files that we don't support. Mar 14, 2012
REMAKE.todo Add debugger code and get it to compile. It has not been hook into Mar 21, 2011
Rakefile Get ready for release. Jun 9, 2011
SCOPTIONS Initial repository Oct 21, 2008
SMakefile.template Update copyrights for 2010. Jul 13, 2010
TODO.private Update copyrights for 2010. Jul 13, 2010
acinclude.m4 Files from GNU Make 4.1 release. Dec 29, 2014
alloc.c Break up files so we can compose and test pieces of it. May 28, 2015
alloca.c
amiga.c Files from GNU Make 4.1 release. Dec 29, 2014
amiga.h Files from GNU Make 4.1 release. Dec 29, 2014
ar.c Issue warning detecting a "deterministic" archive Aug 5, 2016
arscan.c Files from GNU Make 4.1 release. Dec 29, 2014
build.template Update copyrights for 2010. Jul 13, 2010
build_w32.bat Files from GNU Make 4.1 release. Dec 29, 2014
buildargv.c Debugger files now compile with warnings, but without error. And we s… Mar 21, 2011
buildargv.h Debugger files now compile with warnings, but without error. And we s… Mar 21, 2011
commands.c Issue warning detecting a "deterministic" archive Aug 5, 2016
commands.h Closer to having --tasks --targets and tracing working. (Not there ye… Dec 29, 2014
configure.ac Patch to fix large command line Aug 5, 2016
configure.bat Files from GNU Make 4.1 release. Dec 29, 2014
debug.c More global variable separation for modularity May 28, 2015
debug.h
debugger.h More global variable separation for modularity May 28, 2015
default.c Files from GNU Make 4.1 release. Dec 29, 2014
dep.h remake --tasks and remake --targets now works, modulo possible bugs. Dec 29, 2014
dir.c Issue warning detecting a "deterministic" archive Aug 5, 2016
dosbuild.bat Files from GNU Make 4.1 release. Dec 29, 2014
expand.c Start adding target stack parameter so we can track it. We stubbed en… Dec 29, 2014
expand.h Start parsing remake trace/debugger options Mar 21, 2011
file.c GNU Make bug in enumeration values? Jul 16, 2015
file.h Closer to having --tasks --targets and tracing working. (Not there ye… Dec 29, 2014
file_basic.c Small changes/clean-ups May 30, 2015
file_basic.h Small changes/clean-ups May 30, 2015
filedef.h Bang on profiling more. May 30, 2015
function.c Get ready for the first 4.1 release. Dec 31, 2014
function.h
getloadavg.c Files from GNU Make 4.1 release. Dec 29, 2014
getopt.c Squelch some FreeBSD clang warnings Jan 1, 2015
getopt.h Files from GNU Make 4.1 release. Dec 29, 2014
getopt1.c Files from GNU Make 4.1 release. Dec 29, 2014
gettext.h
globals.c Add --profile option to produce callgrind-style data. May 29, 2015
globals.h Add --profile option to produce callgrind-style data. May 29, 2015
gmk-default.h
gmk-default.scm Files from GNU Make 4.1 release. Dec 29, 2014
gnumake.h trace.c now compiles and is added to final result. Add some (most?) o… Dec 29, 2014
guile.c Files from GNU Make 4.1 release. Dec 29, 2014
hash.c Files from GNU Make 4.1 release. Dec 29, 2014
hash.h
implicit.c Files from GNU Make 4.1 release. Dec 29, 2014
implicit.h Header for implicit C file Apr 18, 2011
job.c Patch to fix large command line Aug 5, 2016
job.h Start adding target stack parameter so we can track it. We stubbed en… Dec 29, 2014
load.c Files from GNU Make 4.1 release. Dec 29, 2014
loadapi.c Files from GNU Make 4.1 release. Dec 29, 2014
main.c Regularize help text Aug 12, 2016
main.h More global variable separation for modularity May 28, 2015
maintMakefile Track that changes in GNU without which "make update" would fail. Jan 14, 2012
make.1 Reinstate manpage. Document --target option Jul 21, 2016
make.h Issue warning detecting a "deterministic" archive Aug 5, 2016
make.lnk Files from GNU Make 4.1 release. Dec 29, 2014
make_msvc_net2003.sln Initial repository Oct 21, 2008
make_msvc_net2003.vcproj Files from GNU Make 4.1 release. Dec 29, 2014
makefile.com
makefile.vms
makeint.h
misc.c More global variable separation for modularity May 28, 2015
mock.c More global variable separation for modularity May 28, 2015
mock.h Break up files so we can compose and test pieces of it. May 28, 2015
output.c More global variable separation for modularity May 28, 2015
output.h trace.c now compiles and is added to final result. Add some (most?) o… Dec 29, 2014
prepare_w32.bat - Fixed a bug reported by Michael Matz regarding handling of parallel Aug 8, 2005
print.c Finish adding call stack pops. Bump version. Start using fatal_err() … Dec 31, 2014
print.h
profile.c Small typos Jun 6, 2015
profile.h Add summary line, termination status May 30, 2015
read.c More global variable separation for modularity May 28, 2015
read.h Break up files so we can compose and test pieces of it. May 28, 2015
readme.vms Fix botched profile hashing Jun 3, 2015
remake.c Issue warning detecting a "deterministic" archive Aug 5, 2016
remote-cstms.c Files from GNU Make 4.1 release. Dec 29, 2014
remote-stub.c More global variable separation for modularity May 28, 2015
rule.c Merge floc_t into gmk_loc Dec 29, 2014
rule.h
signame.c Files from GNU Make 4.1 release. Dec 29, 2014
strcache.c Files from GNU Make 4.1 release. Dec 29, 2014
subproc.bat
trace.c Merge floc_t into gmk_loc Dec 29, 2014
trace.h Merge floc_t into gmk_loc Dec 29, 2014
types.h Merge floc_t into gmk_loc Dec 29, 2014
variable.c remake --tasks and remake --targets now works, modulo possible bugs. Dec 29, 2014
variable.h remake --tasks and remake --targets now works, modulo possible bugs. Dec 29, 2014
version.c Break up files so we can compose and test pieces of it. May 28, 2015
vmsdir.h Files from GNU Make 4.1 release. Dec 29, 2014
vmsfunctions.c Files from GNU Make 4.1 release. Dec 29, 2014
vmsify.c Files from GNU Make 4.1 release. Dec 29, 2014
vmsjobs.c Files from GNU Make 4.1 release. Dec 29, 2014
vpath.c Files from GNU Make 4.1 release. Dec 29, 2014
vpath.h Start parsing remake trace/debugger options Mar 21, 2011

README.md

Build Status

Patched GNU Make 4.1 sources to add improved error reporting, tracing, target listing, graph visualization, and profiling. It also contains debugger. See the remake-3-82 branch for a patched GNU Make 3.82.

Tracing and Debugging

Although there's a full debugger here, most of the time I can get by using no options since normal output is a little more verbose and detailed. When that isn't enough, I use the --trace or -x option, e.g:

remake -x <other make options>

But if you want the full debugger, use --debugger or -X:

remake -X <other make options>

To enter the debugger from inside a Makefile, use the built-in function $(debugger). For example here is a Makefile:

all:
    $(debugger 'arg not used')
    echo Nothing here, move along

When GNU Make is inside the all target, it will make a call to the debugger. The string after debugger is not used, but seems to be needed to get parsing right.

Getting Makefile Information

If there is project that you want a list of "interesting" Makefile targets, try:

remake --tasks

If the project has commented its Makefile using remake-friendly comments you may get output like this:

ChangeLog   # create ChangeLog fom git log via git2cl
build   # Do what it takes to build software locally
check   # Run all tests
clean   # Remove OS- and platform-specific derived files.
dist    # Create source and binary distribution
distclean   # Remove all derived files. Like "clean" on steroids.
install # Install package
test    # Same as check

To get a list of all targets, interesting or not, use --targets instead of --tasks.

To build:

$ autoreconf -i
$ ./configure
$ make update
$ make && make check && sudo make install

Profiling and Visualization

To profile and get a graph of targets encountered used the --profile option. For example:

remake --profile # target...

remake outputs callgrind profile format data which can be used with kcachegrind or other tools that work with this format.

See also

See also https://github.com/rocky/remake/wiki and https://github.com/rocky/remake/blob/master/profile/README.md