Collection of useful makefiles and commands, with Docker, Symfony, PHP, Composer, Angular, Node, ...
- Clone the project:
git clone git@github.com:jprivet-dev/makefiles.git
cd makefiles
- And choose one of the use cases. For example:
cd php-local-compose-v1-v2
make # print help
# Comments are preceded by the hash symbol
.PHONY: target
target: dependencies
command_1
command_2
...
command_n
I prefer to use the snack_case
format for Makefile commands, as it's easier to select an entire command with a double-click (IDE, text editor, terminal, ...), unlike the kebab-case
format.
✅ Double click to select with snack_case
format:
.PHONY: my_target_a
my_target_a: dependencies ## Description
command
command
❌ Double click to select with kebab-case
format :
.PHONY: my-target-a
my-target-a: dependencies ## Description
command
command
See https://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo
To put it simply, I noticed that in the Makefiles, echo -n
and echo -e
did not behave identically, depending on the Linux distribution in which they were executed.
On Ubuntu, echo -e ...
handles colours, without forcing SHELL:=/bin/bash
, whereas on Oracle Linux Server it displays the colour encoding, for example Part of \033[34mthe sentence in blue\033[0m, then reset.
I now use printf
exclusively...
- https://github.com/dunglas/symfony-docker/blob/main/docs/makefile.md
- https://www.hpc2n.umu.se/documentation/compilers/makefiles
- https://stackoverflow.com/questions/2145590/what-is-the-purpose-of-phony-in-a-makefile
- https://devhints.io/makefile
- https://emojipedia.org/
Feel free to make comments/suggestions to me in the Git issues section.
This project is released under the MIT License.