Skip to content

Commit

Permalink
Add ability to list make targets
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck committed Oct 6, 2024
1 parent 78b43fe commit 2e866e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TARGETS := $(shell ls scripts)
TARGETS := $(shell ls scripts|grep -ve "^util-")
LOCAL_TARGETS := $(addprefix local-,$(TARGETS))

.dapper:
Expand All @@ -18,4 +18,8 @@ $(LOCAL_TARGETS): local-%: .dapper

.DEFAULT_GOAL := default

.PHONY: $(TARGETS)
.PHONY: $(list TARGETS)
list:
@LC_ALL=C $(MAKE) -pRrq -f $(firstword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | grep -E -v -e '^[^[:alnum:]]' -e '^$@$$'
# IMPORTANT: The line above must be indented by (at least one)
# *actual TAB character* - *spaces* do *not* work.

0 comments on commit 2e866e0

Please sign in to comment.