From b42ac4b8a1f15c2d383693f5159a69418dfef7e4 Mon Sep 17 00:00:00 2001 From: serxoz Date: Mon, 25 Oct 2021 10:21:27 +0200 Subject: [PATCH] makefile - libs --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fef3b57..a2e96ef 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ -CC=gcc -NAME=elefantes +NAME = elefantes +CC = gcc +LIBS = -lm +LIBS += $(shell ncursesw5-config --libs 2>/dev/null \ + || ncurses5-config --libs 2>/dev/null \ + || ncursesw6-config --libs 2>/dev/null \ + || ncurses6-config --libs 2>/dev/null ) compile: - $(CC) -o $(NAME) main.c distancia.c screen.c -L/usr/include/ -lm -lncurses + $(CC) -o $(NAME) main.c distancia.c screen.c $(LIBS)