You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I modified the makefile and the help target to have a simplified help and get the target+requiredtarget+ description
I have a fancy colors-help and a clean almost no dependencies help ( I found it useful in docker images).
My makefile uses this structure target : required_targets ## inline description , this syntax allow me to easily grep the targets and their description and I find it easy to read the makefile too.
.DEFAULT_GOAL := helpcol
install_package : ## install the package from setup.py via setuptools
python setup.py install --verbose
# cleaning
clean-pyc: ## remove all pyc, pyo and __pycache__
find . -name '*.pyc' -exec rm -rf {} +
find . -name '*.pyo' -exec rm -rf {} +
find . -name '__pycache__' -exec rm -rf {} +
help: ## Show help. Only lines with ": ##" will show up! This is a plain help, requires only grep+sed.
@grep -h "## " $(MAKEFILE_LIST) | sed '/grep -h/d'
helpcol: ## Show help. Only lines with ": ##" will show up! This require columns. Shows: rules(green), targets(red), description.
@(echo "$$(tput bold)Available rules>$$(tput sgr0;tput setaf 1)target$$(tput sgr0)>description"; \
grep -h ":.*## " $(MAKEFILE_LIST) |\
sed -E -e '/grep -h/d' -e 's/([^:]+)\s?:([^#]+)## (.*)/'$$(tput setaf 6)'\1>'$$(tput setaf 1)'\2'$$(tput sgr0)'>\3/' ) |\
column -t -s '>' | sort
Example output :
The text was updated successfully, but these errors were encountered:
Hi @isms,
Good point, I have no idea. I use it in OSX and I can test a couple of Linux distro with docker, but I think it should just work, it calls a subshell and execute some commands there, like your original makefile.
I'll update this issue with some tests.
Tested with debian 9 (Stretch) and it works, installing from standard aptitude repository :
gnu make
column from bsdmainutils package.
Maybe a less fancy helpcol version without column -t -s '>' | sort could be better, but I purposely split in a base help and a fancy helpcol(or) targets.
Hi,
first time user here, thanks for the repo!
I modified the makefile and the help target to have a simplified help and get the target+
required
target
+description
I have a fancy colors-help and a clean almost no dependencies help ( I found it useful in docker images).
My makefile uses this structure
target : required_targets ## inline description
, this syntax allow me to easily grep the targets and their description and I find it easy to read the makefile too.Example output :
The text was updated successfully, but these errors were encountered: