From 1f1d36f06c48b5cdee2b74605eaa57453fdfae32 Mon Sep 17 00:00:00 2001 From: gokul swaminathan <33443763+JavaCafe01@users.noreply.github.com> Date: Mon, 22 Mar 2021 14:23:24 -0700 Subject: [PATCH] Added Makefile (#5) * Added a makefile * Update readme with makefile instructions --- Makefile | 25 +++++++++++++++++++++++++ README.md | 14 +++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7690600 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +PREFIX ?= /usr +BINDIR ?= $(PREFIX)/bin +LIBDIR ?= $(PREFIX)/share/hilbish + +build: + @go build + +install: build + @install -v -d "$(BINDIR)/" && install -m 0755 -v hilbish "$(BINDIR)/hilbish" + @mkdir -p "$(LIBDIR)" + @cp libs preload.lua .hilbishrc.lua "$(LIBDIR)" -r + @echo "Hilbish Installed" + +uninstall: + @rm -vrf \ + "$(BINDIR)/hilbish" \ + "$(LIBDIR)" + @echo "Hilbish Uninstalled" + +clean: + @go clean + +all: build install + +.PHONY: install uninstall build clean diff --git a/README.md b/README.md index 3dd0e69..c24619b 100644 --- a/README.md +++ b/README.md @@ -18,20 +18,16 @@ Prebuilt binaries are not yet provided, so to try it out you'll have to manually ### Requirements - Go 1.16 -### Setup -``` +### Install +```sh git clone https://github.com/Hilbis/Hilbish cd Hilbish -go build +sudo make install ``` -This will build a `hilbish` executable in the current directory. - -# Install +### Uninstall ```sh -sudo cp hilbish /usr/bin -sudo mkdir /usr/share/hilbish -sudo cp libs preload.lua .hilbishrc.lua /usr/share/hilbish -r +sudo make uninstall ``` # License