DEV Community

Discussion on: Makefiles for automation and better dev-UI

Collapse
 
vlasales profile image
Vlastimil Pospichal

$ cat parse_makefile.sh

#!/bin/bash
echo "Hello to the $1"
printf "%-30s %s\n" "target" "help"
printf "%-30s %s\n" "------" "----"
sed -ne 's/:.*## */:/p' Makefile |
    while IFS=':' read command info; do
            printf "\033[36m%-30s \033[0m%s\n"  "$command" "$info"
    done