mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-12-31 04:13:54 +00:00
Similar to the Linux kernel and perf add infrastructure to reduce the
amount of output tossed to a user during a build. Full build output
can be obtained with 'make V=1'
Builds go from:
make[1]: Leaving directory `/home/dsa/iproute2.git/lib'
make[1]: Entering directory `/home/dsa/iproute2.git/ip'
gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -c -o ip.o ip.c
gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -c -o ipaddress.o ipaddress.c
to:
...
AR libutil.a
ip
CC ip.o
CC ipaddress.o
...
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
42 lines
843 B
Makefile
42 lines
843 B
Makefile
GENLOBJ=genl.o
|
|
|
|
include ../Config
|
|
SHARED_LIBS ?= y
|
|
|
|
CFLAGS += -fno-strict-aliasing
|
|
|
|
GENLMODULES :=
|
|
GENLMODULES += ctrl.o
|
|
|
|
GENLOBJ += $(GENLMODULES)
|
|
|
|
GENLLIB :=
|
|
|
|
ifeq ($(SHARED_LIBS),y)
|
|
LDFLAGS += -Wl,-export-dynamic
|
|
LDLIBS += -lm -ldl
|
|
endif
|
|
|
|
all: genl
|
|
|
|
genl: $(GENLOBJ) $(LIBNETLINK) $(LIBUTIL) $(GENLLIB)
|
|
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
|
|
|
|
install: all
|
|
install -m 0755 genl $(DESTDIR)$(SBINDIR)
|
|
|
|
clean:
|
|
rm -f $(GENLOBJ) $(GENLLIB) 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
|