rodo/Makefile

89 lines
3.1 KiB
Makefile
Raw Normal View History

2020-07-07 14:49:53 +00:00
program-name = rodo
directory-local = ~/.local/bin
directory-global = /usr/local/bin
directory-source = src
2020-05-30 18:51:30 +00:00
directory-current = .
2020-07-07 14:49:53 +00:00
file-source = $(program-name).rkt
file-source-origin = $(directory-source)/$(file-source)
2020-07-07 14:49:53 +00:00
file-executable = $(program-name)
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-07-07 14:49:53 +00:00
.PHONY: help
help:
2020-07-07 14:49:53 +00:00
@echo "Usage"
@echo " make [command]"
@echo ""
2020-07-07 14:49:53 +00:00
@echo "Commands:"
@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"
@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)/"
@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"
@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-07-07 14:49:53 +00:00
.PHONY: install
install:
@echo "Try running make help"
2020-07-07 14:49:53 +00:00
.PHONY: uninstall
uninstall:
@echo "Try running make help"
# Uninstallation ---------------------------------------------------------
2020-07-07 14:49:53 +00:00
.PHONY: uninstall-local
uninstall-local:
@echo "Uninstalling $(file-executable) from $(file-executable-local) ..."
2020-07-07 14:49:53 +00:00
@rm $(file-executable-local)
2020-07-07 14:49:53 +00:00
.PHONY: uninstall-global
uninstall-global:
@echo "Uninstalling $(file-executable) from $(file-executable-global) ..."
2020-07-07 14:49:53 +00:00
@rm $(file-executable-global)
# 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-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-07-07 14:49:53 +00:00
.PHONY: clean
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-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)/