]> git.proxmox.com Git - mirror_iproute2.git/blame_incremental - genl/Makefile
rdma: Properly mark RDMAtool license
[mirror_iproute2.git] / genl / Makefile
... / ...
CommitLineData
1# SPDX-License-Identifier: GPL-2.0
2GENLOBJ=genl.o
3
4include ../config.mk
5SHARED_LIBS ?= y
6
7CFLAGS += -fno-strict-aliasing
8
9GENLMODULES :=
10GENLMODULES += ctrl.o
11
12GENLOBJ += $(GENLMODULES)
13
14GENLLIB :=
15
16ifeq ($(SHARED_LIBS),y)
17LDFLAGS += -Wl,-export-dynamic
18LDLIBS += -lm -ldl
19endif
20
21all: genl
22
23genl: $(GENLOBJ) $(LIBNETLINK) $(LIBUTIL) $(GENLLIB)
24 $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
25
26install: all
27 install -m 0755 genl $(DESTDIR)$(SBINDIR)
28
29clean:
30 rm -f $(GENLOBJ) $(GENLLIB) genl
31
32ifneq ($(SHARED_LIBS),y)
33
34genl: static-syms.o
35static-syms.o: static-syms.h
36static-syms.h: $(wildcard *.c)
37 files="$^" ; \
38 for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
39 sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
40 done > $@
41
42endif