2016-12-05 13:12:19 -06:00
|
|
|
.ONESHELL:
|
|
|
|
SHELL = /bin/bash
|
|
|
|
|
2018-06-09 13:31:34 -05:00
|
|
|
MFT_NAME = mft-$(MFT_VERSION)-$(MFT_REVISION)-x86_64-deb
|
2016-12-05 13:12:19 -06:00
|
|
|
MFT_TGZ = $(MFT_NAME).tgz
|
2018-06-09 13:31:34 -05:00
|
|
|
SRC_DEB = kernel-mft-dkms_$(MFT_VERSION)-$(MFT_REVISION)_all.deb
|
2016-12-05 13:12:19 -06:00
|
|
|
|
2018-06-09 13:31:34 -05:00
|
|
|
MAIN_TARGET = mft-$(MFT_VERSION)-$(MFT_REVISION).amd64.deb
|
|
|
|
DERIVED_TARGETS = kernel-mft-dkms_$(MFT_VERSION)-$(KVERSION)_all.deb mft-oem-$(MFT_VERSION)-$(MFT_REVISION).amd64.deb
|
2016-12-05 13:12:19 -06:00
|
|
|
|
|
|
|
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
|
|
|
rm -rf $(MFT_NAME)
|
|
|
|
wget -O $(MFT_TGZ) http://www.mellanox.com/downloads/MFT/$(MFT_TGZ)
|
|
|
|
tar xzf $(MFT_TGZ)
|
|
|
|
pushd $(MFT_NAME)/SDEBS
|
|
|
|
|
|
|
|
# put a lock here because dpkg does not allow installing packages in parallel
|
|
|
|
while true; do
|
|
|
|
if mkdir $(DEST)/dpkg_lock &> /dev/null; then
|
|
|
|
{ echo here && sudo dpkg -i $(SRC_DEB) && rm -d $(DEST)/dpkg_lock && break; } || { rm -d $(DEST)/dpkg_lock && exit 1 ; }
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2018-06-09 13:31:34 -05:00
|
|
|
tar xvf `sudo dkms mkdriverdisk kernel-mft-dkms/$(MFT_VERSION) -a all -d ubuntu -k $(KVERSION) --media tar | grep "Disk image location" | cut -d':' -f2`
|
2016-12-05 13:12:19 -06:00
|
|
|
popd
|
|
|
|
|
|
|
|
# fix timestamp because we do not actually build tools, only kernel
|
2018-06-09 13:31:34 -05:00
|
|
|
touch $(MFT_NAME)/DEBS/*
|
|
|
|
mv $(MFT_NAME)/SDEBS/ubuntu-drivers/3.16.0/kernel-mft-dkms_$(MFT_VERSION)-$(KVERSION)_all.deb $(MFT_NAME)/DEBS/* $(DEST)
|
2016-12-05 13:12:19 -06:00
|
|
|
|
|
|
|
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
|