]> git.proxmox.com Git - mirror_iproute2.git/blame - genl/Makefile
devlink: Add devlink-health man page
[mirror_iproute2.git] / genl / Makefile
CommitLineData
6054c1eb 1# SPDX-License-Identifier: GPL-2.0
65018ae4
JHS
2GENLOBJ=genl.o
3
5f1df307 4include ../config.mk
f2e27cfb 5SHARED_LIBS ?= y
65018ae4 6
46dc73a5
SH
7CFLAGS += -fno-strict-aliasing
8
65018ae4
JHS
9GENLMODULES :=
10GENLMODULES += ctrl.o
11
12GENLOBJ += $(GENLMODULES)
13
14GENLLIB :=
15
f2e27cfb 16ifeq ($(SHARED_LIBS),y)
a18fa24a
SH
17LDFLAGS += -Wl,-export-dynamic
18LDLIBS += -lm -ldl
f2e27cfb 19endif
65018ae4
JHS
20
21all: genl
22
23genl: $(GENLOBJ) $(LIBNETLINK) $(LIBUTIL) $(GENLLIB)
57bdf8b7 24 $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
65018ae4
JHS
25
26install: all
a18fa24a 27 install -m 0755 genl $(DESTDIR)$(SBINDIR)
65018ae4
JHS
28
29clean:
30 rm -f $(GENLOBJ) $(GENLLIB) genl
f2e27cfb
MF
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