Merge pull request #17 from imak/master

Changed Makefile test for OS to account for Fedora and RHEL/CentOS more accura…
This commit is contained in:
Brian Barto 2016-05-06 12:01:10 -04:00
commit 2c337e61dc
1 changed files with 12 additions and 13 deletions

View File

@ -16,7 +16,6 @@ CC = gcc
CFLAGS = -Wextra -Wall
LDLIBS = -lncurses
NCURSES_H = /usr/include/ncurses.h
UNAME = $(shell uname)
.PHONY: all install uninstall clean
@ -39,18 +38,18 @@ $(OBJ):
mkdir $(OBJ)
$(NCURSES_H):
ifeq ($(UNAME), Linux)
sudo apt-get update
sudo apt-get install ncurses-dev
endif
ifeq ($(UNAME), CentOS)
sudo yum update
sudo yum install ncurses-dev
endif
ifeq ($(UNAME), Fedora)
sudo dnf update --refresh
sudo dnf install ncurses-dev
endif
if [ -a /etc/fedora-release ] ; \
then \
sudo dnf update --refresh ; \
sudo dnf install ncurses-devel ; \
elif [ -a /etc/redhat-release ] ; \
then \
sudo yum update ; \
sudo yum install ncurses-devel ; \
else \
sudo apt-get update ; \
sudo apt-get install ncurses-dev ; \
fi
clean:
rm -rf $(BIN)