GithubHelp home page GithubHelp logo

rocky / remake Goto Github PK

View Code? Open in Web Editor NEW
761.0 48.0 71.0 20.26 MB

Enhanced GNU Make - tracing, error reporting, debugging, profiling and more

Home Page: http://bashdb.sf.net/remake

License: GNU General Public License v3.0

Ruby 0.36% C 67.84% Shell 0.81% Objective-C 0.12% Makefile 2.20% Scheme 0.14% Perl 12.40% M4 13.22% C++ 2.92%
makefile visualization trace debugger profile

remake's Introduction

Build Status Packaging status

Download remake

Here we have patched GNU Make 4.3 sources to add improved error reporting, tracing, target listing, graph visualization, profiling, and more. It also contains a debugger. Branches remake-4-2, remake-4-1, remake-3-82, and remake-3-81 for patched GNU Make 4.2, 4.1, 3.82, and 3.81 respectively.

See the readthedocs guide for information, including remake features, and installation.

The wiki also has information, including links to videos, and information for developers.

Example showing --tasks feature:

--tasks

Example showing --trace (short option -x) feature.

--trace

Example showing --show-parent (short option -c) feature:

--show-parent

Example showing --profile output (displayed via KCachegrind):

--profile

remake's People

Contributors

boretom avatar duncan-roe avatar gmargari avatar jason2013 avatar mayeulc avatar nshp avatar rocky avatar ronan-d avatar yarikoptic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remake's Issues

Undefined references

Hi,

I tried to install remake on our linux machines, but it failed with the below error messages:

gcc -g -O2 -o make ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o implicit.o job.o main.o misc.o read.o remake.o remote-stub.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o buildargv.o debug.o print.o trace.o break.o cmd.o fns.o file2line.o msg.o stack.o -lrt
cmd.o: In function enter_debugger': /home/xsivaad/Downloads/remake-3.82+dbg-0.6/debugger/cmd.c:496: undefined reference toadd_history'
/home/xsivaad/Downloads/remake-3.82+dbg-0.6/debugger/cmd.c:497: undefined reference to execute_line' /home/xsivaad/Downloads/remake-3.82+dbg-0.6/debugger/cmd.c:499: undefined reference toadd_history'
/home/xsivaad/Downloads/remake-3.82+dbg-0.6/debugger/cmd.c:500: undefined reference to dbg_cmd_step' /home/xsivaad/Downloads/remake-3.82+dbg-0.6/debugger/cmd.c:504: undefined reference todbg_cmd_quit'
/home/xsivaad/Downloads/remake-3.82+dbg-0.6/debugger/cmd.c:403: undefined reference to cmd_initialize' collect2: ld returned 1 exit status make[1]: *** [make] Error 1 make[1]: Leaving directory/home/xsivaad/Downloads/remake-3.82+dbg-0.6'
make: *** [check-recursive] Error 1

to compile must need libreadline6-dev

Under Ubuntu12.04 there is only remake+dbg0.2,so i must compile myself.
./configure will not report error,however make will report undefined reference.
It's easy to resolve this problem,install libreadline6-dev,it will install many .h,rerun ./configure,make,this time success.
By the way,remake is really good,thank you!

gcc -g -O2 -o make ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o implicit.o job.o main.o misc.o read.o remake.o remote-stub.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o buildargv.o debug.o print.o trace.o break.o cmd.o fns.o file2line.o msg.o stack.o -lrt
main.o: In function main': /root/packages/remake-3.82+dbg0.8/main.c:2388: undefined reference todbg_cmd_info_targets'
/root/packages/remake-3.82+dbg0.8/main.c:2391: undefined reference to dbg_cmd_info_targets' cmd.o: In functionenter_debugger':
/root/packages/remake-3.82+dbg0.8/debugger/cmd.c:496: undefined reference to add_history' /root/packages/remake-3.82+dbg0.8/debugger/cmd.c:497: undefined reference toexecute_line'
/root/packages/remake-3.82+dbg0.8/debugger/cmd.c:499: undefined reference to add_history' /root/packages/remake-3.82+dbg0.8/debugger/cmd.c:500: undefined reference todbg_cmd_step'
/root/packages/remake-3.82+dbg0.8/debugger/cmd.c:504: undefined reference to dbg_cmd_quit' /root/packages/remake-3.82+dbg0.8/debugger/cmd.c:403: undefined reference tocmd_initialize'

pre-built W32 version

Is it at all possible to get a pre-built version (i.e. the .exe file) of remake, preferably 3.82 as that is the version of the GNU Make I am using, for Windows 32 ?

I have had no luck building the source code.

Thanks
Bob Workman

t @ e doesn't work with GNU Make 4.1+dbg1.1

t @ e doesn't work (doesn't expand the variables) with GNU Make 4.1+dbg1.1, but it works fine with GNU Make 3.82+dbg0.9

cat Makefile1.mk

FOO := foo

all:
    @echo $(FOO)

remake -X -f Makefile1.mk

GNU Make 4.1+dbg1.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Copyright (C) 2015 Rocky Bernstein.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
-> (/home/galen_liu/remake_test/Makefile1.mk:3)
Will update target:all: 
remake<0> l
/home/galen_liu/remake_test/Makefile1.mk:3
Target: all:
#  recipe to execute (from 'Makefile1.mk', line 4):
    @echo $(FOO)
remake<1> t @ e

Target: all:
#  recipe to execute (from 'Makefile1.mk', line 4):
    @echo $(FOO)
remake<2> remake: That's all, folks...

remake -X -f Makefile1.mk

GNU Make 3.82+dbg0.9
Built for x86_64-unknown-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
-> (/home/galen_liu/remake_test/Makefile1.mk:3)
Will update target:all: 
remake<0> l
/home/galen_liu/remake_test/Makefile1.mk:3
Target: all:
#  commands to execute (from `Makefile1.mk', line 4):
    @echo $(FOO)

remake<1> t @ e

Target: all:
#  commands to execute (from `Makefile1.mk', line 4):
    @echo foo

Add "set editing" command

This is a gdb command but the trepanning debugger don't support mixed emacs/vi commands, but instead basically use GNU Readline undeneath so you set which variant you want.

Here is the help from bashdb:

set editing [on|off|emacs|vi] 

Readline editing of command lines 

See also: 

show editing 

@boretom You up for adding this command?

(In going over documenting remake I came across this.)

Documentation URL is broken

Actual documentation URL is http://bashdb.sourceforge.net/remake/remake.html/Sample-Sessions.html#Sample-Sessions, and I could only navigate there from Google.

  • Showmedo link ("Short (14 minute) demo of introducing debugging Makefiles – part 1") is dead.
  • "Screenshot of remake under DDD" link is dead.

remake should set REMAKEFLAGS (for -X and -x) and not MAKEFLAGS

From make-4.1/NEWS +102

====> Version 4.0 (09 Oct 2013)

  • New variable: $(GNUMAKEFLAGS) will be parsed for make flags, just like
    MAKEFLAGS is. It can be set in the environment or the makefile, containing
    GNU make-specific flags to allow your makefile to be portable to other
    versions of make. Once this variable is parsed, GNU make will set it to the
    empty string so that flags will not be duplicated on recursion.

...

Behavior of MAKEFLAGS and MFLAGS is more rigorously defined. All simple
flags are grouped together in the first word of MAKEFLAGS. No options that
accept arguments appear in the first word. If no simple flags are present
MAKEFLAGS begins with a space. Flags with both short and long versions
always use the short versions in MAKEFLAGS. Flags are listed in
alphabetical order using ASCII ordering. MFLAGS never begins with "- ".

Given this, when -X or --debugger is parsed, that value should not be set in MAKEFLAGS or MFLAGS.

And as with issue #25, debugger commands, "step", "next", "finish" and "continue" would modify the REMAKEFLAGS environment variable.

"next" (step over) and "finish" (step out) and "continue) should not cause recursive make to stop

The debugger command, "step" should cause a recursive invocation of make to stop in the recursion. The debugger commands "next", "finish" and "continue" should not.

Gist https://gist.github.com/rocky/2bf8ee0000a1efd53929
has a sample Makefile that can be used to test this. Files that would probably change are step.h, next.h, continue.h, and finish.h in folder debugger/command/, Possibly the routine that sets up the GNUMAKEFLAGS environment variable could be common.

What I think is needed is to change "step", "next", "continue", "finish" to set GNUMAKEFLAGS to include "X" as appropriate.

Merge request for debianization

Hi. I updated and pushed the remake debian package to the debian repo:

https://tracker.debian.org/news/788381

I'm co-maintaining the package with Yaroslav. The corresponding git branches live in your repository, so could you please fast-forward your debian and master-dfsg branches to those from my fork:

https://github.com/dkogan/remake

I'd make a pull request, but those create ugly extra merge commits that I'd like to avoid (it does a 'git merge --no-ff').

Thanks

Feature: allow searching parent directory for a Makefile.

I think a cool feature to add is that if no Makefile appears in the current directory the parent directory is searched (using that directory as the cwd) and so on.

This is the way many other more modern tools work, e.g. git, pyenv.

Create debugger library

The static .h include thing in debugger/commands has always been a bit of a hack.

There should be a debugger library.

Also that makes it easier to ignore when GNU readline is not around in mimalist environments, and you still want to other features of remake.

GNU remake 4.3

In issue #40 @boretom reports:

regarding make 4.3: I did a diff and I'm up for the task - not like from 3.8 to 4 :) ... it may take a week or two. If you're ok with that timeline I would take on the task.

@boretom thanks, the project can wait a week or two.

Note that regarding make 4.3, I recently read in the news (and can't find it now) that Linus Torvalds has found a way to take advantange of the speedup that was proposed over a year ago in 4.3 to parallel builds. And with this, there can be something like a 10x speedup in building the Linux Kernel on multicore machines by using the --jobs option along with his customization in the kernel that recently went out.

As a result, the prioritiy of getting this done has increased.

Another (somewhat accidental) benefit of remake over GNU make is that since it is not in the critical path of a lot of things, OS's that have 4.2 (or 3.x) can also install remake and that gives them an easy way to instal a newer GNU make to try it out without impacting existing programs.

So I had planned on doing this, but I'd rather if someone else did. That way, there are two people in the world that may understand this. And in the end I know the code will get much much better. (See my comment make previously somewhere else about making a lot of mistakes).

However... painful experience has shown that the right way to do this is to make two new branches, make-4-3 with the GNU make source, and another branch from that remake-4-3. And then with the 'diff"s from make-4-2 HEAD to remake-4-2 HEAD, "rebase" them onto the remake-4-3 branch. In other words, do not build off of the exisiting remake-4-2 branch at HEAD.

In the last paragraph, I put "rebase" in quotes because I don't necessariliy mean using git rebase. For such largish changes that might be too difficult. Of course, It is a possibility if that helps, but again; I just don't think it will, but I could be wrong.

So shortly I will be creating the two branches to work off of, although I'll leave the work from the branch from remake-4-3 to a fully featured remake 4.3 up to you.

Errors running ./configure

I'm probably doing something wrong or missing bits, but I'm getting these errors when run autoconf and later ./configure on Ubuntu 16.04 LTS


safe50@safe50-nuc2:/Downloads/remake-release-remake-4.2.1-dbg-1.4$ sudo autoconf
configure.ac:33: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:34: error: possibly undefined macro: AM_MAINTAINER_MODE
configure.ac:52: error: possibly undefined macro: AM_PROG_AR
configure.ac:60: error: possibly undefined macro: AM_MISSING_PROG
configure.ac:63: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
configure.ac:64: error: possibly undefined macro: AM_GNU_GETTEXT
configure.ac:83: error: possibly undefined macro: AM_PROG_CC_C_O
configure.ac:95: error: possibly undefined macro: AC_STRUCT_ST_MTIM_NSEC
configure.ac:122: error: possibly undefined macro: pds_AC_DOS_PATHS
configure.ac:195: error: possibly undefined macro: AM_CONDITIONAL
configure.ac:565: error: possibly undefined macro: AM_WITH_DMALLOC
safe50@safe50-nuc2:
/Downloads/remake-release-remake-4.2.1-dbg-1.4$ ls con*config.h.W32.template config.log configure configure.ac configure.bat

config:
ar-lib dospaths.m4 intlmacosx.m4 longlong.m4 missing texinfo.tex
compile gettext.m4 lib-ld.m4 Makefile.am nls.m4
config.rpath iconv.m4 lib-link.m4 Makefile.in po.m4
depcomp install-sh lib-prefix.m4 mdate-sh progtest.m4
safe50@safe50-nuc2:~/Downloads/remake-release-remake-4.2.1-dbg-1.4$ ./configure
./configure: line 2358: syntax error near unexpected token subdir-objects' ./configure: line 2358: AM_INIT_AUTOMAKE(subdir-objects 1.14 silent-rules foreign -Wall)'

Rsync fails from behind firewall

I was trying to build remake from behind a corporate firewall. Our firewall blocks rsync connections but allows wget. As a result, I could not update the po/*.po files.

The translationproject.org site recommends using wget instead. I would like to modify maintMakefile to use wget so as to be more firewall friendly.

GNU Make 4.1+dbg1.1: recipe with "make -f " got unexpected result

GNU Make 4.1+dbg1.1: recipe with "make -f " got unexpected result
but GNU Make 3.82+dbg0.9 works fine.

Test GNU Make 4.1+dbg1.1

ls

Makefile1.mk  Makefile2.mk

cat Makefile1.mk

FOO := foo

all:
    @echo $(FOO)

cat Makefile2.mk

all:
    make -f Makefile1.mk

remake -X -f Makefile2.mk

GNU Make 4.1+dbg1.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Copyright (C) 2015 Rocky Bernstein.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
-> (/home/galen_liu/remake_test/Makefile2.mk:1)
Will update target:all: 
remake<0> l
/home/galen_liu/remake_test/Makefile2.mk:1
Target: all:
#  recipe to execute (from 'Makefile2.mk', line 2):
    make -f Makefile1.mk
remake<1> n
 File `all' does not exist.
-- (/home/galen_liu/remake_test/Makefile2.mk:1)
Will update target:all: 
remake<2> n
Must remake target `all'.
Makefile2.mk:2: target 'all' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
make -f Makefile1.mk
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# make[1]: Entering directory '/home/galen_liu/remake_test'
touch all
# GNU Make 4.0
# Built for x86_64-pc-linux-gnu
# Copyright (C) 1988-2013 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.

# Make data base, printed on Thu Jul 16 17:07:32 2015

# Variables

# automatic
<D = $(patsubst %/,%,$(dir $<))
# automatic
?F = $(notdir $?)
# environment
DESKTOP_SESSION = ubuntu
# default
.SHELLFLAGS := -c
# environment
XDG_SESSION_TYPE = x11
# environment
UPSTART_INSTANCE = 
# default
CWEAVE = cweave
# automatic
?D = $(patsubst %/,%,$(dir $?))
# automatic
@D = $(patsubst %/,%,$(dir $@))
# environment
XAUTHORITY = /home/galen_liu/.Xauthority
# environment
GDMSESSION = ubuntu
# environment
XMODIFIERS = @im=fcitx
# makefile
CURDIR := /home/galen_liu/remake_test
# makefile
SHELL = /bin/sh
# default
RM = rm -f
# environment
GDM_LANG = en_US
# environment
VTE_VERSION = 3803
# environment
_ = /usr/local/bin/remake
# default
PREPROCESS.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F
# default
LINK.m = $(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# environment
XDG_CONFIG_DIRS = /etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
# default
OUTPUT_OPTION = -o $@
# default
COMPILE.cpp = $(COMPILE.cc)
# makefile (from 'Makefile1.mk', line 1)
MAKEFILE_LIST :=  Makefile1.mk
# automatic
@F = $(notdir $@)
# environment
IM_CONFIG_PHASE = 1
# 'override' directive
GNUMAKEFLAGS := 
# environment
SESSIONTYPE = gnome-session
# environment under -e
MAKELEVEL := 1
# environment
MANDATORY_PATH = /usr/share/gconf/ubuntu.mandatory.path
# environment
XDG_DATA_DIRS = /usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
# environment
DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-Ip5ba3W6Zp
# default
CC = cc
# default
CHECKOUT,v = +$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)
# environment
CLUTTER_IM_MODULE = xim
# environment
LC_NAME = zh_CN.UTF-8
# default
CPP = $(CC) -E
# environment
USE_CCACHE = 1
# environment
XDG_SESSION_PATH = /org/freedesktop/DisplayManager/Session0
# default
LEX = lex
# default
MAKE_HOST := x86_64-pc-linux-gnu
# environment
NO_PROXY = localhost,127.0.0.0/8,::1
# default
LD = ld
# default
TEXI2DVI = texi2dvi
# environment
GPG_AGENT_INFO = /run/user/1000/keyring/gpg:0:1
# default
YACC = yacc
# environment
UPSTART_JOB = unity7
# default
COMPILE.mod = $(M2C) $(M2FLAGS) $(MODFLAGS) $(TARGET_ARCH)
# environment
XDG_RUNTIME_DIR = /run/user/1000
# default
ARFLAGS = rv
# default
LINK.r = $(FC) $(FFLAGS) $(RFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# environment
WINDOWID = 25165835
# default
COMPILE.f = $(FC) $(FFLAGS) $(TARGET_ARCH) -c
# default
LINT.c = $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)
# default
YACC.m = $(YACC) $(YFLAGS)
# default
LINT = lint
# default
LINK.p = $(PC) $(PFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# default
YACC.y = $(YACC) $(YFLAGS)
# default
AR = ar
# environment
LC_NUMERIC = zh_CN.UTF-8
# default
.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell archives jobserver output-sync check-symlink load
# default
TANGLE = tangle
# environment
SESSION = ubuntu
# environment
XDG_GREETER_DATA_DIR = /var/lib/lightdm-data/galen_liu
# environment
LS_COLORS = rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
# environment
JOB = unity-settings-daemon
# environment
XDG_SESSION_DESKTOP = ubuntu
# environment
SSH_AUTH_SOCK = /run/user/1000/keyring/ssh
# default
GET = get
# automatic
%F = $(notdir $%)
# environment
DISPLAY = :0
# default
COMPILE.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
# environment
no_proxy = localhost,127.0.0.0/8,::1
# default
CTANGLE = ctangle
# environment
GTK_IM_MODULE = fcitx
# default
.LIBPATTERNS = lib%.so lib%.a
# default
LINK.C = $(LINK.cc)
# environment
PWD = /home/galen_liu/remake_test
# environment
QT_QPA_PLATFORMTHEME = appmenu-qt5
# default
LINK.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)
# environment
XDG_SEAT = seat0
# default
PREPROCESS.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F
# default
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# environment
GTK_MODULES = overlay-scrollbar:unity-gtk-module
# default
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# default
LINK.s = $(CC) $(ASFLAGS) $(LDFLAGS) $(TARGET_MACH)
# environment
HOME = /home/galen_liu
# environment
LD_LIBRARY_PATH = /usr/local/lib:
# environment
LOGNAME = galen_liu
# automatic
+F = $(notdir $+)
# default
CO = co
# default
MAKE_VERSION := 4.0
# environment
GNOME_DESKTOP_SESSION_ID = this-is-deprecated
# automatic
^D = $(patsubst %/,%,$(dir $^))
# environment
XDG_VTNR = 7
# environment
LC_TIME = zh_CN.UTF-8
# default
COMPILE.m = $(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
# default
MAKE = $(MAKE_COMMAND)
# environment
QT_IM_MODULE = fcitx
# environment
SHLVL = 1
# default
AS = as
# default
PREPROCESS.S = $(CC) -E $(CPPFLAGS)
# environment
JAVA_HOME = /opt/jdk1.6.0_45
# environment
COMPIZ_CONFIG_PROFILE = ubuntu
# default
COMPILE.p = $(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
# environment
XDG_SESSION_ID = c1
# environment
USER = galen_liu
# default
FC = f77
# environment
LC_MONETARY = zh_CN.UTF-8
# makefile
.DEFAULT_GOAL := all
# environment
XDG_CURRENT_DESKTOP = Unity
# environment
LIBVIRT_DEFAULT_URI = qemu:///system
# environment
CLASSPATH = .:/opt/jdk1.6.0_45/jre/lib/rt.jar:/opt/jdk1.6.0_45/lib/dt.jar:/opt/jdk1.6.0_45/lib/tools.jar
# environment
UPSTART_EVENTS = xsession started
# automatic
%D = $(patsubst %/,%,$(dir $%))
# environment
GNOME_KEYRING_PID = 
# environment
LC_TELEPHONE = zh_CN.UTF-8
# default
WEAVE = weave
# default
MAKE_COMMAND := make
# default
LINK.cpp = $(LINK.cc)
# default
F77 = $(FC)
# environment
OLDPWD = /home/galen_liu
# default
.VARIABLES := 
# default
PC = pc
# automatic
*F = $(notdir $*)
# environment
LANGUAGE = en_US
# environment
XDG_SEAT_PATH = /org/freedesktop/DisplayManager/Seat0
# default
COMPILE.def = $(M2C) $(M2FLAGS) $(DEFFLAGS) $(TARGET_ARCH)
# environment
GNOME_KEYRING_CONTROL = 
# environment under -e
MAKEFLAGS = eiprtw
# environment under -e
MFLAGS = -eiprtw
# automatic
*D = $(patsubst %/,%,$(dir $*))
# default
LEX.l = $(LEX) $(LFLAGS) -t
# default
LEX.m = $(LEX) $(LFLAGS) -t
# automatic
+D = $(patsubst %/,%,$(dir $+))
# default
COMPILE.r = $(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -c
# environment
MAKE_TERMOUT = /dev/pts/28
# environment
LC_PAPER = zh_CN.UTF-8
# default
M2C = m2c
# environment
SVN_EDITOR = vi
# makefile (from 'Makefile1.mk', line 1)
FOO := foo
# environment
COMPIZ_BIN_PATH = /usr/bin/
# environment
DEFAULTS_PATH = /usr/share/gconf/ubuntu.default.path
# default
MAKEFILES := 
# environment
UPSTART_SESSION = unix:abstract=/com/ubuntu/upstart-session/1000/1572
# default
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
# automatic
<F = $(notdir $<)
# default
CXX = g++
# environment
LC_MEASUREMENT = zh_CN.UTF-8
# environment
INSTANCE = 
# default
COFLAGS = 
# environment
CCACHE_UMASK = 002
# default
COMPILE.C = $(COMPILE.cc)
# environment
QT4_IM_MODULE = fcitx
# automatic
^F = $(notdir $^)
# default
COMPILE.S = $(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c
# environment
PATH = /opt/jdk1.6.0_45/bin:/usr/lib/jvm/java-6-openjdk-amd64/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
# default
LINK.F = $(FC) $(FFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# default
SUFFIXES := 
# default
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
# default
COMPILE.s = $(AS) $(ASFLAGS) $(TARGET_MACH)
# default
.INCLUDE_DIRS = /usr/include /usr/local/include /usr/include
# environment
LC_IDENTIFICATION = zh_CN.UTF-8
# default
.RECIPEPREFIX := 
# default
MAKEINFO = makeinfo
# environment
MAKE_TERMERR = /dev/pts/28
# default
OBJC = cc
# environment
LC_ADDRESS = zh_CN.UTF-8
# default
LINK.f = $(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)
# default
TEX = tex
# environment
LANG = en_US.UTF-8
# environment
TERM = xterm
# default
F77FLAGS = $(FFLAGS)
# default
LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH)
# variable set hash-table stats:
# Load=177/1024=17%, Rehash=0, Collisions=29/205=14%

# Pattern-specific Variable Values

# No pattern-specific variable values.

# Directories


# No files, no impossibilities in 0 directories.

# Implicit Rules

# No implicit rules.

# Files

all:
#  Implicit rule search has not been done.
#  Last modified 2514-05-30 09:53:03.107374182
#  File has been updated.
#  Successfully updated.
#  recipe to execute (from 'Makefile1.mk', line 4):
    @echo $(FOO)

# Not a target:
Makefile1.mk:
#  Implicit rule search has been done.
#  Last modified 2015-07-16 16:39:55.80266134
#  File has been updated.
#  Successfully updated.

# Not a target:
.DEFAULT:
#  Implicit rule search has not been done.
#  Modification time never checked.
#  File has not been updated.

# files hash-table stats:
# Load=4/1024=0%, Rehash=0, Collisions=0/15=0%
# VPATH Search Paths

# No 'vpath' search paths.

# No general ('VPATH' variable) search path.

# strcache buffers: 1 (0) / strings = 6 / storage = 68 B / avg = 11 B
# current buf: size = 8162 B / used = 68 B / count = 6 / avg = 11 B

# strcache performance: lookups = 9 / hit rate = 33%
# hash-table stats:
# Load=6/8192=0%, Rehash=0, Collisions=0/9=0%
# Finished Make data base on Thu Jul 16 17:07:32 2015

# make[1]: Leaving directory '/home/galen_liu/remake_test'
Successfully remade target file `all'.


ls

all  Makefile1.mk  Makefile2.mk

Here, We got file: all

Test GNU Make 3.82+dbg0.9

ls

Makefile1.mk  Makefile2.mk

cat Makefile1.mk

FOO := foo

all:
    @echo $(FOO)

cat Makefile2.mk

all:
    make -f Makefile1.mk

remake -X -f Makefile2.mk

GNU Make 3.82+dbg0.9
Built for x86_64-unknown-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
-> (/home/galen_liu/remake_test/Makefile2.mk:1)
Will update target:all: 
remake<0> l
/home/galen_liu/remake_test/Makefile2.mk:1
Target: all:
#  commands to execute (from `Makefile2.mk', line 2):
    make -f Makefile1.mk

remake<1> n
  /home/galen_liu/remake_test/Makefile2.mk:1    File `all' does not exist.
-- (/home/galen_liu/remake_test/Makefile2.mk:1)
Will update target:all: 
remake<2> n
  /home/galen_liu/remake_test/Makefile2.mk:1    Must remake target `all'.
Invoking recipe from Makefile2.mk:2 to update target `all'.
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
make -f Makefile1.mk
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
make[1]: Entering directory `/home/galen_liu/remake_test'
foo
make[1]: Leaving directory `/home/galen_liu/remake_test'
  /home/galen_liu/remake_test/Makefile2.mk:1    Successfully remade target file `all'.

Build fails on gcc-10

Hi. The latest 4.3-dbg1.5 release doesn't build with gcc-10:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=957756

This report is for the previous release, but the issue is there in the latest release too. The problem is that remake is defining global variables in header files, which creates multiple symbols (one for each object built from a .c that #includes such a header), and those symbols clash. gcc-10 changed the default build flags, which trigger the failure. The legacy mode can be enabled with -fcommon or we can not define globals in headers. This is the first issue described in the porting guide:

https://gcc.gnu.org/gcc-10/porting_to.html

Thanks

Checking correctness for multi-target rules

Multiple targets can be specified in a single make rule. While they are written only once at such a place, the make software usually expands the specification into several rules with the same recipe so far.
But this does not happen with pattern rules:

…
Pattern rules may have more than one target. Unlike normal rules, this does not act as many different rules with the same prerequisites and recipe. If a pattern rule has multiple targets, make knows that the rule’s recipe is responsible for making all of the targets. The recipe is executed only once to make all the targets.
…

Can a variant of the command “remake --targets” help to identify questionable multi-target rules?

Allow target name after `--tasks`

Right now remake --tasks lists doc comments for all targets. But suppose I just want the comment for a single target.

It would be nice if I could put the target name after --tasks. For example:

make --tasks check

Pull out debugger code and put in a library.

The static .h include thing in debugger/commands has always been a bit of a hack.

There should be a debugger library.

Also that makes it easier to ignore when GNU readline is not around in mimalist environments, and you still want to other features of remake.

Recursive Make Profiling

I'd like a way to combine the generated callgrind profiles into a single profile when using recursive make.

--verbosity usage (--help) message does not match behavior

According to the usage message:

  --verbosity[=LEVEL]         Set verbosity level. LEVEL may be "terse" "no-header" or
                          "full". The default is "full".

But LEVEL is actually required.

$ remake -C Somedir --verbosity
remake: option `--verbosity' requires an argument

$ remake --verbosity -C Somedir 
remake: Nothing to be done for 'Somedir'

The latter example demonstrates that --verbosity consumes the next argument as a LEVEL without any warning of the validity of the level and in spite of the fact that it is an argument option.

remake+ddd, can't see anything in ddd's source window

Hi there,

I've installed remake 3.82+dbg0.9 and ddd 3.3.12.

I've followed the steps on this page:
http://sourceforge.net/apps/mediawiki/bashdb/index.php?title=Remake_and_DDD

All the steps report back as expected ("--make invokes remake", running "remake --debugger -f" works fine from the console).

However, when it comes to the last step, "ddd --make Makefile", it runs ddd successfully, the bottom pane shows the remake console output, but the top pane (which ought to show the source) remains empty.

I can type remake commands just fine from the console (list, info, n, etc), but no source ever seems to get displayed in the top pane.

I'm running on opensuse12.3 linux (32-bit).

GNU Make 4.1+dbg1.1: run quit with error and can't quit in nested depth

GNU Make 4.1+dbg1.1: run quit with error and can't quit in nested depth,
GNU Make 3.82+dbg0.9 works fine.

cat Makefile

all: foo

foo:
    $(MAKE) bar

bar:
    @echo "This is bar recipe"

remake -X

GNU Make 4.1+dbg1.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Copyright (C) 2015 Rocky Bernstein.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
-> (/home/galen_liu/remake_test/Makefile:3)
Will update target:foo: 
remake<0> n
   File `foo' does not exist.
-- (/home/galen_liu/remake_test/Makefile:3)
Will update target:foo: 
remake<1> n
  Must remake target `foo'.
Makefile:4: target 'foo' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
remake bar
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Reading makefiles...
Updating makefiles....
Updating goal targets....
-> (/home/galen_liu/remake_test/Makefile:6)
Will update target:bar: 
remake<<0>> q
remake: That's all, folks...
Makefile:4: recipe for target 'foo' failed
Makefile:3: *** [foo] Error 77

#0  foo at /home/galen_liu/remake_test/Makefile:3
#1  all at /home/galen_liu/remake_test/Makefile:1

***Entering debugger because we encountered a fatal error.
** Exiting the debugger will exit make with exit code 77.
!! (/home/galen_liu/remake_test/Makefile:3)
Will update target:foo
remake<2> q
remake: That's all, folks...
remake: *** Waiting for unfinished jobs....
remake: *** wait: No child processes.  Stop.

Internet access is required to build

I ran autogen.sh script from remake-release-remake-4.2.1-dbg-1.4 release. It broke on:

[ -d "po" ] && make do-po-update make[1]: Entering directory/home/amichalik/tmp/remake-release-remake-4.2.1-dbg-1.4'
Makefile:1927: warning: overriding recipe for target ChangeLog' Makefile:1594: warning: ignoring old recipe for target ChangeLog'
tmppo="/tmp/po-remake-4.2.1+dbg-1.4.$$"
&& rm -rf "$tmppo"
&& mkdir "$tmppo"
&& rsync -Lrtvz translationproject.org::tp/latest/make/ "$tmppo"
&& cp "$tmppo"/*.po ./po
&& rm -rf "$tmppo"
rsync: failed to connect to translationproject.org (2a01:7c8:c037:6::20): Connection timed out (110)
rsync: failed to connect to translationproject.org (80.69.83.146): Network is unreachable (101)
rsync error: error in socket IO (code 10) at clientserver.c(125) [Receiver=3.1.2]
make[1]: *** [do-po-update] Error 10
`

Build system should never require internet connection and download random packages. If dependencies are required, they either should be packaged alongside release, or clearly described (e.g. the build will fail in case GNU Readline is not available, but it won't try to download and install it on its own).

Does the argument debugger=preread work?

I am not sure if this is a bug or my misunderstanding of the docs, but...
The docs say "The “preread” sub-option enters the debugger after command-line options are parsed but before any Makefiles have been read."

But when I use "preread" I get this,

galadriel% L6remake --debugger=preread
GNU Make 3.82+dbg-0.6
Built for x86_64-unknown-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile Makefile'... Reading makefile../../configure/CONFIG' (search path) (no ~ expansion)...
Reading makefile ../../configure/RELEASE' (search path) (no ~ expansion)... Reading makefile../../configure/RELEASE.linux-x86_64.Common' (search path) (don't care) (no ~ expansion)...

Reading makefile /home/oxygen/SLUITER/distribute/base-3.14.12.3/configure/RULES' (search path) (no ~ expansion)... Reading makefile/home/oxygen/SLUITER/distribute/base-3.14.12.3/configure/RULES_ARCHS' (search path) (no ~ expansion)...
Updating makefiles....
File ../../configure/CONFIG_SITE.linux-x86_64.Common' does not exist. Must remake target../../configure/CONFIG_SITE.linux-x86_64.Common'.
Failed to remake target file `../../configure/CONFIG_SITE.linux-x86_64.Common'.
<- (/home/oxygen6/SLUITER/local/epics/synAppsSVN/support/alive/aliveApp/src/??:0)
../../configure/CONFIG_SITE.linux-x86_64.Common

remake appears to be done reading makefiles and beginning to process its' 1st target?

Working with this version,
GNU Make 3.82+dbg-0.6
built on,
Linux 2.6.32-358.14.1.el6.x86_64 #1 SMP Mon Jun 17 15:54:20 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
using,
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)

Ron

Is profiling working?

I download 4.2.1 and built on ubuntu 16.04
Then i pointed that to our makefile, the top level target, and asked it to profile; like so:

remake --profile -C dir/ -f Makefile all

The whole thing took one hour since we have too many targets to build. At the end of that I get a file called callgrind.out.193121
This is the entire contents of the callgrind file:

$ cat callgrind.out.193121
version: 1
creator: remake 4.2.1+dbg-1.4
cmd: remake --profile -C aris -f Makefile all
pid: 193121

desc: Trigger: Normal program termination
desc: Node: Targets

positions: line
events: 100usec
summary: 25644383


Am I missing something? Has Profiling been redefined?
Is Remake able to capture timings for all targets being invoked in the entire DAG for a makefile?

No remake for GNU make 4.0

Would you be interested in a PR updating remake to GNU make 4.0 and 4.1? (With suitable tags post facto)

./configure command not found

As suggested, tried with latest release. but we are failing this issue.

I see that there is no configure script in the source code.

problem building on Ubuntu 14.04.2 LTS

Trying to build on Ubuntu 14.04.2 LTS fails when building docs (I do have texinfo installed)

Making all in doc

make[2]: Entering directory /home/scratch.mwoodpatrick/remake/doc' restore=: && backupdir=".am$$" && \ am__cwd=pwd&& CDPATH="${ZSH_VERSION+.}:" && cd . && \ rm -rf $backupdir && mkdir $backupdir && \ if (/bin/bash /home/scratch.mwoodpatrick/remake/config/missing makeinfo --version) >/dev/null 2>&1; then \ for f in make.info make.info-[0-9] make.info-[0-9][0-9] make.i[0-9] make.i[0-9][0-9]; do \ if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$am__cwd"; \ if /bin/bash /home/scratch.mwoodpatrick/remake/config/missing makeinfo -I . \ -o make.info make.texi; \ then \ rc=0; \ CDPATH="${ZSH_VERSION+.}:" && cd .; \ else \ rc=$?; \ CDPATH="${ZSH_VERSION+.}:" && cd . && \ $restore $backupdir/*echo "./make.info" | sed 's|[^/]_$||'; \ fi; \ rm -rf $backupdir; exit $rc make.texi:5: @include: could not find version.texi make.texi:24: warning: undefined flag: UPDATED make.texi:25: warning: undefined flag: VERSION make.texi:63: warning: undefined flag: VERSION make.texi:64: warning: undefined flag: UPDATED-MONTH make[2]: *_\* [make.info] Error 1 make[2]: Leaving directory /home/scratch.mwoodpatrick/remake/doc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory`/home/scratch.mwoodpatrick/remake'
make: *** [all] Error 2

GNU Make 4.1+dbg1.1: run bt command will crash in nested depth

GNU Make 4.1+dbg1.1: run bt command will crash , prompt "Segmentation fault (core dumped)"
GNU Make 3.82+dbg0.9 works fine.

cat Makefile

all: foo

foo:
    $(MAKE) bar

bar:
    @echo "This is bar recipe"

remake -X all

GNU Make 4.1+dbg1.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
Copyright (C) 2015 Rocky Bernstein.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating makefiles....
Updating goal targets....
 File `all' does not exist.
-> (/home/galen_liu/remake_test/Makefile:3)
Will update target:foo: 
remake<0> n
   File `foo' does not exist.
-- (/home/galen_liu/remake_test/Makefile:3)
Will update target:foo: 
remake<1> n
  Must remake target `foo'.
Makefile:4: target 'foo' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
remake bar
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Reading makefiles...
Updating makefiles....
Updating goal targets....
-> (/home/galen_liu/remake_test/Makefile:6)
Will update target:bar: 
remake<<0>> l
/home/galen_liu/remake_test/Makefile:6
Target: bar:
#  recipe to execute (from 'Makefile', line 7):
    @echo "This is bar recipe"
remake<<1>> bt
=>#0  bar at /home/galen_liu/remake_test/Makefile:6
Most-recent (level 1) invocation:
Makefile:4: recipe for target 'foo' failed
Makefile:3: *** [foo] Segmentation fault (core dumped)

#0  foo at /home/galen_liu/remake_test/Makefile:3
#1  all at /home/galen_liu/remake_test/Makefile:1
!! (/home/galen_liu/remake_test/Makefile:3)
Will update target:foo
remake<2> n

***Entering debugger because we encountered a fatal error.
** Exiting the debugger will exit make with exit code 2.
!! (/home/galen_liu/remake_test/Makefile:3)
Will update target:foo
remake<3> q
remake: That's all, folks...

tilde_expand() function collides with same function in libreadline.so.5

Using remake-3.82+dbg-0.6 on Debian Lenny, compiling remake from source, using system libraries provided by debian.

remake builds and installs, but "remake -X" segfaults. The stack trace is:
#0 0x000000000041dce9 in tilde_expand (name=0x7ffff7bd4546 "/etc/inputrc") at read.c:2815
#1 0x00007ffff7bc2b59 in _rl_read_init_file (filename=0x7ffff7bd4547 "etc/inputrc", include_level=47) at /home/nohar/Debian/Packages/nmu/readline/readline5-5.2/bind.c:864
#2 0x00007ffff7bb7345 in readline_initialize_everything () at /home/nohar/Debian/Packages/nmu/readline/readline5-5.2/readline.c:1039
#3 rl_initialize () at /home/nohar/Debian/Packages/nmu/readline/readline5-5.2/readline.c:929
#4 0x000000000042e960 in enter_debugger (p=0x66e450, p_target=0x667080, errcode=0, reason=DEBUG_BRKPT_BEFORE_PREREQ) at debugger/cmd.c:396
#5 0x000000000041f037 in update_file_1 (file=0x667080, depth=2, p_call_stack=0x66e450) at remake.c:434
#6 0x000000000041ec76 in update_file (file=0x667080, depth=2, p_call_stack=0x66cbb0) at remake.c:329
#7 0x0000000000421102 in check_dep (file=0x667080, depth=2, this_mtime=1, must_make_ptr=0x7fffffffca3c, p_call_stack=0x66cbb0) at remake.c:1043
#8 0x000000000041fa16 in update_file_1 (file=0x667200, depth=1, p_call_stack=0x66cbb0) at remake.c:586
#9 0x000000000041ec76 in update_file (file=0x667200, depth=0, p_call_stack=0x0) at remake.c:329
#10 0x000000000041e70e in update_goal_chain (goals=0x66cc60) at remake.c:163
#11 0x0000000000415ee6 in main (argc=2, argv=0x7fffffffe798, envp=0x7fffffffe7b0) at main.c:2368

Notice how readline's _rl_read_init_file() function in frame 1 ends up calling back into code supplied by remake. That's because both have a tilde_expand() function. The readline implementation never modifies the string passed in. The remake version modifies the string passed it, which can fail if a string literal is passed in.

remake's tilde_expand() has a signature:
char * tilde_expand (const char *name)

Hence it claims not to touch the string, but the error occurs during:
char *userend = strchr (name + 1, '/');
if (userend != 0)
*userend = '\0';

Here userend points into the name string. The const property gets dropped and the string is modified, breaking the signature's contract.

Workaround is to "touch ~/.inputrc" which cuts short readline's search for its rc file and avoids the bug.

A possible solution is to make remake's tidle_expand() have file scope using "static". However it's called from both read.c and main.c, so a bit of code reorganisation would be needed. Alternatively pick another function name that won't collide with libreadline.so.

One could also point out that if tilde_expand is not part of libreadline's public API, then it should have reduced the visibility of its symbols insulating itself for symbols in the parent executable that's linking in libreadline.

I'll supply a patch to rename remake's tilde_expand() if that helps.

Build error: "could not find version.texi"

Hi,

I was trying to build remake following the instructions on the README.md file and the make command was failing with the following error (some lines omitted for brevity):

make.texi:5: @include: could not find version.texi
Makefile:388: recipe for target 'make.info' failed
make[2]: *** [make.info] Error 1
Makefile:879: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:599: recipe for target 'all' failed
make: *** [all] Error 2

I eventually got it to work by running, before make, cd doc && make stamp-vti, which I found in travis.yml.

I don't know if I was doing something wrong, but thought I'd give a heads up about this, in case other people run into the same issue.

Thanks!

New upstream, make 4.0

It totally lazy fashion I'm just going to ask if anyone has tried to rebase remake onto make 4.0.

Consider this as an intent-to-try, so if someone already is trying, speak up.

Breakpoints propogating to recursive make

If you set a breakpoint on a target but the same makefile is called recursively, you won't stop in at the target in the recursive call.

We could save a profile and change the recursive call to read the profile. That may also be a way to deal with issue #26

profiling options?

  • set basename to use when creating profile data
  • set directory to output profile directory
  • a more compact format like CSV for output. Is there something other than callgrind that is more suitable?

fail to make 4-2

  • fedora28 4.16.14-300.fc28.x86_64
  • GNU Make 4.2.1 Built for x86_64-redhat-linux-gnu
  • gcc (GCC) 8.1.1 20180502 (Red Hat 8.1.1-1)
make[2]: Entering directory '/home/jimmy/workspace/git/remake/unittest'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/jimmy/workspace/git/remake/unittest'
make[2]: Entering directory '/home/jimmy/workspace/git/remake'
Makefile:1927: warning: overriding recipe for target 'ChangeLog'
Makefile:1594: warning: ignoring old recipe for target 'ChangeLog'
gcc  -Wall -Wextra -Wwrite-strings -Wshadow -Wpointer-arith -Wdeclaration-after-statement -Wbad-function-cast -Wformat-security -Wtype-limits -Wunused-but-set-parameter -Wlogical-op -Wignored-qualifiers  -g -O2 -Wl,--export-dynamic  -o make alloc.o ar.o arscan.o buildargv.o commands.o default.o debug.o dir.o expand.o file_basic.o file.o function.o getopt.o getopt1.o globals.o guile.o hash.o implicit.o job.o load.o loadapi.o main.o misc.o posixos.o profile.o print.o output.o read.o remake.o rule.o signame.o strcache.o trace.o variable.o version.o vpath.o remote-stub.o debugger/break.o debugger/cmd.o debugger/fns.o debugger/file2line.o debugger/msg.o debugger/stack.o glob/libglob.a   -ldl -lreadline  -lreadline
glob/libglob.a(glob.o): In function `glob_in_dir':
/home/jimmy/workspace/git/remake/glob/glob.c:1367: undefined reference to `__alloca'
/home/jimmy/workspace/git/remake/glob/glob.c:1342: undefined reference to `__alloca'
/home/jimmy/workspace/git/remake/glob/glob.c:1256: undefined reference to `__alloca'
/home/jimmy/workspace/git/remake/glob/glob.c:1283: undefined reference to `__alloca'
glob/libglob.a(glob.o): In function `glob':
/home/jimmy/workspace/git/remake/glob/glob.c:581: undefined reference to `__alloca'
glob/libglob.a(glob.o):/home/jimmy/workspace/git/remake/glob/glob.c:732: more undefined references to `__alloca' follow
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1364: make] Error 1
make[2]: Leaving directory '/home/jimmy/workspace/git/remake'
make[1]: *** [Makefile:915: all-recursive] Error 1
make[1]: Leaving directory '/home/jimmy/workspace/git/remake'
make: *** [Makefile:620: all] Error 2

Add remake --graph to show dependency graph

It would be very cool to be able to visualise all dependencies/prerequisites of a makefile. For example a ---graph switch which outputs a graphviz/dot file. There are a few perl scripts trying to do this but they fail for complex makefiles for me (which are the ones where it's needed the most). There is a make-profiler project which has this but unfortunately the project seems to be dormant so it would be cool if remake could adapt this feature (see https://github.com/eddyp/make-profiler).

archive test failures in remake 4.1-dbg1.1

Hi.

I'm seeing persistent test suite errors in the archive test. I'm at
remake-4.1+dbg-1.1:

 dima@shorty:~/debianstuff/remake/tests$ git describe --tags
 release-remake-4.1+dbg-1.1

Recipe:

  1. autoreconf -f -i

  2. ./configure --disable-nls

  3. make

  4. cd tests/; ./run_make_tests -make ../make features/archives

    dima@shorty:~/debianstuff/remake/tests$ ./run_make_tests -make ../make features/archives

            Running tests for GNU make on Linux shorty 4.6.1 x86_64
                              GNU Make 4.1+dbg1.0
    

    Clearing work...
    Making work dirs...

    features/archives ....................................... FAILED (3/10 passed)

    7 Tests in 1 Category Failed (See .diff* files in work dir for details) :-(

I can give you the differences, but first I'd like to confirm that this is
working for you. I'm on a fairly vanilla Debian/sid box.

Thanks

remake -xn isn't the same as remake -nx

remake -nx does perform a dry run; remake -xn does not.

The problem might seat between the keyboard and the chair, as I didn't extensively read the documentation (thus it could be intended behaviour, just unexpected for me); but I would expect them to perform the same.


System configuration

OS: Arch Linux
make: GNU Make 4.2.1
remake: GNU Make 4.2.1+dbg-1.4

Steps to reproduce

Example Makefile:

a:
	echo this was executed

Correct output

$ remake -nx
Reading makefiles...
Updating makefiles...
Updating goal targets...
 File 'a' does not exist.
Must remake target 'a'.
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Successfully remade target file 'a'.
$ remake --trace -n
Reading makefiles...
Updating makefiles...
Updating goal targets...
 File 'a' does not exist.
Must remake target 'a'.
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Successfully remade target file 'a'.
$ remake -x
Reading makefiles...
Updating makefiles...
Updating goal targets...
 File 'a' does not exist.
Must remake target 'a'.
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this was executed
Successfully remade target file 'a'.

Unexpected output

$ remake -xn
Makefile:2: target 'a' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo this was executed
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
this was executed

targets without dependencies on them are "interesting"

There is a --tasks option which shows "interesting" targets. The targets for which there is no dependency on them, i.e. are the roots of the dag of dependencies, are also interesting.

Either these should be added to --tasks and/or an option/suboption provided show or include these.

Pragma-like comment to suppress --warn-undefined-variables

--warn-undefined-variables is really useful, but some modules are relying on undefined variables being empty, and they generate the checks in thousands. Not always they can be rewritten.
In this cases, it would be beneficial to have a pragma-like comment to suppress the warning for some of lines.
grep-ing them out would only help if the code testing the variable is not in $(eval).

quit remake fail when debug Makefile of remake, is it a bug?


~/remake$ remake -X
Reading makefiles...
Updating makefiles....
-> (/home/galen_liu/remake/Makefile:620)
Makefile: Makefile.in config.status
================================================================================
remake<0> n
Updating goal targets....
 File `all' does not exist.
-- (/home/galen_liu/remake/Makefile:599)
all: config.h
================================================================================
remake<1> n
   Prerequisite 'stamp-h1' is newer than target 'config.h'.
  Must remake target 'config.h'.
Makefile:640: update target 'config.h' due to: stamp-h1
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
test -f config.h || rm -f stamp-h1
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
test -f config.h || remake  stamp-h1
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  Successfully remade target file 'config.h'.
Must remake target 'all'.
Makefile:600: update target 'all' due to: config.h
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
remake  all-recursive
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Reading makefiles...
Updating makefiles....
-> (/home/galen_liu/remake/Makefile:620)
Makefile: Makefile.in config.status
================================================================================
remake<<0>> n
Updating goal targets....
 File `all-recursive' does not exist.
-- (/home/galen_liu/remake/Makefile:879)
all-recursive: 
================================================================================
remake<<1>> n
Must remake target 'all-recursive'.
remake[1]: Entering directory '/home/galen_liu/remake'
Makefile:880: target 'all-recursive' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
fail=; \
if (target_option=k; case ${target_option-} in ?) ;; *) echo "am__make_running_with_option: internal error: invalid" "target option '${target_option-}' specified" >&2; exit 1;; esac; has_opt=no; sane_makeflags=$MAKEFLAGS; if test -n ' Makefile .deps/alloca.Po .deps/getloadavg.Po .deps/alloc.Po .deps/ar.Po .deps/arscan.Po .deps/buildargv.Po .deps/commands.Po .deps/debug.Po .deps/default.Po .deps/dir.Po .deps/expand.Po .deps/file.Po .deps/file_basic.Po .deps/function.Po .deps/getopt.Po .deps/getopt1.Po .deps/globals.Po .deps/guile.Po .deps/hash.Po .deps/implicit.Po .deps/job.Po .deps/load.Po .deps/loadapi.Po .deps/loadavg-getloadavg.Po .deps/main.Po .deps/misc.Po .deps/mock.Po .deps/output.Po .deps/print.Po .deps/profile.Po .deps/read.Po .deps/remake.Po .deps/remote-cstms.Po .deps/remote-stub.Po .deps/rule.Po .deps/signame.Po .deps/strcache.Po .deps/trace.Po .deps/variable.Po .deps/version.Po .deps/vmsjobs.Po .deps/vpath.Po debugger/.deps/break.Po debugger/.deps/cmd.Po debugger/.deps/file2line.Po debugger/.deps/fns.Po debugger/.deps/msg.Po debugger/.deps/stack.Po' && test -n '1'; then sane_makeflags=$MFLAGS; else case $MAKEFLAGS in *\\[\ \ ]*) bs=\\; sane_makeflags=`printf '%s\n' "$MAKEFLAGS" | sed "s/$bs$bs[$bs $bs   ]*//g"`;; esac; fi; skip_next=no; strip_trailopt () { flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`; }; for flg in $sane_makeflags; do test $skip_next = yes && { skip_next=no; continue; }; case $flg in *=*|--*) continue;; -*I) strip_trailopt 'I'; skip_next=yes;; -*I?*) strip_trailopt 'I';; -*O) strip_trailopt 'O'; skip_next=yes;; -*O?*) strip_trailopt 'O';; -*l) strip_trailopt 'l'; skip_next=yes;; -*l?*) strip_trailopt 'l';; -[dEDm]) skip_next=yes;; -[JT]) skip_next=yes;; esac; case $flg in *$target_option*) has_opt=yes; break;; esac; done; test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='glob config po doc w32 unittest' ;; \
  *) list='glob config po doc  unittest' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && remake  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  remake  "$target-am" || exit 1; \
fi; test -z "$fail"
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Making all in glob
Reading makefiles...
Updating makefiles....
-> (/home/galen_liu/remake/glob/Makefile:347)
Makefile: Makefile.in ../config.status
================================================================================
remake<<<0>>> q
remake: That's all, folks...
Makefile:880: recipe for target 'all-recursive' failed
Makefile:879: *** [all-recursive] Error 1

#0  all-recursive at /home/galen_liu/remake/Makefile:879

***Entering debugger because we encountered a fatal error.
** Exiting the debugger will exit make with exit code 1.
!! (/home/galen_liu/remake/Makefile:879)
all-recursive
================================================================================
remake<<2>> q
remake: That's all, folks...
remake[1]: *** Waiting for unfinished jobs....
remake[1]: *** wait: No child processes.  Stop.
Makefile:600: recipe for target 'all' failed
Makefile:599: *** [all] Error 2

#0  all at /home/galen_liu/remake/Makefile:599

***Entering debugger because we encountered a fatal error.
** Exiting the debugger will exit make with exit code 2.
!! (/home/galen_liu/remake/Makefile:599)
all
================================================================================
remake<2> q
remake: That's all, folks...
remake: *** Waiting for unfinished jobs....
remake: *** wait: No child processes.  Stop.
~/remake$ 

Debugger: "data breakpoints": break when the command executed matches a certain regex

I have a huge set of makefiles.
I need to find what creates a certain directory.
I would like to set a breakpoint that triggers:

  • when a command that matches .+mkdir.+problem_directory$ is executed.

The current breakpoints are useful when you know what file and line you want to stop at, but they cannot stop when a certain file is accessed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.