summaryrefslogtreecommitdiff
blob: 9c70493b4cd5df1e806ef362195403e2c026f6e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
 # Makefile - makefile for rexima
 
-CC=gcc
-CFLAGS=-O -Wall
+PKG_CONFIG ?= pkg-config
+CFLAGS += -Wall
+CPPFLAGS += $(shell $(PKG_CONFIG) --cflags ncurses)
+LDLIBS = $(shell $(PKG_CONFIG) --libs ncurses)
 
 # Set BINDIR to directory for binary,
 # MANDIR to directory for man page.
@@ -16,9 +18,6 @@
 
 all: rexima
 
-rexima: rexima.o
-	$(CC) $(CFLAGS) -o rexima rexima.o -lncurses
-
 installdirs:
 	/bin/sh ./mkinstalldirs $(BINDIR) $(MANDIR)