Hi Richard,
> On 28 Oct 2023, at 00:12, Richard Cochran <richardcoch...@gmail.com> wrote: > > On Thu, Oct 26, 2023 at 08:41:08AM +0000, Luca Fancellu wrote: >> Any thought about this? > > For the sake of consistency, can you please implement something like > this instead? > > commit d3dd51ba611802d7cbb28631cb943cb882fa4aac > Author: Changqing Li <changqing...@windriver.com> > Date: Wed Nov 23 08:23:46 2022 +0800 > > makefile: use conditional assignment for KBUILD_OUTPUT > > Refer [1],from make 4.4, all variables that are marked as export will > also be passed to the shell started by the shell function. use "=" will > make KBUILD_OUTPUT always empty for shell function, use "?=" to make > "export KBUILD_OUTPUT" in enrironment can work. > > [snip of 4.4 NEWS] > * WARNING: Backward-incompatibility! > Previously makefile variables marked as export were not exported to > commands > started by the $(shell ...) function. Now, all exported variables are > exported to $(shell ...). > [snip] This is what I’ve tried: Makefile: ------------------------------------------------------------ CC ?= $(CROSS_COMPILE)gcc srcdir := $(dir $(lastword $(MAKEFILE_LIST))) incdefs := $(shell $(srcdir)/script.sh) all: $(info ************ TEST VERSION ************) $(info $(incdefs)) $(info CC: $(CC)) .PHONY: all ------------------------------------------------------------ script.sh: ------------------------------------------------------------ #!/bin/sh echo "from the script: $CC” ------------------------------------------------------------ This is what I get: $ export CC=environment $ make all ************ TEST VERSION ************ from the script: environment CC: environment make: Nothing to be done for 'all'. $ make CC=override all ************ TEST VERSION ************ from the script: environment CC: override make: Nothing to be done for 'all’. So if you are asking me to use ?= instead of passing the $(CC) to the script, It seems to me that it doesn’t work as we could have discrepancies. Can you please clarify what changes do you expect me to implement? A diff could be better, or just push a patch on top of mine if needed. Cheers, Luca IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel