2018-07-27 19:46:33 -05:00
|
|
|
SHELL = /bin/bash
|
|
|
|
.ONESHELL:
|
|
|
|
.SHELLFLAGS += -e
|
|
|
|
|
2019-07-26 00:06:41 -05:00
|
|
|
MAIN_TARGET = bash_$(BASH_VERSION_FULL)_$(CONFIGURED_ARCH).deb
|
2018-07-27 19:46:33 -05:00
|
|
|
|
|
|
|
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
2021-10-21 21:29:12 -05:00
|
|
|
# Quilt store applied patches info in .pc folder, if this folder not clean, quilt can't apply patches correctly.
|
|
|
|
rm -rf .pc
|
2018-07-27 19:46:33 -05:00
|
|
|
rm -rf bash-$(BASH_VERSION_MAJOR)
|
|
|
|
|
|
|
|
dget -u https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/$(BASH_VERSION_FULL)/bash_$(BASH_VERSION_FULL).dsc
|
|
|
|
|
2021-10-11 02:20:51 -05:00
|
|
|
# Apply plugin suport patches
|
|
|
|
quilt push -a
|
|
|
|
|
2018-07-27 19:46:33 -05:00
|
|
|
pushd bash-$(BASH_VERSION_MAJOR)
|
2021-10-11 02:20:51 -05:00
|
|
|
|
|
|
|
# build package
|
2022-07-21 16:15:16 -05:00
|
|
|
ifeq ($(CROSS_BUILD_ENVIRON), y)
|
|
|
|
dpkg-buildpackage -us -uc -b -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
|
|
|
|
else
|
2021-01-12 08:03:12 -06:00
|
|
|
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
|
2021-10-11 02:20:51 -05:00
|
|
|
|
|
|
|
# copy UT code.
|
|
|
|
cp -a ../Files/. ./
|
|
|
|
|
|
|
|
# generate config.h which need by UT
|
|
|
|
./configure
|
|
|
|
|
|
|
|
# generate 'pathnames.h' by make bash again, which is needed by UT.
|
|
|
|
make
|
|
|
|
|
|
|
|
# run UT after config.h ready.
|
|
|
|
make -C unittest && make test -C unittest
|
2022-07-21 16:15:16 -05:00
|
|
|
endif
|
2018-07-27 19:46:33 -05:00
|
|
|
popd
|
|
|
|
|
|
|
|
mv $* $(DEST)/
|