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

View File

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