sonic-buildimage/src/lldpd/Makefile

33 lines
889 B
Makefile
Raw Normal View History

.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e
MAIN_TARGET = $(LLDPD)
DERIVED_TARGETS = $(LIBLLDPCTL)
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Remove any stale files
rm -rf ./lldpd
# Clone lldpd repo
git clone https://github.com/vincentbernat/lldpd.git
pushd ./lldpd
# Reset HEAD to the commit of the proper tag
# NOTE: Using "git checkout <tag_name>" here detaches our HEAD,
# which stg doesn't like, so we use this method instead
git reset --hard $(LLDPD_VERSION)
# Apply patches
stg init
stg import -s ../patch/series
# Build source and Debian packages
env "with_netlink_receive_bufsize=1024*1024" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)
popd
# Move the newly-built .deb packages to the destination directory
mv $* $(DERIVED_TARGETS) $(DEST)/
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)