[PATCH] Implement "grouped targets" in ordinary rules.

2019-03-13 Thread Kaz Kylheku (gmake)
This patch (against 4.2.1) adds the + (plus) syntax: + tgt1 tgt2 ... tgtn : pre1 pre2 ... recipe When the + is present, then the targets are understood to be built together by one invocation of the recipe: each one lists the others in its "also_make" list, similarly to what multiple-ta

Re: [PATCH] Implement "grouped targets" in ordinary rules.

2019-03-13 Thread Kaz Kylheku (gmake)
On 2019-03-13 05:28, Paul Smith wrote: On Tue, 2019-03-12 at 20:50 -0700, Kaz Kylheku (gmake) wrote: This patch (against 4.2.1) adds the + (plus) syntax: + tgt1 tgt2 ... tgtn : pre1 pre2 ... recipe Hi Kaz; thanks very much for your interest in GNU make! This is a useful feature

Re: [PATCH] Implement "grouped targets" in ordinary rules.

2019-03-13 Thread Kaz Kylheku (gmake)
On 2019-03-13 12:50, Kaz Kylheku (gmake) wrote: Funny you should say that because I had a bug like this in a "first cut" at this, so I know exactly what you're talking about! Aha; I found obsolete text in one of my comments which likely inspired this suspicion: /* If the l

Re: [PATCH] Implement "grouped targets" in ordinary rules.

2019-03-14 Thread Kaz Kylheku (gmake)
On 2019-03-13 05:28, Paul Smith wrote: And finally, please remember that any feature representing this much work needs to have copyright assignment papers completed to assign changes to the FSF. I see you have assignments for GNU libc; let me know if you need me to send you details about this.

Re: gmake + unexec = fast!

2019-03-22 Thread Kaz Kylheku (gmake)
On 2019-03-22 12:07, Stefan Monnier wrote: 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? No detailed breakdown; just reading per-directory make include files, and perform

Re: Conditionally executing a script and using return value

2019-04-11 Thread Kaz Kylheku (gmake)
On 2019-04-11 03:04, Thomas Nyberg wrote: Hello, I would like my Makefile to: 1. Check if a variable is set to specific value, 2. If it is, execute a script and get its return value, 3. Stop executing Makefile depending upon return value. Here is the Makefile I have: `Makefile` --

Re: Turning warning into errors

2019-05-02 Thread Kaz Kylheku (gmake)
On 2019-05-02 18:31, Sébastien Hinderer wrote: Dear Duane, Many thanks for your response! You are right, the code is rather straightforward and at the same time I find it clever! In particular, I like the fact that, because of the options you are using, you don't need to use grep to figure ou

Re: Dependencies for clean rule

2019-07-15 Thread Kaz Kylheku (gmake)
On 2019-07-15 12:55, Erik Rull wrote: Hi all, I have several targets that depend on each other. For cleaning them up, I have to take care that the clean dependencies are just the other way round. No, you don't have to, actually. There is no concept of dependencies in cleaning. Cleaning mean

Re: Dependencies for clean rule

2019-07-17 Thread Kaz Kylheku (gmake)
On 2019-07-17 04:17, Christian Hujer wrote: 2. Use $(RM) instead of rm For removing files, use $(RM). It is more portable, and it expands to rm -f, not just rm. So you don't have to worry about files that do not exist. By the time we reach the level of portability where we are worried about n

Re: VPATH and include

2019-08-28 Thread Kaz Kylheku (gmake)
On 2019-08-28 06:21, Sébastien Hinderer wrote: Dear friends, Trying to use the VPATH variable, it seems to me that it is not taken into account by the include directive. That kind of makes sense because VPATH is for searching for prerequisites; included makefiles are not the prerequisites of

Re: target override only if there is a recipe for it?

2019-08-30 Thread Kaz Kylheku (gmake)
On 2019-08-30 06:24, Brian J. Murrell wrote: I am trying to override a target that has a general definition in an included Makefile with a more specific one. But it seems that the override only happens if the overriding target has a recipe? Overriding targets isn't a concept in make; it can ha

Re: GNU Make 4.2 Query

2019-09-01 Thread Kaz Kylheku (gmake)
Hi nihkil, Try using a "macro": # $(1) is retry count: integer constant in shell test syntax # $(2) is command # define retry-times i=0; while [ $$i -lt $(1) ]; do ($(2)) && exit 0; i=$$(( i + 1 )); done ; exit 1 endef target: prerequisite $(call retry-times,5,your command here) Fixed r

Re: GNU Make 4.2 Query

2019-09-01 Thread Kaz Kylheku (gmake)
On 2019-09-01 23:04, nikhil jain wrote: Hi, Thanks for your reply. Actually, this is not possible in my case. The builds are run by the R&D teams who are using legacy GNUmakefile. So, I can't force them to change their way and there are around 10k+ commands in a makefile. I would rather imple

Re: Multiple Types of Pattern Matching in Make

2019-09-26 Thread Kaz Kylheku (gmake)
On 2019-09-26 07:50, Rahul Rameshbabu wrote: Let's say I write the following Makefile target as an example. %dependencies.out: %dependencies.config # Recipe would be here to create the target from the config... In this case, I think we could work around it like this: %ependencies.out: %epende

Re: GMAKE 3.81 vs GMAKE 4.2

2019-09-27 Thread Kaz Kylheku (gmake)
On 2019-09-27 13:23, nikhil jain wrote: Please reply. It is urgent for me to provide a Correct compiled product to my users. I do not want to switch back to 3.81. Could this be related to parallelization with "-j "? If you put a .NOTPARALLEL: declaration at the top of your Makefile, does t

Re: GMAKE 3.81 vs GMAKE 4.2

2019-09-30 Thread Kaz Kylheku (gmake)
On 2019-09-30 01:21, nikhil jain wrote: Hi Tony, 1) I always set -j 4. 2) No, I do not set -l flag. 3) The BUILD never fails. The binary which is generated causes segmentation fault. It works perfectly If I build in 3.81 GMAKE. Possibly, what is going on that you have some $(wildcard ...) ma

Re: GMAKE 3.81 vs GMAKE 4.2

2019-10-03 Thread Kaz Kylheku (gmake)
On 2019-10-03 19:06, nikhil jain wrote: Just to confirm - My build works with all the make versions. It's the binary which fails. Then, I think, perhaps it would be good to avoid phrasing like "build fails". Clearly, that is the opposite of "build works" that you're using here. With 3.81, ve

Re: not sure about value of "$(lastword $(MAKEFILE_LIST))" in this example

2019-10-15 Thread Kaz Kylheku (gmake)
On 2019-10-15 08:59, Robert P. J. Day wrote: i'm not sure what to make of this since there is only one Makefile in play in this directory, and the docker container has its working directory set to this directory, and all of the targets being invoked are defined in the same Makefile. It allows t

Re: not sure about value of "$(lastword $(MAKEFILE_LIST))" in this example

2019-10-15 Thread Kaz Kylheku (gmake)
On 2019-10-15 10:06, Robert P. J. Day wrote: On Tue, 15 Oct 2019, Kaz Kylheku (gmake) wrote: On 2019-10-15 08:59, Robert P. J. Day wrote: > i'm not sure what to make of this since there is only one Makefile > in play in this directory, and the docker container has its > working

Re: simple explanation for order-only prerequisite?

2019-11-04 Thread Kaz Kylheku (gmake)
On 2019-11-03 06:50, Robert P. J. Day wrote: was asked on friday by a make newbie to explain order-only prerequisite (OOP), as he was reading the explanation in the manual and was having trouble getting a fix on what it really meant. When we specify that P is an order-only prerequisite for T,

Re: Dumb Questions

2019-11-11 Thread Kaz Kylheku (gmake)
On 2019-11-10 23:18, Lee Eric wrote: Hi, New to Make and after reading some pages from the GNU Make book I'm confused about some explanations. 1. From the O'Reilly book it mentions "Normally, phony targets will be always be executed ...". I don't quite follow it as "clean" is a typical phony ta

Re: I want to port make on Windows using tcc compiler

2020-01-22 Thread Kaz Kylheku (gmake)
On 2020-01-22 05:38, Christian Jullien wrote: To provide a complete working C toolchain, it lacks a 'make' utility as with other unix like systems. Don't forget that make recipes are written in shell (by default; there is a SHELL variable). So if you compile make successfully, but haven't p

Re: looking for assistance with "parallel" makefile, willing to pay

2020-02-25 Thread Kaz Kylheku (gmake)
On 2020-02-25 15:45, Robert P. J. Day wrote: if someone wants to isolate the problem and fix it, i'd be a happy camper as i have lots of other stuff to work on. thoughts? If multiple targets in the top-level makefile are recursively invoking make in src/pi/protos, running the install targe

Re: Evaluating a variable only once after a recipe has run

2020-04-18 Thread Kaz Kylheku (gmake)
On 2020-04-18 05:55, R. Diez wrote: Even if it were available, you would not want to run expensive shell commands to define a variable that is actually never used if the user did not specify a makefile target that needs it. I will rephrase the question just in case it is not clear. I want GNU Ma

Re: Flag --no-builtin-rules etc. just for this makefile (no flag inheritance)

2020-04-18 Thread Kaz Kylheku (gmake)
On 2020-04-18 06:27, R. Diez wrote: There is a catch, though: those flags are inherited over environment variable MAKEFLAGS. So I have to manually filter them out when calling submakefiles. MAKEFLAGS is actually the solution. You can *add* to it and the flags take effect. Therefore, it wou

Re: Evaluating a variable only once after a recipe has run

2020-04-18 Thread Kaz Kylheku (gmake)
On 2020-04-18 06:52, R. Diez wrote: Instead of trying to uses the execution of a target recipe to try to calculate this optimized variable (which isn't how make works, and will likely be fruitless) you can calculate it using a conditional expression which looks for the presence of that target in

Re: Flag --no-builtin-rules etc. just for this makefile (no flag inheritance)

2020-04-20 Thread Kaz Kylheku (gmake)
On 2020-04-20 03:04, R. Diez wrote: Hallo Paul: I have been investigating Kaz Kylheku's suggestion about adding flags to MAKEFLAGS inside the makefile. I believe that adding --no-builtin-variables has no effect. It is probably too late to do that inside the makefile. That means that option '--

Re: Flag --no-builtin-rules etc. just for this makefile (no flag inheritance)

2020-04-20 Thread Kaz Kylheku (gmake)
On 2020-04-20 09:18, R. Diez wrote: It can be verified with a minimal Makefile that "make --print-data-base" shows an absence of built-in rules if MAKEFLAGS += --no-builtin-rules is present, and likewise that --no-builtin-variables causes the variables to disappear. [...] Well, let's verify i

Re: Pattern rules with % matching empty string?

2020-04-24 Thread Kaz Kylheku (gmake)
On 2020-04-24 14:39, Paul Smith wrote: On Fri, 2020-04-24 at 12:15 +0800, Glen Huang wrote: remote-bin-host%: bin scp $< host$*:$< touch $@ to update files in remote hosts. It works for remote-bin-host1, remote-bin-host2, etc, but not remote- bin-host. It seems % won’t match em

Re: Pattern rules with % matching empty string?

2020-04-24 Thread Kaz Kylheku (gmake)
On 2020-04-24 21:56, Kaz Kylheku (gmake) wrote: And a fourth option: keep the host names inconsistent (they are probably hard to change) but enumerate them with consistently named stamp files (easy to control). Use computed variable names to associate the two together: remote-bin-host%: bin

Re:

2020-06-16 Thread Kaz Kylheku (gmake)
On 2020-06-15 16:53, Budi wrote: How can we have make's 'include' command in makefile not to precede the first/default target in the actual processes? I found it always processed the earliest, how to solve this? E.g. in Vi type "dd" on the include line, move the cursor somewhere below the first

Re:

2020-06-16 Thread Kaz Kylheku (gmake)
On 2020-06-16 17:34, Budi wrote: like was said How can we have make's 'include' command in makefile not to precede the first/default target in the actual processes in https://github.com/mcostalba/Stockfish/blob/master/src/Makefile the famous chess engine I only see one include and it's at the

Re: Change multiple string on a pattern, within a file which will be included

2020-06-19 Thread Kaz Kylheku (gmake)
On 2020-06-19 03:08, Budi wrote: Is there a way to change multiple string on a pattern, within a file which will be included in makefile preferably in one command line only, so it'll be ready included in makefile in the edited content Include files are makefiles; they have to contain make synta

Re: GNU Make on Windows

2020-08-01 Thread Kaz Kylheku (gmake)
On 2020-07-31 08:45, Sarah Toth wrote: Hi there, I'm trying to install GNU Make on my windows OS because it is a required dependency of elevation 1.0.6 . This project assumes a Unix (possibly even Linux). Look at this statement on their main page: "GNU

Re: Building some targets serially, others in parallel

2020-08-22 Thread Kaz Kylheku (gmake)
On 2020-08-22 13:46, dan soucy wrote: takes longer than running `make` serially. However, if the object files are already built, then `server`, `client`, and `demo` can be built faster in parallel. I don't see the big problem here other than the need to represent the shared object files as i

Re: Running one Makefile from another in an "isolated" way

2020-10-27 Thread Kaz Kylheku (gmake)
On 2020-10-27 03:56, Nikolay Shaplov wrote: My guess is that make have tendency to work in "recusive" way remembering variables or something else across the runs. But here I need to make and isolated run, so parent make session were isolated from child one. How can I do this? Hi Nikolay, On

Re: Running one Makefile from another in an "isolated" way

2020-10-28 Thread Kaz Kylheku (gmake)
On 2020-10-28 03:14, Nikolay Shaplov wrote: Thanx, Kaz Kylheku, after you mail I noted that I've explored this ENV problem with `export` command, but I should do it with `env` as you suggested. Using env, I came to the sane conclusion as Philip Guenther (thank you too) that the cause of all m

Re: Confusion on: all: all-yes

2020-11-17 Thread Kaz Kylheku (gmake)
On 2020-11-17 02:49, Budi wrote: I found in a Makefile the default target: all: all-yes but the text editor search won't find all-yes except in .PHONY How is it explained ? Maybe the yes part comes from a variable, like all-$(VAR). Search for just "all-" or "all". E.g.: all-$(VAR): a b c

Re: Confusion on: all: all-yes

2020-11-17 Thread Kaz Kylheku (gmake)
On 2020-11-17 14:40, Budi wrote: not found on included files, please help me out explain of the attached one Hi Budi, I found it here: http://git.videolan.org/?p=ffmpeg.git;a=tree You could just have pointed everyone to that! Grep is disabled on that giweb, but in ffbuild/library.mak, I man

Re: Make 4.3 rebuilds .o files when unnecessary

2020-11-18 Thread Kaz Kylheku (gmake)
On 2020-11-18 11:04, Paul Smith wrote: On Wed, 2020-11-18 at 16:38 +0100, Tommaso Fonda wrote: The best way to do that is first, reduce the problem as much as possible; for example see if you can pass arguments to make so that it builds just one object file (the equivalent of "make foo.o" for exa

Re: Make 4.3 rebuilds .o files when unnecessary

2020-11-18 Thread Kaz Kylheku (gmake)
On 2020-11-18 16:10, Kaz Kylheku (gmake) wrote: I regularly build the kernel as part of my work; I will build GNU Make 4.3 from sources and see if this reproduces. I gave this a quick try; I built 4.3 under Ubuntu 18.04, from the release tarball, and mapped it into the Docker container where

Re: Make 4.3 rebuilds .o files when unnecessary

2020-11-20 Thread Kaz Kylheku (gmake)
On 2020-11-19 23:58, Tommaso Fonda wrote: > The kernel tree I'm working on is much, much older than yours (it's Linux > 3.4!)... > Given it's not a make-related problem, I guess it's a problem with Linux > 3.4's general Makefile & build system. I'll have to stick to make 4.2, > however I'l

Re: Make 4.3 rebuilds .o files when unnecessary

2020-11-22 Thread Kaz Kylheku (gmake)
On 2020-11-22 10:25, Tommaso Fonda wrote: > Also, I've built make from source and I'm close to finding the commit that > introduced the issue. For now, I can say that setting the repo's HEAD to > commit: > b13dcfe Add more GCC warnings to the maintainer build. > produces a make binary that

Re: Make 4.3 rebuilds .o files when unnecessary

2020-11-25 Thread Kaz Kylheku (gmake)
On 2020-11-25 02:28, Tommaso Fonda wrote: > Thank you for the small tutorial. I've managed to find the commit that > introduces the issue! It's this one: > https://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b576b907b06aea5f4 > [1] > What happens now? Thus, it loo

Re: Compute dependencies from target name

2020-12-13 Thread Kaz Kylheku (gmake)
On 2020-12-12 20:40, Stefan Monnier wrote: 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

Re: Compute dependencies from target name

2020-12-13 Thread Kaz Kylheku (gmake)
On 2020-12-13 13:06, Stefan Monnier wrote: 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 ma

Re: multi-line message to $(error )

2020-12-16 Thread Kaz Kylheku (gmake)
On 2020-12-16 01:50, Sébastien Hinderer wrote: Masahiro Yamada (2020/12/16 18:45 +0900): In hindsight, the preceding *** is a bit unfortunate (I do not see it for $(warning) ) but this works. Perhaps you could use the info function to print your message and then callthe error one with an empty

Re: LIBS or LDLIBS ?

2021-01-14 Thread Kaz Kylheku (gmake)
On 2021-01-14 02:45, Sébastien Hinderer wrote: Dear autoconf and make users, I suspect mailing list cross-posting doesn't work well in an age in which mailing lists don't accept postings from non-subscribers due to the spam problem. Your question reaches people who are subscribed only to one o

Re: FEATURE:? binding variables to prerequisites

2021-01-22 Thread Kaz Kylheku (gmake)
On 2021-01-22 13:18, Cook, Malcolm wrote: Hi Paul et. al., When a rule has multiple prerequisites I sometimes use make variables to refer to them positionally, like this: ^1=$(word 1,$^) ^2=$(word 2,$^) ^3=$(word 3,$^) ^2..=$(wordlist 2,$(words $^),$^) ^3..=$(wordlist 3,$(words $^),$^) %.foo:

Re: MAKECMDGOALS

2021-02-01 Thread Kaz Kylheku (gmake)
On 2021-02-01 06:17, Paul Smith wrote: On Mon, 2021-02-01 at 11:49 +0100, Sébastien Hinderer wrote: 'Make' will set the special variable 'MAKECMDGOALS' to the list of goals you specified on the command line. If no goals were given on the command line, this variable is empty. If I defi

Re: MAKECMDGOALS

2021-02-01 Thread Kaz Kylheku (gmake)
On 2021-02-01 08:34, Sébastien Hinderer wrote: Yeah, ignoring builtin variables makes sense to me, too! But the problem is that when no goals are specified at run-time, then in that situation the variable is not built-in. GNU Make should probably not implement a concept of "this variable is bu

Re: MAKECMDGOALS and spaces

2021-02-13 Thread Kaz Kylheku (gmake)
On 2021-02-13 10:35, Christof Warlich wrote: Hi, please consider this Maklefile: $(MAKECMDGOALS):; echo "Goals: $(MAKECMDGOALS)" For each goal being passed, it prints the list of all goals, e.g.: $ make hi ho echo "Goals: hi ho" Goals: hi ho echo "Goals: hi ho" Goals: hi ho But it fails when

Re: MAKECMDGOALS and spaces

2021-02-13 Thread Kaz Kylheku (gmake)
On 2021-02-13 13:13, Christof Warlich wrote: Kaz Kylheku wrote: I think to make use of this, you need to define a target that has a space. It seems this is possible as follows   hi\ ho:   [tab]echo yes Then make "hi ho" runs the recipe and "yes" is echoed. In order to do this with a generat

Re: MAKECMDGOALS and spaces

2021-02-17 Thread Kaz Kylheku (gmake)
On 2021-02-17 09:35, Sébastien Hinderer wrote: Hello, Kaz Kylheku (gmake) (2021/02/13 11:44 -0800): Pardon the pontificating, but 've never worked with or seen a Makefile that had spaces in a target name; that kind of thing is best avoided. I don't like spaces especially, eith

Re: use of hyphen in recipes to ignore errors precludes using -- as comment character

2021-02-20 Thread Kaz Kylheku (gmake)
On 2021-02-19 21:12, Cook, Malcolm wrote: Gnu manual reads: To ignore errors in a recipe line, write a '-' at the beginning of the line's text (after the initial tab)... I think it would be good if the implementation changed to allow instead To ignore errors in a recipe line, w

RE: use of hyphen in recipes to ignore errors precludes using -- as comment character

2021-02-21 Thread Kaz Kylheku (gmake)
On 2021-02-21 22:52, Cook, Malcolm wrote: On 2021-02-19 21:12, Cook, Malcolm wrote: Gnu manual reads: To ignore errors in a recipe line, write a '-' at the beginning of the line's text (after the initial tab)... I think it would be good if the implementation changed to allow instead To igno

Re: Q: How to delete all out of date targets

2021-03-09 Thread Kaz Kylheku (gmake)
On 2021-03-08 21:10, Cook, Malcolm wrote: Hi, Is it possible using Gnu Make to delete all out of date targets? We can do this using text processing around the output of the -d option, together with a dry run -n. The verbose -d output has the information about out of date targets. Example run

Re: Mixing grouped explicit targets rule with static pattern rule

2021-03-22 Thread Kaz Kylheku (gmake)
On 2021-03-22 09:21, Nithish Chandran wrote: I tried using grouped targets with pattern rules which worked. But like you said this would defeat the purpose of advanced dependency generation. %.o %.d &: %.c g++ -c $< -o $@ -MMD -MF $*.d -MP -MT $*.o Hi, I'm the person who initially implemen

Re: Lint for Makefiles

2021-04-02 Thread Kaz Kylheku (gmake)
On 2021-04-02 00:55, Christian Hujer wrote: Hello everyone. I was looking for a Lint-like tool for Makefiles. The ones I could find either seemed abandoned (like mint) or had a broken build (checkmake) and other fundamental flaws (not operating on included Makefiles). I hope to get some response

Re: solution to depend on cached set of variable values

2021-04-11 Thread Kaz Kylheku (gmake)
On 2021-04-11 11:38, Britton Kerin wrote: I've got vars like DEBUG_ENABLE only a big hairy pile of them at this point, and I want make to rebuild everything when I give a different set of them (including via command line) with my having to remember to do clean first. I can see how it might be do

Re: Lint for Makefiles

2021-04-12 Thread Kaz Kylheku (gmake)
On 2021-04-02 11:50, Christian Hujer wrote: Hey Kaz, thanks for pointing that out. I was primarily interested in GNU Makefiles only, but it's always good to have a broader perspective to make the tool more useful for others. If I'm not mistaken, `$(RM)` doesn't always expand to `rm -f` but to s

Re: Double colon rules with phony prerequisites

2021-04-27 Thread Kaz Kylheku (gmake)
On 2021-04-27 07:32, Fogle, Benjamin wrote: Hello, I have a large project that includes libraries in Rust as dependencies. I want to run “cargo build” unconditionally, so it should use a phony target, but I only want to rebuild downstream binaries if a library actually changed. I found that doub

Re: Double colon rules with phony prerequisites

2021-05-06 Thread Kaz Kylheku (gmake)
On 2021-05-06 06:15, Benjamin Fogle wrote: Oh, I see. I misinterpreted the docs: Phony targets shouldn't be _direct_ dependencies of real files, but indirect dependencies work as expected. I'm glad that this wasn't some obscure behavior I was relying on. The "needs update" dependency relationsh

RE: how to: write a rule which expands the contents of an arbitrary text file?

2021-05-14 Thread Kaz Kylheku (gmake)
On 2021-05-14 11:46, Cook, Malcolm wrote: So I hit too soon... I would to be able to expand Gnu make variables and macros appearing in a text file using values of .VARIABLES in the current execution environment. This in effect is using Gnu make as a kind of [Template processor](https://en.w

Re: Make does not clean up the target when stderr is piped. Why?

2021-06-04 Thread Kaz Kylheku (gmake)
On 2021-06-04 05:57, Paul Smith wrote: On Fri, 2021-06-04 at 12:31 +0900, Masahiro Yamada wrote: GNU Make cleans up partially updated targets if the user interrupts before the build rules complete. If GNU Make does not do this, they will not be updated in the next run of 'make' because their ti

Re: Make does not clean up the target when stderr is piped. Why?

2021-06-05 Thread Kaz Kylheku (gmake)
On 2021-06-05 07:00, Masahiro Yamada wrote: make 2>&1 | tee build.log is a very common use case, and people often miss to add (trap "" 2; ...), I think. Hi Masahiro, tee has a -i option to ignore the SIGINT signal. This is even specified by POSIX! Might that help in this specific scenario

Re: Questions about signal handling in GNU Make

2021-07-23 Thread Kaz Kylheku (gmake)
On 2021-07-23 09:48, Masahiro Yamada wrote: Hi. GNU Make deletes partially updated target files when it is interrupted. Yes, unless the targets are mentioned in the .PRECIOUS: special target. The description of PRECIOUS leads to the documentation section "Interrupting or Killing 'make'" whic

Re: Questions about signal handling in GNU Make

2021-07-23 Thread Kaz Kylheku (gmake)
On 2021-07-23 14:19, Kaz Kylheku (gmake) wrote: Secondly, build tools which open a file more than once should not specify O_CREAT for the second and subsequent times. The second and subsequent opens should expect the file to exist, and fail otherwise. Unfortunately, this is too naive, I

Re: Questions about signal handling in GNU Make

2021-07-24 Thread Kaz Kylheku (gmake)
On 2021-07-24 06:21, Masahiro Yamada wrote: To avoid the race on the tool side, as you mentioned, we can write to a tmpfile, and rename it as a last step. But, no we can't! This situation is not a problem only in the case when the recipe has one step to perform. What if it is like this? o

Re: suppressing $ resolution in variable value

2021-09-02 Thread Kaz Kylheku (gmake)
On 2021-09-02 09:14, David Boyce wrote: I found this an interesting problem so took a little time from the day job to look into it. There are a number of issues here. First, not directly related but environment variables are supposed to be uppercase by convention though it's not enforced. Hi D

Re: The -e option confuses the $(origin ) ?

2021-09-13 Thread Kaz Kylheku (gmake)
On 2021-09-13 00:28, Masahiro Yamada wrote: masahiro@oscar:~/workspace/foo$ export FOO=2 masahiro@oscar:~/workspace/foo$ make Makefile:1: the origin of FOO is: environment Makefile:2: the value of FOO is: 2 make -e -f Makefile.sub1 FOO=1 Note that this FOO=1 will be exported to the environment.

Re: The -e option confuses the $(origin ) ?

2021-09-13 Thread Kaz Kylheku (gmake)
On 2021-09-13 06:16, Masahiro Yamada wrote: On Mon, Sep 13, 2021 at 9:23 PM Kaz Kylheku (gmake) <729-670-0...@kylheku.com> wrote: On 2021-09-13 00:28, Masahiro Yamada wrote: > masahiro@oscar:~/workspace/foo$ export FOO=2 > masahiro@oscar:~/workspace/foo$ make > Makefile:1: the o

Re: The -e option confuses the $(origin ) ?

2021-09-13 Thread Kaz Kylheku (gmake)
On 2021-09-13 07:16, Kaz Kylheku (gmake) wrote: It looks like -e is some sort of experimental hack with mysterious effects that is under-documented on purpose, with a warning not to use it. Except, oops, POSIX specifies this option. POSIX does not say that using -e is "not recommended

Re: Gmake UTF-8 Support?

2021-09-29 Thread Kaz Kylheku (gmake)
On 2021-09-29 08:52, Jon Forrest wrote: I'm curious whether gmake supports UTF-8 in Makefiles. I did some googling and saw one report that it did but I grepped the source code and only found a couple of references to UTF-8. One was looking for the UTF-8 BOM at the beginning of input files, and th

Re: Gmake UTF-8 Support?

2021-09-29 Thread Kaz Kylheku (gmake)
On 2021-09-29 09:31, Eli Zaretskii wrote: Date: Wed, 29 Sep 2021 09:23:32 -0700 From: "Kaz Kylheku (gmake)" <729-670-0...@kylheku.com> Cc: help-make@gnu.org If the program allows bytes in the range 0x80 to 0xFF to be parts of identifiers then you can use Unicode characters in

Re: Gmake UTF-8 Support?

2021-09-29 Thread Kaz Kylheku (gmake)
On 2021-09-29 10:48, Eli Zaretskii wrote: Date: Wed, 29 Sep 2021 10:06:22 -0700 From: "Kaz Kylheku (gmake)" <729-670-0...@kylheku.com> Cc: nob...@gmail.com, help-make@gnu.org > I think the underlying OS also must support UTF-8 encoded file names > (or be agnostic to fil

Re: Gmake UTF-8 Support?

2021-09-29 Thread Kaz Kylheku (gmake)
On 2021-09-29 11:34, Eli Zaretskii wrote: Date: Wed, 29 Sep 2021 11:15:40 -0700 From: "Kaz Kylheku (gmake)" <729-670-0...@kylheku.com> Cc: nob...@gmail.com, help-make@gnu.org > Cygwin is not MS-Windows, it provides a rich layer of Posix > functionality, including UTF-8

Re: Gmake UTF-8 Support?

2021-09-30 Thread Kaz Kylheku (gmake)
On 2021-09-30 00:37, Eli Zaretskii wrote: Date: Wed, 29 Sep 2021 12:43:57 -0700 From: "Kaz Kylheku (gmake)" <729-670-0...@kylheku.com> There is no documented requirement anywhere about what is in this library, or what will be in it in the next version of Windows, or whether it w

Re: Gmake UTF-8 Support?

2021-10-01 Thread Kaz Kylheku (gmake)
On 2021-10-01 08:48, Eli Zaretskii wrote: Date: Fri, 01 Oct 2021 10:42:21 -0400 From: 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

Re: Gmake UTF-8 Support?

2021-10-01 Thread Kaz Kylheku (gmake)
On 2021-10-01 08:58, Eli Zaretskii wrote: From: Dan Kegel Date: Fri, 1 Oct 2021 08:11:53 -0700 Cc: help-make@gnu.org https://developercommunity.visualstudio.com/t/create-a-utf8-c-runtime/351432 has some info from 2020 about utf-8 locale support in recent builds of windows. Yes, I know. But n

Re: Hierarchical building

2021-12-02 Thread Kaz Kylheku (gmake)
On 2021-12-02 09:12, Ian Molton wrote: indeed, I'm finding it hard to understand the placement of anything in a makefile - they seem to be processed from top to bottom, but "not always", and its not obvious how. Makefiles are programs. Like C, Javascript, Fortran or Shell, they are generally r

Re: Makefile idiom for referencing URL sources

2021-12-16 Thread Kaz Kylheku (gmake)
On 2021-12-16 11:17, Johnson, Richard wrote: Hi Alll-- I have a Linux project that builds against URL dependencies. Make itself does not recognize URL resources and the ':' in the URL naming scheme is problematic. I'd want this to cache the remote materials locally, and check their cryptogr

Re: irregularities with --no-builtin-variables

2021-12-30 Thread Kaz Kylheku (gmake)
On 2021-12-27 19:30, Paul Smith wrote: On Sun, 2021-12-26 at 04:46 +0100, Reto wrote: Is this a bug or am I missing something from the docs? The -r and -R options don't take effect until the makefiles are all parsed. By the way, how is that to be understood? Because if I, say, expand RM usi

Re: make-rc: A parallel (as in make(1)) alternative to sysv-rc

2022-01-08 Thread Kaz Kylheku (gmake)
On 2022-01-08 03:43, mirabilos wrote: Bah. How often do you boot a unix? Boot time optimization is very important in some embedded applications. A powered-up device is expected to come into service ASAP basically. Some devices are powered up every time whatever they are embedded into is power

Re: Rename positional parameters in customized GNU make functions to enhance readability and maintainability.

2022-01-21 Thread Kaz Kylheku (gmake)
On 2022-01-21 02:34, Hongyi Zhao wrote: I try to redefine the download_and_unpack function used here [1] as follows: ``` define download_and_unpack @package := $(1) ^ What is that? Is this supposed to be the echo suppressing character used in recipe lines? You seem to have a misconce

Re: Running specific part of a Makefile under a specific shell

2022-02-10 Thread Kaz Kylheku (gmake)
On 2022-02-10 15:15, peter0x44 wrote: Hi all, I have a Makefile that is intended for running under both Windows and Linux, for the raylib library. https://github.com/raysan5/raylib/blob/master/src/Makefile This Makefile, under Windows, for the `make clean` target uses the del builtin command of