Skip to content

Commit

Permalink
Merge pull request #152 from rosineygp/feat/list-targets
Browse files Browse the repository at this point in the history
feat: list makefiles targets
  • Loading branch information
rosineygp authored May 27, 2021
2 parents 7afd05a + fc7584c commit 0489648
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .mkdkr
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ define dkr =
trap _job_destroy EXIT
_pretty "orange" "\nstart: \$(@)\n"
endef
.PHONY: _list
_list:
@FILTER="^[a-zA-Z_]([a-zA-Z0-9\_\/\.\-])+?:((\ [a-zA-Z][a-zA-Z0-9\_\/\.\-]+)?)+\$\$"
make -qp 2> /dev/null | grep -E "\$\$FILTER" | grep -v -E '(Makefile|_list)' | sort -u
EOF
}

Expand Down
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Table of contents
- [Implicit](#implicit)
- [mkdkr.csv](#mkdkrcsv)
- [Collection](#collection)
- [Builtin Targets](#builtin-targets)
- [_list](#_list)
- [Helpers](#helpers)
- [Examples](#examples)
- [Simple](#simple)
Expand Down Expand Up @@ -561,6 +563,52 @@ The file contains four values per line in following order

> Small collection, use it as example
# Builtin Targets

## _list

List all targets in `Makefile`, include extensions.

```shell
$ make _list

include

alias: exporter, repos: https://github.com/rosineygp/mkdkr_exporter.git, checkout: v1.5.0, file: main.mk

replace: MKDKR_EXPORTER_TAG=latest to v1.5.0
bash.v4-0:
bash.v4-1:
bash.v4-2:
bash.v4-3:
bash.v4-4:
bash.v5-0:
_coverage.report:
examples.dind:
examples.escapes:
examples.pipeline:
examples.retry:
examples.service:
examples.shell:
examples.simple:
examples.stdout:
_exporter_bitbucket-pipelines:
_exporter_circle-ci:
_exporter_github:
_exporter_gitlab-ci:
_exporter_jenkins_pipeline:
_exporter_shell:
_exporter_travis:
lint.commit:
lint.hadolint:
lint.shellcheck:
test.unit:
```

> The result are sorted by name.
>
> First char target name: [a-zA-Z_]
# Helpers

A set of small functions to common pipelines process.
Expand Down

0 comments on commit 0489648

Please sign in to comment.