From ba06fa3eac3827ee6ee217fb18ee50119b246397 Mon Sep 17 00:00:00 2001 From: Ivan Makfinsky Date: Fri, 6 May 2016 11:24:32 -0400 Subject: [PATCH] Changed test for OS to account for Fedora and RHEL/CentOS more accurately. Also updaated the ncurses-dev to ncusrses-devel for same. --- Makefile | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index ce8f6a3..87680df 100644 --- a/Makefile +++ b/Makefile @@ -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)