Re: .SECONDEXPANSION problems

2021-12-13 Thread Paul Smith
On Sun, 2021-12-12 at 20:35 -0500, Dmitry Goncharov wrote:
> On Sun, Dec 12, 2021 at 2:15 PM Paul Smith  wrote:
> > Did something happen when it stopped working, like you updated to a
> > different version of GNU make?
> 
> i bet this make is built from the current git.

Thanks Dmitry.  I was fooled by the "since some time" text which made
it sound like this started happening quite a while ago.




Re: .SECONDEXPANSION problems

2021-12-13 Thread Gisle Vanem

Dmitry Goncharov wrote:


On Sun, Dec 12, 2021 at 2:15 PM Paul Smith  wrote:

Did something happen when it stopped working, like you updated to a
different version of GNU make?


i bet this make is built from the current git.


Correct.


Thanks for your report.
If you need make from git you should apply
https://savannah.gnu.org/bugs/download.php?file_id=52483
and
https://savannah.gnu.org/bugs/download.php?file_id=52489


After applying those 2 patches and rebuilding, my
makefile with '.SECONDEXPANDSION' now seems to work
fine! Thanks a lot.



regards, Dmitry



--
--gv



Re: .SECONDEXPANSION problems

2021-12-12 Thread Dmitry Goncharov
On Sun, Dec 12, 2021 at 2:15 PM Paul Smith  wrote:
> Did something happen when it stopped working, like you updated to a
> different version of GNU make?

i bet this make is built from the current git.

> Can you create a small, self-contained example that shows the problem you're 
> seeing?

i don't think this is related to second expansion. This is about
target specific variables of intermediate files.
here is an example which reproduces the problem.

all: hello.tsk
%.tsk: hello.x; $(info $@)
%.x:; $(flags)
hello.x: flags:=true

i posted a detailed description here
https://savannah.gnu.org/bugs/?48643#comment28.

On Thu, Dec 9, 2021 at 6:26 AM Gisle Vanem  wrote:
> My problem is that 'EXTRA_CFLAGS' is NOT picked up by
> the above pattern compile rule when the .SECONDEXPANSION
> rule is used. This used to work for sure.

Thanks for your report.
If you need make from git you should apply
https://savannah.gnu.org/bugs/download.php?file_id=52483
and
https://savannah.gnu.org/bugs/download.php?file_id=52489

regards, Dmitry



Re: .SECONDEXPANSION problems

2021-12-12 Thread Paul Smith
On Thu, 2021-12-09 at 12:25 +0100, Gisle Vanem wrote:
> Since some time the cool '.SECONDEXPANSION' feature has stopped
> working for me.

Did something happen when it stopped working, like you updated to a
different version of GNU make?

>  In a Makefile, I have many rules to link module .DLLs:
> 
> My problem is that 'EXTRA_CFLAGS' is NOT picked up by the above
> pattern compile rule when the .SECONDEXPANSION rule is used. This
> used to work for sure.

I can't understand the piece of the makefile you provided.  I don't see
anything immediately wrong with it, but I haven't been able to
reproduce this problem in my own experiments.  Can you create a small,
self-contained example that shows the problem you're seeing?

> BTW. Perhaps my problem is related to:
>https://savannah.gnu.org/bugs/?60799

As far as I can see from your example you don't have either ";" or "#"
anywhere in any of your prerequisites so I don't see how that issue
would be related.




.SECONDEXPANSION problems

2021-12-09 Thread Gisle Vanem

Hello list.

Since some time the cool '.SECONDEXPANSION' feature has
stopped working for me. In a Makefile, I have many rules
to link module .DLLs:

  mod_airspy_source_OBJ   = $(OBJ_DIR)/airspy_source_main.obj
  mod_airspyhf_source_OBJ = $(OBJ_DIR)/airspyhf_source_main.obj
  mod_bladerf_source_OBJ  = $(OBJ_DIR)/bladerf_source_main.obj
  ...

  .SECONDEXPANSION:
  modules/%.dll: $$(mod_$$*_OBJ)
$(call link_DLL, $@, $^)

  $(mod_airspy_source_OBJ): \
 EXTRA_CFLAGS = -I./source_modules/airspy_source/src
   ...

  $(OBJ_DIR)/%_main.obj: source_modules/%/src/main.cpp
 $(call CPP_compile, $<, $@)

  define CPP_compile
$(CC) @$(CC).args $(EXTRA_CFLAGS) -Fo$(strip $(2)) $(1)
@echo
  endef

---

My problem is that 'EXTRA_CFLAGS' is NOT picked up by
the above pattern compile rule when the .SECONDEXPANSION
rule is used. This used to work for sure.

Now, I have to add a 'link_DLL' macro-call for each .DLL.

BTW. Perhaps my problem is related to:
  https://savannah.gnu.org/bugs/?60799

--
--gv