Created
September 16, 2024 08:00
-
-
Save rkrug/0854acb4c1c6ffef4a2bdc0fce42aa27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############### | |
#### GIST: Makefile targets | |
#### https://gist.github.com/rkrug/9005f4b7169e65b6c51866209370c599 | |
############### | |
SHELL = /bin/bash | |
# run targets pipeline | |
build: | |
Rscript -e "targets::tar_make()" | |
# visnetwork | |
vis: visualise | |
visualise: | |
Rscript -e "targets::tar_visnetwork()" | |
# delete _targets folderas well as content of data folder | |
clean: | |
Rscript -e "targets::tar_destroy()" | |
rm -rf ./data/* | |
rm -rf ./Report.html | |
############# Help targets ############# | |
list_variables: | |
@echo | |
@echo "#############################################" | |
@echo "## Variables ################################" | |
@$(MAKE) -pn | grep -A1 "^# makefile"| grep -v "^#\|^--" | sort | uniq | |
@echo "#############################################" | |
@echo "" | |
## from https://stackoverflow.com/a/26339924/632423 | |
help: | |
@echo | |
@echo "#############################################" | |
@echo "## Make Targets #############################" | |
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | |
@echo "#############################################" | |
@echo | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment