Skip to content

Instantly share code, notes, and snippets.

@esuomi
Last active October 19, 2017 07:09
Show Gist options
  • Save esuomi/ee81ea8435da5c0ac6896ef3688e1e44 to your computer and use it in GitHub Desktop.
Save esuomi/ee81ea8435da5c0ac6896ef3688e1e44 to your computer and use it in GitHub Desktop.
# This top level Makefile runs make in all subdirectories with Makefiles in them
# Original taken from https://stackoverflow.com/a/17845120
#
# TOPTARGETS define all make commands which can be used in all Makefiles within this repo
TOPTARGETS := clean build test publish-dev publish-prod
SUBDIRS := $(shell find . -mindepth 2 -name "Makefile" | xargs dirname)
.PHONY: $(TOPTARGETS) $(SUBDIRS)
$(TOPTARGETS): $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment