wg: use pkg-config in Makefile

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2016-07-06 23:51:00 +02:00
parent 4e04bee915
commit 7887d8024c

View file

@ -4,10 +4,11 @@ BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib LIBDIR ?= $(PREFIX)/lib
MANDIR ?= $(PREFIX)/share/man MANDIR ?= $(PREFIX)/share/man
CFLAGS += $(shell pkg-config --cflags libmnl 2>/dev/null)
CFLAGS += -std=gnu11 CFLAGS += -std=gnu11
CFLAGS += -pedantic -Wall -Wextra CFLAGS += -pedantic -Wall -Wextra
CFLAGS += -MMD CFLAGS += -MMD
LDLIBS += -lresolv -lmnl LDLIBS += -lresolv $(shell pkg-config --libs libmnl 2>/dev/null || echo -lmnl)
wg: $(patsubst %.c,%.o,$(wildcard *.c)) wg: $(patsubst %.c,%.o,$(wildcard *.c))