mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-15 05:55:11 +08:00
dc2a4c024f
Both GENLLIB and LIBUTIL are not used in genl Makefile, let's get rid of them. Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
41 lines
836 B
Makefile
41 lines
836 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
GENLOBJ=genl.o
|
|
|
|
include ../config.mk
|
|
SHARED_LIBS ?= y
|
|
|
|
CFLAGS += -fno-strict-aliasing
|
|
|
|
GENLMODULES :=
|
|
GENLMODULES += ctrl.o
|
|
|
|
GENLOBJ += $(GENLMODULES)
|
|
|
|
ifeq ($(SHARED_LIBS),y)
|
|
LDFLAGS += -Wl,-export-dynamic
|
|
LDLIBS += -lm -ldl
|
|
endif
|
|
|
|
all: genl
|
|
|
|
genl: $(GENLOBJ) $(LIBNETLINK)
|
|
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
|
|
|
|
install: all
|
|
install -m 0755 genl $(DESTDIR)$(SBINDIR)
|
|
|
|
clean:
|
|
rm -f $(GENLOBJ) genl
|
|
|
|
ifneq ($(SHARED_LIBS),y)
|
|
|
|
genl: static-syms.o
|
|
static-syms.o: static-syms.h
|
|
static-syms.h: $(wildcard *.c)
|
|
files="$^" ; \
|
|
for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
|
|
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
|
|
done > $@
|
|
|
|
endif
|