2020-07-07 14:49:53 +00:00
|
|
|
program-name = rodo
|
2020-07-11 22:45:53 +00:00
|
|
|
program-source = $(program-name).rkt
|
|
|
|
|
2020-05-29 22:06:57 +00:00
|
|
|
directory-local = ~/.local/bin
|
|
|
|
directory-global = /usr/local/bin
|
|
|
|
directory-source = src
|
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: help
|
2020-05-29 22:06:57 +00:00
|
|
|
help:
|
2020-07-07 14:49:53 +00:00
|
|
|
@echo "Usage"
|
2020-07-11 22:45:53 +00:00
|
|
|
@echo " make <command> [<args>]"
|
2020-05-29 22:06:57 +00:00
|
|
|
@echo ""
|
2020-07-07 14:49:53 +00:00
|
|
|
@echo "Commands:"
|
2020-07-11 22:45:53 +00:00
|
|
|
@echo " help"
|
|
|
|
@echo " Displays this help message"
|
|
|
|
@echo ""
|
|
|
|
@echo " clean"
|
|
|
|
@echo " Removes the $(program-name) executable from $(directory-source)/"
|
|
|
|
@echo ""
|
|
|
|
@echo " build"
|
|
|
|
@echo " Creates a $(program-name) executable in your current directory"
|
|
|
|
@echo ""
|
|
|
|
@echo " install-global"
|
|
|
|
@echo " Installs a $(program-name) executable in $(directory-global)/"
|
|
|
|
@echo " Note: This command requires sudo or root access"
|
|
|
|
@echo ""
|
|
|
|
@echo " uninstall-global"
|
|
|
|
@echo " Deletes a $(program-name) executable from $(directory-global)/"
|
|
|
|
@echo " Note: This command requires sudo or root access"
|
|
|
|
@echo ""
|
|
|
|
@echo " install-local"
|
|
|
|
@echo " Installs a $(program-name) executable in $(directory-local)/"
|
|
|
|
@echo ""
|
|
|
|
@echo " uninstall-local"
|
|
|
|
@echo " Deletes a $(program-name) executable from $(directory-local)/"
|
|
|
|
@echo ""
|
|
|
|
@echo " install-custom location=<args>"
|
|
|
|
@echo " Installs a $(program-name) executable in a custom location"
|
2020-07-07 14:49:53 +00:00
|
|
|
@echo ""
|
|
|
|
@echo "Examples:"
|
|
|
|
@echo " make help"
|
|
|
|
@echo " make clean"
|
|
|
|
@echo " make build"
|
|
|
|
@echo " sudo make install-global"
|
|
|
|
@echo " sudo make uninstall-global"
|
|
|
|
@echo " make install-local"
|
|
|
|
@echo " make uninstall-local"
|
2020-07-11 22:45:53 +00:00
|
|
|
@echo " make install-custom location=~/bin/"
|
2020-07-07 15:24:23 +00:00
|
|
|
@echo ""
|
|
|
|
@echo "Note: You will have to manually uninstall custom installations"
|
2020-07-07 14:49:53 +00:00
|
|
|
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: install
|
2020-05-29 22:06:57 +00:00
|
|
|
install:
|
|
|
|
@echo "Try running make help"
|
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: uninstall
|
2020-05-29 22:06:57 +00:00
|
|
|
uninstall:
|
|
|
|
@echo "Try running make help"
|
|
|
|
|
2020-07-07 15:24:23 +00:00
|
|
|
# Uninstallation ---------------------------------------------------------
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: uninstall-local
|
2020-05-29 22:06:57 +00:00
|
|
|
uninstall-local:
|
2020-07-22 20:46:11 +00:00
|
|
|
@echo "uninstalling $(program-name) from $(directory-local) ..."
|
2020-07-11 22:45:53 +00:00
|
|
|
@rm $(directory-local)/$(program-name)
|
2020-07-22 20:46:11 +00:00
|
|
|
@echo "uninstallation complete!"
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: uninstall-global
|
2020-05-29 22:06:57 +00:00
|
|
|
uninstall-global:
|
2020-07-22 20:46:11 +00:00
|
|
|
@echo "uninstalling $(program-name) from $(directory-global) ..."
|
2020-07-11 22:45:53 +00:00
|
|
|
@rm $(directory-global)/$(program-name)
|
2020-07-22 20:46:11 +00:00
|
|
|
@echo "uninstallation complete!"
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 15:24:23 +00:00
|
|
|
# Installation -----------------------------------------------------------
|
|
|
|
.PHONY: install-custom
|
|
|
|
install-custom: build
|
2020-07-11 22:45:53 +00:00
|
|
|
@echo "Moving ./$(program-name) to $(location) ..."
|
|
|
|
@mv ./$(program-name) $(location)
|
2020-07-15 05:10:01 +00:00
|
|
|
@echo "Installation complete!"
|
2020-07-07 15:24:23 +00:00
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: install-local
|
2020-05-30 18:51:30 +00:00
|
|
|
install-local: build
|
2020-07-15 05:10:01 +00:00
|
|
|
@echo "Making $(directory-local) if it doesn't already exist ..."
|
|
|
|
@mkdir -p $(directory-local)
|
2020-07-11 22:45:53 +00:00
|
|
|
@echo "Moving ./$(program-name) to $(directory-local)/$(program-name) ..."
|
|
|
|
@mv ./$(program-name) $(directory-local)/$(progam-name)
|
2020-07-15 05:10:01 +00:00
|
|
|
@echo "Installation complete!"
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: install-global
|
2020-05-30 18:51:30 +00:00
|
|
|
install-global: build
|
2020-07-11 22:45:53 +00:00
|
|
|
@echo "Moving ./$(program-name) to $(directory-global)/$(program-name) ..."
|
|
|
|
@mv ./$(program-name) $(directory-global)/$(progam-name)
|
2020-07-15 05:10:01 +00:00
|
|
|
@echo "Installation complete!"
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-05-30 18:51:30 +00:00
|
|
|
build:
|
2020-07-11 22:45:53 +00:00
|
|
|
@echo "Creating a $(directory-source)/$(program-name) executable from $(directory-source)/$(program-source) ..."
|
|
|
|
@raco exe $(directory-source)/$(program-source)
|
|
|
|
@echo "Moving $(directory-source)/$(program-name) executable to your current folder ..."
|
|
|
|
@mv $(directory-source)/$(program-name) ./
|
2020-07-22 20:46:11 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
@echo "Deleting any $(program-name) executables found in your current folder ..."
|
|
|
|
@rm ./$(program-name)
|
|
|
|
|