- @echo ================== Installing $(DESTDIR)
- $(Q)mkdir -p $(DESTDIR)
- $(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
- --keep-newer-files --warning=no-ignore-newer -f -
- $(Q)mkdir -p $(DESTDIR)/$T
- $(Q)tar -C $(RTE_OUTPUT) -chf - \
- --exclude app --exclude hostapp --exclude build \
- --exclude Makefile --exclude .depdirs . | \
- tar -C $(DESTDIR)/$T -x --keep-newer-files \
- --warning=no-ignore-newer -f -
- $(Q)install -D $(RTE_OUTPUT)/app/testpmd \
- $(DESTDIR)/$T/app/testpmd
- @echo Installation in $(DESTDIR) complete
+ifeq ($(DESTDIR)$(if $T,,+),)
+ @echo Installation cannot run with T defined and DESTDIR undefined
+else
+ @echo ================== Installing $(DESTDIR)$(prefix)/
+ $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
+ $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-kmod
+ $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
+ $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-doc
+ @echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
+ $(Q)cp -a $O/lib/* $(DESTDIR)$(libdir)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
+ $(Q)tar -cf - -C $O --exclude 'app/*.map' \
+ --exclude app/dpdk-pmdinfogen \
+ --exclude 'app/cmdline*' --exclude app/test \
+ --exclude app/testacl --exclude app/testpipeline app | \
+ tar -xf - -C $(DESTDIR)$(bindir) --strip-components=1 \
+ --keep-newer-files
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(datadir))
+ $(Q)cp -a $(RTE_SDK)/usertools $(DESTDIR)$(datadir)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(sbindir))
+ $(Q)$(call rte_symlink, $(DESTDIR)$(datadir)/usertools/dpdk-devbind.py, \
+ $(DESTDIR)$(sbindir)/dpdk-devbind)
+ $(Q)$(call rte_symlink, $(DESTDIR)$(datadir)/usertools/dpdk-pmdinfo.py, \
+ $(DESTDIR)$(bindir)/dpdk-pmdinfo)
+ifneq ($(wildcard $O/doc/man/*/*.1),)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(mandir)/man1)
+ $(Q)cp -a $O/doc/man/*/*.1 $(DESTDIR)$(mandir)/man1
+endif
+ifneq ($(wildcard $O/doc/man/*/*.8),)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(mandir)/man8)
+ $(Q)cp -a $O/doc/man/*/*.8 $(DESTDIR)$(mandir)/man8
+endif
+
+install-kmod:
+ifneq ($(wildcard $O/kmod/*),)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+ $(Q)cp -a $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
+install-sdk:
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
+ $(Q)tar -chf - -C $O include | \
+ tar -xf - -C $(DESTDIR)$(includedir) --strip-components=1 \
+ --keep-newer-files
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(sdkdir))
+ $(Q)cp -a $(RTE_SDK)/mk $(DESTDIR)$(sdkdir)
+ $(Q)cp -a $(RTE_SDK)/buildtools $(DESTDIR)$(sdkdir)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(targetdir)/app)
+ $(Q)cp -a $O/.config $(DESTDIR)$(targetdir)
+ $(Q)cp -a $O/app/dpdk-pmdinfogen $(DESTDIR)$(targetdir)/app
+ $(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
+ $(Q)$(call rte_symlink, $(DESTDIR)$(libdir), $(DESTDIR)$(targetdir)/lib)
+
+install-doc:
+ifneq ($(wildcard $O/doc/html),)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
+ $(Q)tar -cf - -C $O/doc --exclude 'html/guides/.*' html | \
+ tar -xf - -C $(DESTDIR)$(docdir) --strip-components=1 \
+ --keep-newer-files
+endif
+ifneq ($(wildcard $O/doc/*/*/*pdf),)
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(docdir)/guides)
+ $(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
+endif
+ $(Q)$(call rte_mkdir, $(DESTDIR)$(datadir))
+ $(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)