Skip to content

Instantly share code, notes, and snippets.

@devraj
Created April 17, 2017 03:57
Show Gist options
  • Save devraj/6b839a58a901e9ab756154494fd503e2 to your computer and use it in GitHub Desktop.
Save devraj/6b839a58a901e9ab756154494fd503e2 to your computer and use it in GitHub Desktop.
Running a command on set of file patterns in Makefiles using Array like structures
# Must be defined out side a target
CONTAINER_DIR=src
CLEAN_PATTERNS=*.pyo *.egg *.eggs *.egg-info *~ __pycache__
.PHONY: prep-devel-env
prep-devel-env:
$(foreach package, $(PACKAGES),(cd $(CONTAINER_DIR)/$(package); $(PIP) install -e .) &&):
.PHONY: clean
clean:
$(foreach package, $(PACKAGES),(cd $(CONTAINER_DIR)/$(package); $(PYTHON35) setup.py clean) &&):
$(foreach file_pattern, $(CLEAN_PATTERNS),(find . -name $(file_pattern) -exec rm -f {} +) &&):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment