Use pkg_config to set the linker flags. | |
--- a/src/Makefile | |
+++ b/src/Makefile | |
@@ -1,7 +1,12 @@ | |
ifndef CFLAGS | |
CFLAGS = -O2 -g -I ../src | |
endif | |
-LIBS=-lnl -lnl-genl | |
+PKG_CONFIG ?= pkg-config | |
+PC_DEPS = libnl-3.0 libnl-genl-3.0 | |
+PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS)) | |
+PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS)) | |
+CFLAGS += $(PC_CFLAGS) | |
+LIBS += $(PC_LIBS) | |
all: swconfig | |