Switched to a makefile-based solution

This commit is contained in:
Mattia Mascarello 2021-10-11 11:24:13 +02:00
parent 02c007ddc6
commit 02dfd47558
2 changed files with 34 additions and 2 deletions

26
Makefile Normal file
View File

@ -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

View File

@ -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