Skip to content

Commit e5ad1d9

Browse files
jstancekkuba-moo
authored andcommitted
tools: ynl: add main install target
This will install C library, specs, rsts and pyynl. The initial structure is: $ mkdir /tmp/myroot $ make DESTDIR=/tmp/myroot install /usr /usr/lib64 /usr/lib64/libynl.a /usr/lib/python3.XX/site-packages/pyynl/* /usr/lib/python3.XX/site-packages/pyynl-0.0.1.dist-info/* /usr/bin /usr/bin/ynl /usr/bin/ynl-ethtool /usr/include/ynl/*.h /usr/share /usr/share/doc /usr/share/doc/ynl /usr/share/doc/ynl/*.rst /usr/share/ynl /usr/share/ynl/genetlink-c.yaml /usr/share/ynl/genetlink-legacy.yaml /usr/share/ynl/genetlink.yaml /usr/share/ynl/netlink-raw.yaml /usr/share/ynl/specs /usr/share/ynl/specs/devlink.yaml /usr/share/ynl/specs/dpll.yaml /usr/share/ynl/specs/ethtool.yaml /usr/share/ynl/specs/fou.yaml /usr/share/ynl/specs/handshake.yaml /usr/share/ynl/specs/mptcp_pm.yaml /usr/share/ynl/specs/netdev.yaml /usr/share/ynl/specs/net_shaper.yaml /usr/share/ynl/specs/nfsd.yaml /usr/share/ynl/specs/nftables.yaml /usr/share/ynl/specs/nlctrl.yaml /usr/share/ynl/specs/ovs_datapath.yaml /usr/share/ynl/specs/ovs_flow.yaml /usr/share/ynl/specs/ovs_vport.yaml /usr/share/ynl/specs/rt_addr.yaml /usr/share/ynl/specs/rt_link.yaml /usr/share/ynl/specs/rt_neigh.yaml /usr/share/ynl/specs/rt_route.yaml /usr/share/ynl/specs/rt_rule.yaml /usr/share/ynl/specs/tcp_metrics.yaml /usr/share/ynl/specs/tc.yaml /usr/share/ynl/specs/team.yaml Signed-off-by: Jan Stancek <[email protected]> Reviewed-by: Donald Hunter <[email protected]> Reviewed-by: Joe Damato <[email protected]> Link: https://patch.msgid.link/c882688d751295c7f35c7d4eba104cd5174a0861.1736343575.git.jstancek@redhat.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1b038af commit e5ad1d9

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

tools/net/ynl/Makefile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3+
include ../../scripts/Makefile.arch
4+
5+
INSTALL ?= install
6+
prefix ?= /usr
7+
ifeq ($(LP64), 1)
8+
libdir_relative = lib64
9+
else
10+
libdir_relative = lib
11+
endif
12+
libdir ?= $(prefix)/$(libdir_relative)
13+
includedir ?= $(prefix)/include
14+
315
SUBDIRS = lib generated samples
416

517
all: $(SUBDIRS) libynl.a
@@ -23,5 +35,18 @@ clean distclean:
2335
rm -f libynl.a
2436
rm -rf pyynl/__pycache__
2537
rm -rf pyynl/lib/__pycache__
38+
rm -rf pyynl.egg-info
39+
rm -rf build
40+
41+
install: libynl.a lib/*.h
42+
@echo -e "\tINSTALL libynl.a"
43+
@$(INSTALL) -d $(DESTDIR)$(libdir)
44+
@$(INSTALL) -m 0644 libynl.a $(DESTDIR)$(libdir)/libynl.a
45+
@echo -e "\tINSTALL libynl headers"
46+
@$(INSTALL) -d $(DESTDIR)$(includedir)/ynl
47+
@$(INSTALL) -m 0644 lib/*.h $(DESTDIR)$(includedir)/ynl/
48+
@echo -e "\tINSTALL pyynl"
49+
@pip install --prefix=$(DESTDIR)$(prefix) .
50+
@make -C generated install
2651

27-
.PHONY: all clean distclean $(SUBDIRS)
52+
.PHONY: all clean distclean install $(SUBDIRS)

0 commit comments

Comments
 (0)