Skip to content

Instantly share code, notes, and snippets.

@agwells
Created May 27, 2018 22:52
Show Gist options
  • Save agwells/d69a01e4fd1f533470498e7d3aca8c5e to your computer and use it in GitHub Desktop.
Save agwells/d69a01e4fd1f533470498e7d3aca8c5e to your computer and use it in GitHub Desktop.
List the available targets in a makefile
#!/bin/bash
# A utility to list all the tasks in the current directory's makefile.
#
# Idea taken from https://stackoverflow.com/a/24453375/468642
source /usr/share/bash-completion/completions/make
export _make_target_extract_script
sed -nrf <(_make_target_extract_script --) ./Makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment