2020-07-07 14:49:53 +00:00
|
|
|
program-name = rodo
|
2020-05-29 22:06:57 +00:00
|
|
|
directory-local = ~/.local/bin
|
|
|
|
directory-global = /usr/local/bin
|
|
|
|
directory-source = src
|
2020-05-30 18:51:30 +00:00
|
|
|
directory-current = .
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
file-source = $(program-name).rkt
|
|
|
|
file-source-origin = $(directory-source)/$(file-source)
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
file-executable = $(program-name)
|
2020-05-29 22:06:57 +00:00
|
|
|
file-executable-local = $(directory-local)/$(file-executable)
|
|
|
|
file-executable-global = $(directory-global)/$(file-executable)
|
2020-07-07 14:49:53 +00:00
|
|
|
file-executable-origin= $(directory-source)/$(file-executable)
|
2020-05-30 18:51:30 +00:00
|
|
|
file-executable-current= $(directory-current)/$(file-executable)
|
2020-05-29 22:06:57 +00:00
|
|
|
|
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-05-29 22:06:57 +00:00
|
|
|
@echo " make [command]"
|
|
|
|
@echo ""
|
2020-07-07 14:49:53 +00:00
|
|
|
@echo "Commands:"
|
2020-05-29 22:06:57 +00:00
|
|
|
@echo " help - Displays this help message"
|
2020-07-07 14:49:53 +00:00
|
|
|
@echo " clean - Removes the $(file-executable) executable from $(directory-source)/"
|
2020-06-06 23:25:51 +00:00
|
|
|
@echo " build - Creates a $(file-executable) executable in your current directory"
|
2020-05-29 22:06:57 +00:00
|
|
|
@echo " install-global - Installs a $(file-executable) executable in $(directory-global)/"
|
|
|
|
@echo " uninstall-global - Deletes a $(file-executable) executable from $(directory-global)/"
|
|
|
|
@echo " install-local - Installs a $(file-executable) executable in $(directory-local)/"
|
|
|
|
@echo " uninstall-local - Deletes a $(file-executable) executable from $(directory-local)/"
|
2020-07-07 15:24:23 +00:00
|
|
|
@echo " install-custom - Installs a $(file-executable) 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-07 15:24:23 +00:00
|
|
|
@echo " make install-custom custom-location=~/bin/"
|
|
|
|
@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:
|
|
|
|
@echo "Uninstalling $(file-executable) from $(file-executable-local) ..."
|
2020-07-07 14:49:53 +00:00
|
|
|
@rm $(file-executable-local)
|
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:
|
|
|
|
@echo "Uninstalling $(file-executable) from $(file-executable-global) ..."
|
2020-07-07 14:49:53 +00:00
|
|
|
@rm $(file-executable-global)
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 15:24:23 +00:00
|
|
|
# Installation -----------------------------------------------------------
|
|
|
|
.PHONY: install-custom
|
|
|
|
install-custom: build
|
|
|
|
@echo "Moving $(file-executable-current) to $(custom-location) ..."
|
|
|
|
@mv $(file-executable-current) $(custom-location)
|
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: install-local
|
2020-05-30 18:51:30 +00:00
|
|
|
install-local: build
|
|
|
|
@echo "Moving $(file-executable-current) to $(file-executable-local) ..."
|
|
|
|
@mv $(file-executable-current) $(file-executable-local)
|
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
|
|
|
|
@echo "Moving $(file-executable-current) to $(file-executable-global) ..."
|
|
|
|
@mv $(file-executable-current) $(file-executable-global)
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-07-07 14:49:53 +00:00
|
|
|
.PHONY: clean
|
2020-05-29 22:06:57 +00:00
|
|
|
clean:
|
2020-05-30 18:51:30 +00:00
|
|
|
@echo "Deleting any $(file-executable) executables found in your current folder ..."
|
2020-07-07 14:49:53 +00:00
|
|
|
@rm $(file-executable-current)
|
2020-05-29 22:06:57 +00:00
|
|
|
|
2020-05-30 18:51:30 +00:00
|
|
|
build:
|
2020-07-07 14:49:53 +00:00
|
|
|
@echo "Creating $(file-executable-origin) executable from $(file-source-origin) ..."
|
|
|
|
@raco exe $(file-source-origin)
|
|
|
|
@echo "Moving $(file-executable-origin) executable to your current folder ..."
|
|
|
|
@mv $(file-executable-origin) $(directory-current)/
|