diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..224df3a --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +all: + echo "Compiling" + gcc -o ropipe ropipe.c +install: +ifeq (,$(wildcard ./ropipe)) + make +endif +ifneq ($(shell id -u), 0) + @echo "You must be root to install" +else + mkdir -p /usr/local/share/man/man1/ + echo "Copying man file" + cp ropipe.1 /usr/local/share/man/man1/ropipe.1 + echo "Installing binary" + cp ropipe /usr/bin/ropipe +endif +uninstall: +ifneq ($(shell id -u), 0) + @echo "You must be root to uninstall" +else + mkdir -p /usr/local/share/man/man1/ + echo "Removing man file" + rm -rf /usr/local/share/man/man1/ropipe.1 + echo "Uninstalling binary" + rm -rf /usr/bin/ropipe +endif diff --git a/README.md b/README.md index dd7a0a8..3e9d451 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,13 @@ Default is integer to roman. 2. `cd` into it 3. run ```sh -sudo bash install.sh +sudo make install ``` or ```sh -doas bash install.sh +doas make install ``` + (The program is compiled at this time, you may check the script and the program out beforehand) ## Examples Once installed, you can find sample files in the project dir. @@ -52,3 +53,8 @@ A manpage is installed alongside the program, try running `man ropipe` ## Updates There is no automatic update system as of yet, you are advised to regularly visit https://github.com/MatMasIt/ropipe, download and re-run the installer in order to get updates + +## Make commands +* `make`: compile ropipe +* `make install`: install ropipe +* `make uninstall`: uninstall ropipe