rodo/Makefile

106 lines
3.3 KiB
Makefile
Raw Permalink Normal View History

2020-07-07 14:49:53 +00:00
program-name = rodo
2020-07-11 22:45:53 +00:00
program-source = $(program-name).rkt
directory-local = ~/.local/bin
directory-global = /usr/local/bin
directory-source = src
2020-07-07 14:49:53 +00:00
.PHONY: help
help:
2020-07-07 14:49:53 +00:00
@echo "Usage"
2020-07-11 22:45:53 +00:00
@echo " make <command> [<args>]"
@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 ""
2021-03-12 13:28:57 +00:00
@echo " compile"
2020-07-11 22:45:53 +00:00
@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"
2021-03-12 13:28:57 +00:00
@echo " make compile"
2020-07-07 14:49:53 +00:00
@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/"
@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:
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-07-07 14:49:53 +00:00
.PHONY: uninstall-global
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!"
# Installation -----------------------------------------------------------
.PHONY: install-custom
2021-03-12 13:28:57 +00:00
install-custom: compile
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 14:49:53 +00:00
.PHONY: install-local
2021-03-12 13:28:57 +00:00
install-local: compile
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-07-07 14:49:53 +00:00
.PHONY: install-global
2021-03-12 13:28:57 +00:00
install-global: compile
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!"
2021-03-12 13:28:57 +00:00
compile:
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)