phpearth / docker-php

🐳 Docker For PHP developers - Docker images with PHP, Nginx, OpenLiteSpeed, Apache, Lighttpd, and Alpine
https://docs.php.earth/docker
MIT License
261 stars 80 forks source link

Make Makefile compatible with GNU Make 4.3 #51

Closed Henridv closed 4 years ago

Henridv commented 4 years ago

fixes #50

petk commented 4 years ago

Hello, thank you for the fix. This is on macOS maybe?

Is it possible to adjust this in a way that still spaces are used (notice the .RECIPEPREFIX +=) but it works on this system, where you're having these issues?

On some macOS systems a simple make upgrade helped via brew (to GNU Make 4.1+ I think).

Henridv commented 4 years ago

I didn't know about that special variable.

However, when installing GNU Make 4.3 on my system it still didn't work because of a change to how Make handles the += operator: https://lwn.net/Articles/810071/

Luckily, this SO answer provided a backwards compatible solution: https://stackoverflow.com/questions/2131213/can-you-make-valid-makefiles-without-tab-characters/60363121#60363121

petk commented 4 years ago

Thank you @Henridv for the nice fix. :100:

Quite terrible solutions are being implemented on the GNU Make side but let's add this one then since works properly for the future versions. I think, a much better solution otherwise for projects requiring running commands like this, is then moving to shell scripts alternative. From my point of view GNU Make is not going in the right and future prone direction anymore... But only my opinion here.

glensc commented 3 years ago

@petk if you mean this one:

  • WARNING: Backward-incompatibility! Previously appending using '+=' to an empty variable would result in a value starting with a space. Now the initial space is only added if the variable already contains some value. Similarly, appending an empty string does not add a trailing space.

Then in my opinion it's a bugfix for broken behavior. If there's anything to complain about, they should had fixed it sooner.

My other opinion is that switching makefile ident from tab to space, is a known choice to call for troubles, makefile syntax has been for decades tab indented, everybody knows that. It's not portable to override the ident for makefiles. Makes dependency on specific GNU make.