2018-03-07 19:08:45 -06:00
|
|
|
.ONESHELL:
|
|
|
|
SHELL = /bin/bash
|
|
|
|
.SHELLFLAGS += -e
|
|
|
|
|
|
|
|
MAIN_TARGET = $(LLDPD)
|
2019-07-04 00:13:55 -05:00
|
|
|
DERIVED_TARGETS = $(LIBLLDPCTL) $(LLDPD_DBG)
|
2018-03-07 19:08:45 -06:00
|
|
|
|
2020-04-12 04:30:04 -05:00
|
|
|
LLDP_URL = https://sonicstorage.blob.core.windows.net/debian/pool/main/l/lldpd
|
2019-04-17 12:59:58 -05:00
|
|
|
|
|
|
|
DSC_FILE = lldpd_$(LLDPD_VERSION_FULL).dsc
|
|
|
|
ORIG_FILE = lldpd_$(LLDPD_VERSION).orig.tar.gz
|
|
|
|
DEBIAN_FILE = lldpd_$(LLDPD_VERSION_FULL).debian.tar.xz
|
|
|
|
|
|
|
|
DSC_FILE_URL = $(LLDP_URL)/$(DSC_FILE)
|
|
|
|
ORIG_FILE_URL = $(LLDP_URL)/$(ORIG_FILE)
|
|
|
|
DEBIAN_FILE_URL = $(LLDP_URL)/$(DEBIAN_FILE)
|
|
|
|
|
2018-03-07 19:08:45 -06:00
|
|
|
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
|
|
|
# Remove any stale files
|
2019-05-16 12:59:12 -05:00
|
|
|
rm -rf lldpd-$(LLDPD_VERSION)
|
2018-03-07 19:08:45 -06:00
|
|
|
|
2019-04-17 12:59:58 -05:00
|
|
|
# download debian LLDPDD
|
|
|
|
wget -NO "$(DSC_FILE)" $(DSC_FILE_URL)
|
|
|
|
wget -NO "$(ORIG_FILE)" $(ORIG_FILE_URL)
|
|
|
|
wget -NO "$(DEBIAN_FILE)" $(DEBIAN_FILE_URL)
|
|
|
|
dpkg-source -x lldpd_$(LLDPD_VERSION_FULL).dsc
|
2018-03-07 19:08:45 -06:00
|
|
|
|
2019-04-17 12:59:58 -05:00
|
|
|
pushd lldpd-$(LLDPD_VERSION)
|
|
|
|
git init
|
|
|
|
git add -f *
|
|
|
|
git commit -m "unmodified lldp source"
|
2018-03-07 19:08:45 -06:00
|
|
|
|
|
|
|
# Apply patches
|
|
|
|
stg init
|
|
|
|
stg import -s ../patch/series
|
|
|
|
|
|
|
|
# Build source and Debian packages
|
2022-07-21 16:15:16 -05:00
|
|
|
ifeq ($(CROSS_BUILD_ENVIRON), y)
|
|
|
|
env "with_netlink_receive_bufsize=1024*1024" CFLAGS="-I $$CROSS_PERL_CORE_PATH" dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
|
|
|
|
else
|
2021-01-12 08:03:12 -06:00
|
|
|
env "with_netlink_receive_bufsize=1024*1024" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
|
2022-07-21 16:15:16 -05:00
|
|
|
endif
|
2018-03-07 19:08:45 -06:00
|
|
|
popd
|
|
|
|
|
|
|
|
# Move the newly-built .deb packages to the destination directory
|
|
|
|
mv $* $(DERIVED_TARGETS) $(DEST)/
|
|
|
|
|
|
|
|
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
|