summaryrefslogtreecommitdiff
path: root/Makefile
blob: f1a77fbb2a73c01ec6e46c673b7490d5eee461ac (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
25
26
27
.PHONY: all

CFLAGS += -g -Wall -Wpedantic
CORE_OBJS = control.o reader.o config.o command.o
PLUGINS = reader_yhy.so reader_linux.so

reader_yhy.so: LDLIBS = -lyhy
reader_yhy.so: LDFLAGS += -L. -Wl,-rpath .
reader_linux.so: LDLIBS += $(shell pkg-config --libs libnl-genl-3.0)
reader_linux.so: CFLAGS += $(shell pkg-config --cflags libnl-genl-3.0)

%.so: CFLAGS += -shared -fPIC

%.so :: %.c %.h
	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) $(LDLIBS)

nfcommander: LDLIBS = -ldl
nfcommander: LDFLAGS += -Wl,-export-dynamic

all: nfcommander $(PLUGINS)

nfcommander: nfcommander.c nfcommander.h $(CORE_OBJS)

clean:
	$(RM) nfcommander
	$(RM) $(CORE_OBJS)
	$(RM) $(PLUGINS)