Make executes each line of a recipe in a new shell and we need to pass the 
whole recipe in a single shell invocation, so that's the point of `;\`. I could 
align slashes to make it more readable.

I think using `printf %s` instead of `echo` is less likely to lead to 
*surprises*, never hurts to be cautious.

- Kirill Makurin


________________________________
From: LIU Hao
Sent: Tuesday, February 18, 2025 10:37 PM
To: Kirill Makurin; mingw-w64-public@lists.sourceforge.net
Subject: Re: [Mingw-w64-public] make sure WINPTHREAD_API is correctly defined 
in pthread_time.h

在 2025-02-16 20:27, Kirill Makurin 写道:
> +# Handle -lpthread alias when installing
> +install-exec-hook:
> +     . $(builddir)/libwinpthread.la; \
> +     if test -n "$${library_names}"; then \
> +             alias=$$(printf %s "$${library_names}" | $(SED) 
> 's|winpthread|pthread|'); \
> +             $(INSTALL_DATA) $(DESTDIR)$(libdir)/$${library_names} 
> $(DESTDIR)$(libdir)/$${alias}; \
> +     fi; \
> +     if test -n "$${old_library}"; then \
> +             alias=$$(printf %s "$${old_library}" | $(SED) 
> 's|winpthread|pthread|'); \
> +             $(INSTALL_DATA) $(DESTDIR)$(libdir)/$${old_library} 
> $(DESTDIR)$(libdir)/$${alias}; \
> +     fi

These are shell commands, so I suspect `;\` is unnecessary?

Also instead of `printf %s "$${library_names}"` you can use `echo 
"$${library_names}"`.





--
Best regards,
LIU Hao

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to