summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-07-27 11:45:21 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-07-27 11:45:21 +0200
commit327add8c702edd5515b79fbfc29d9ef0b07084f4 (patch)
treeab5f9b0917494a65a3d68b028cc8203bfcb262c9 /Makefile
parent220dac758391cdc650e2dd9bdc259e950fcb3955 (diff)
downloadnlplug-327add8c702edd5515b79fbfc29d9ef0b07084f4.tar.bz2
nlplug-327add8c702edd5515b79fbfc29d9ef0b07084f4.tar.xz
nlplug: use libkmod to load modules
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 67347f5..afc06cb 100644
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,17 @@
CFLAGS ?= -Wall -Werror -g
CFLAGS += -D_GNU_SOURCE -DDEBUG
+PKGCONFIG ?= pkg-config
+LIBKMOD_CFLAGS := $(shell $(PKGCONFIG) --cflags libkmod)
+LIBKMOD_LIBS := $(shell $(PKGCONFIG) --libs libkmod)
+
nlsockd_SRCS = nlsockd.c
nlsockd_OBJS = $(nlsockd_SRCS:%.c=%.o)
nlplug_SRCS = nlplug.c
nlplug_OBJS = $(nlplug_SRCS:%.c=%.o)
+nlplug_CFLAGS = $(LIBKMOD_CFLAGS)
+nlplug_LIBS = $(LIBKMOD_LIBS)
handler_SRCS = handler.c
handler_OBJS = $(handler_SRCS:%.c=%.o)
@@ -19,7 +25,7 @@ handler: $(handler_OBJS)
handler nlsockd nlplug:
- $(CC) -o $@ $(CFLAGS) $($@_CFLAGS) $($@_OBJS) $(LDFLAGS) $($@_LDFLAGS)
+ $(CC) -o $@ $(CFLAGS) $($@_CFLAGS) $($@_OBJS) $(LDFLAGS) $($@_LIBS)
clean:
rm -f nlplug nlsockd