.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 " 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 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)