Skip to content

Instantly share code, notes, and snippets.


Vladimír Čunát vcunat

View GitHub Profile
pvdb /
Last active Feb 14, 2021
List all targets (sometimes incorrectly referred to as "goals") in a GNU Makefile
# this gist can be used to list all targets, or - more correctly - rules,
# that are defined in a Makefile (and possibly other included Makefiles)
# and is inspired by Jack Kelly's reply to a StackOverflow question:
# I also found this script - - which does
# something similar using awk, but it extracts targets from the "static" rules from a single
# Makefile, meaning it ignores any included Makefiles, as well as targets from "dynamic" rules