~bt/rover

9e1f635a4c31d1621141dce51bb620365c784a0e — orbea 1 year, 6 months ago 1c737c2
build: Use pkgconfig to fix undefined references

On gentoo the build also requires -ltinfow which is exposed
by the ncursesw.pc pkgconfig file.
2 files changed, 8 insertions(+), 2 deletions(-)

M Makefile
M rover.c
M Makefile => Makefile +6 -2
@@ 1,14 1,18 @@
LDLIBS := -lncursesw
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DATAROOTDIR ?= $(PREFIX)/share
DATADIR ?= $(DATAROOTDIR)
MANDIR ?= $(DATADIR)/man

PKG_CONFIG ?= pkg-config

CFLAGS_NCURSESW := `$(PKG_CONFIG) --cflags ncursesw`
LIBS_NCURSESW := `$(PKG_CONFIG) --libs ncursesw`

all: rover

rover: rover.c config.h
	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS)
	$(CC) $(CFLAGS) $(CFLAGS_NCURSESW) -o $@ $< $(LDFLAGS) $(LIBS_NCURSESW)

install: rover
	rm -f $(DESTDIR)$(BINDIR)/rover

M rover.c => rover.c +2 -0
@@ 1,4 1,6 @@
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE       700
#endif
#define _XOPEN_SOURCE_EXTENDED
#define _FILE_OFFSET_BITS   64