They must end with ".patch0".
# Automatically detect all patches in "patches"
PKG_PATCHES = \
$(foreach patch,$(wildcard $(DIR_PATCHES)/*.patch),$(notdir $(patch)))
+PKG_PATCHES += \
+ $(foreach patch,$(wildcard $(DIR_PATCHES)/*.patch0),$(notdir $(patch)))
# Dynamic command that applies all patches
DO_PATCHES = cd $(DIR_APP) && $(DIR_TOOLS)/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch))
for patch in $@; do
echo "Applying file ${patch}..."
- patch -Np1 -i ${patch}
+ if [ "${patch##*/*.}" = "patch0" ]; then
+ cmd="patch -Np0"
+ else
+ cmd="patch -Np1"
+ fi
+
+ ${cmd} -i ${patch}
ret=$?
if [ ${ret} -ne 0 ]; then