Improved (after some years)
This commit is contained in:
31
Makefile
31
Makefile
@ -1,7 +1,20 @@
|
||||
CC = cc
|
||||
CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99
|
||||
UNAME := $(shell uname)
|
||||
|
||||
all:
|
||||
echo "Compiling"
|
||||
gcc -o ropipe ropipe.c
|
||||
@echo "Compiling"
|
||||
$(CC) $(CFLAGS) -o ropipe ropipe.c
|
||||
@echo "Done"
|
||||
|
||||
|
||||
install:
|
||||
ifneq ($(UNAME), Linux)
|
||||
@echo "Automatic installation is only supported on Linux"
|
||||
@echo "Please copy the binary to a directory in your PATH"
|
||||
@echo "and the manpage to your manpages directory"
|
||||
@exit
|
||||
endif
|
||||
ifeq (,$(wildcard ./ropipe))
|
||||
make
|
||||
endif
|
||||
@ -9,20 +22,26 @@ ifneq ($(shell id -u), 0)
|
||||
@echo "You must be root to install"
|
||||
else
|
||||
mkdir -p /usr/local/share/man/man1/
|
||||
echo "Copying man file"
|
||||
@echo "Copying man file"
|
||||
cp ropipe.1 /usr/local/share/man/man1/ropipe.1
|
||||
echo "Installing binary"
|
||||
@echo "Installing binary"
|
||||
cp ropipe /usr/bin/ropipe
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
ifneq ($(UNAME), Linux)
|
||||
@echo "Automatic uninstalling is only supported on Linux"
|
||||
@exit
|
||||
endif
|
||||
ifneq ($(shell id -u), 0)
|
||||
@echo "You must be root to uninstall"
|
||||
else
|
||||
echo "Removing man file"
|
||||
@echo "Removing man file"
|
||||
rm -rf /usr/local/share/man/man1/ropipe.1
|
||||
echo "Uninstalling binary"
|
||||
@echo "Uninstalling binary"
|
||||
rm -rf /usr/bin/ropipe
|
||||
endif
|
||||
|
||||
update:
|
||||
git pull
|
||||
make install
|
||||
|
Reference in New Issue
Block a user