topological sort

2012-05-14 Thread Stefan Monnier
Some compilers/linkers care about the order in which the files are given to them. I currently have a build rule which takes a .depend file, massages it with a sed script and then passes it to `tsort', but I feel silly: `make' already has those dependencies at hand, and it knows very well how to do

Reactive make

2014-10-15 Thread Stefan Monnier
Is there some way to make "make" watch files (e.g. with `inotify') and automatically rebuild dependencies on an ongoing basis? Stefan ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make

Re: Command producing several targets at once

2017-07-29 Thread Stefan Monnier
> Another option if you don't like non-static pattern rules or the > special-case stuff involved, is to use a stamp file: > yaccouts.stamp: parser.mly > ocamlyacc $< IIUC a degenerate form of this is to decide that "parse.ml" plays the role of the stamp file, so you do parser.ml: par

How can I get `make` to look at the mtime of a symlink?

2017-08-06 Thread Stefan Monnier
I need to update some files whenever a symlink changes, even if the new target of the symlink is an old file. How can I do that with GNU Make? Stefan ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-mak

Re: How can I get `make` to look at the mtime of a symlink?

2017-08-06 Thread Stefan Monnier
>> I need to update some files whenever a symlink changes, even if the new >> target of the symlink is an old file. >> How can I do that with GNU Make? > See: >    -L, --check-symlink-times > Use the latest mtime between symlinks and target. Thanks. Is there a way to do it from

Re: How can I get `make` to look at the mtime of a symlink?

2017-08-06 Thread Stefan Monnier
> MAKEFLAGS += -L Ha! Stefan "Thanks!" ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make

How to debug my Makefile

2018-07-19 Thread Stefan Monnier
My `make` complains that make: execvp: /bin/sh: Argument list too long make: execvp: /bin/sh: Argument list too long but I'm having trouble figuring out which command's argument list is too long. I tried "make -d" but it doesn't really help: % LANG=C make -d GNU Make 4.2.1 B

Re: How to debug my Makefile

2018-07-20 Thread Stefan Monnier
> > Looking at the make file I see one $(shell ..) invocation which is the > > most likely culprit: > > > > define SET-diff > > $(shell echo "$(1)" "$(2)" "$(2)" | tr ' ' '\n' | sort | uniq -u) > > endef > > Could you use a standard Make rule to generate an output file, How coul

Re: How to debug my Makefile

2018-07-20 Thread Stefan Monnier
>> How could I generate an output file via a Make rule when the desired >> content of the file is in a Make variable that's too big for the >> command line? > > If you are using GNU make 4.0 or better you can use the $(file ...) > function to write to a file (there is no limit, other than memory, t

[Somewhat OFFTOPIC]: Alternatives to Make

2018-07-26 Thread Stefan Monnier
I'm using GNU Make here to keep some generated data files uptodate. In general, the kind of facility offered by GNU Make fits this purpose very well, but these files have all kinds of funny characters in their names (spaces, semi-colons, colons, you name it) and here I bump into lots and lots of

Re: gmake + unexec = fast!

2019-03-22 Thread Stefan Monnier
> On the hardware of the day, it took 30 seconds for GNU Make > 3.80 to read the files and issue the first build command. Do you have some idea of how those 30s were spent? > So then I took the "unexec" code from GNU Emacs, transplanted it into > GNU Make and hooked it to a "--dump" option. > Now

Compute dependencies from target name

2020-12-13 Thread Stefan Monnier
I'm trying to make a rule along the following lines: packages/%.tar.gz : $(shell find packages/% -name '*.el' -print | sed 's/\.el/.elc/') tar -zcf packages/$*.tar.gz packages/$* I expect the `%` which appears within the $(shell..) to be replaced with the target's stem, but tests i

Re: Compute dependencies from target name

2020-12-13 Thread Stefan Monnier
>> I'm trying to make a rule along the following lines: >> packages/%.tar.gz : $(shell find packages/% -name '*.el' -print | >> sed 's/\.el/.elc/') >> tar -zcf packages/$*.tar.gz packages/$* > I'd say this is wrongheaded, because you're saying that the materials > which belong to this pack

Re: MAKECMDGOALS and spaces

2021-02-20 Thread Stefan Monnier
> make, unfortunately it turns out, falls into that category for sure. `make` feel very deeply in that category, to the point where it's not just space, but several different characters and that it does not include the necessary quoting functionality to make it *possible* to deal with those charac

Re: `make -O` when non-parallel

2022-09-23 Thread Stefan Monnier
ut without having to buffer it until it ends. IIUC this might require a non-trivial restructuring :-( Stefan Paul Smith [2022-09-23 15:19:09] wrote: > On Fri, 2022-09-23 at 13:23 -0400, Stefan Monnier via Users list for > the GNU implementation of make wrote: >> I like the fac

Sane and general character esacping (was: Handling '=' in a filename together with $(eval ))

2025-02-14 Thread Stefan Monnier
>> Any hope to see a version of GNU Make that lifts those limitations, >> providing some sane way to handle any character in filenames (and >> ideally also able to sanely manipulate lists of such names)? > A number of years ago I proposed a way to deal with special characters. > You can find the st

Re: Gmake UTF-8 Support?

2021-10-01 Thread Stefan Monnier via Users list for the GNU implementation of make
> There is no issue. > The legal aspects of linking GPL software with MSVCRT.DLL have been > examined long ago, and the examination concluded that doing so is > perfectly kosher. I think you're talking at cross-purposes: you're talking about whether it's legally safe to link to this library, where

`make -O` when non-parallel

2022-09-23 Thread Stefan Monnier via Users list for the GNU implementation of make
I like the fact that `make -O` gives me output that's always meaningful, but it's sometimes annoying how it's sitting idly while a command is spewing output. To some extent it's unavoidable, but I wonder if we could reduce the inconvenience by making such that Make emits the subprocess's output wi

Re: Path prefix to src and targets

2023-05-31 Thread Stefan Monnier via Users list for the GNU implementation of make
> My attitude about GTP answers is that they're OK to post, AS LONG AS > you (the person who posts the answer) fully understands and agrees with > everything in the response. IMO, it's only OK to post if you clearly mark it as a citation (e.g. indented, marked with "> ", or something), *and* you c

Re: Dropping "call" operator?

2024-03-26 Thread Stefan Monnier via Users list for the GNU implementation of make
> Addendum, yes, directly via: > > define a b c > ... > endef > > as well as with embedded comma: > > define a b c, > ... > endef > > These can be referenced via $(a b c) and $(a b c,). Eww! Stefan

Re: Handling '=' in a filename together with $(eval )

2025-02-14 Thread Stefan Monnier via Users list for the GNU implementation of make
> Note I don't really recommend any of this. With the current > limitations of make, as defined by POSIX, it's just very difficult to Any hope to see a version of GNU Make that lifts those limitations, providing some sane way to handle any character in filenames (and ideally also able to sanely m