Skip to content

Instantly share code, notes, and snippets.

@o11c
Created August 13, 2014 21:25
Show Gist options
  • Save o11c/fd668e544a15b941ea0d to your computer and use it in GitHub Desktop.
Save o11c/fd668e544a15b941ea0d to your computer and use it in GitHub Desktop.
total makefile forwarding done right (probably)
.DEFAULT_GOAL := all
.PHONY: ${MAKECMDGOALS}
$(filter-out all,${MAKECMDGOALS}) all: .forward-all ;
.forward-all:
${MAKE} -C build ${MAKECMDGOALS}
${MAKEFILE_LIST}: ;
.SUFFIXES:
@cjxgm
Copy link

cjxgm commented Mar 11, 2015

Ok, I figured it out, this did the trick:

$(filter-out all,${MAKECMDGOALS}) all: .forward-all
    @# no-op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment