2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 QUILT?
=$(strip $(shell test -f
$(PKG_BUILD_DIR
)/.quilt_patched
&& echo y
))
10 STAMP_PREPARED
:=$(strip $(STAMP_PREPARED
))_q
12 PATCHES
:=$(shell cd .
/patches
; ls
)
13 define Build
/Patch
/Default
14 rm -rf
$(PKG_BUILD_DIR
)/patches
15 mkdir
-p
$(PKG_BUILD_DIR
)/patches
16 for patch in
$(PATCHES
); do
( \
17 cp
"./patches/$$$$patch" $(PKG_BUILD_DIR
); \
18 cd
$(PKG_BUILD_DIR
); \
19 quilt import
-p
1 "$$$$patch"; \
24 touch
$(PKG_BUILD_DIR
)/.quilt_patched
27 define Build
/Patch
/Default
28 @if
[ -d .
/patches
-a
"$$$$(ls ./patches | wc -l)" -gt
0 ]; then \
29 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
; \
34 refresh
: $(STAMP_PREPARED
)
35 @
[ -f
"$(PKG_BUILD_DIR)/patches/series" ] ||
{ \
36 echo
"The source directory was not unpacked using quilt. Please rebuild."; \
39 @
[ "$$(cat $(PKG_BUILD_DIR)/patches/series | md5sum)" = "$$(sort $(PKG_BUILD_DIR)/patches/series | md5sum)" ] ||
{ \
40 echo
"The patches are not sorted in the right order. Please fix."; \
43 rm -f .
/patches
/* 2>/dev
/null
>/dev
/null
45 for patch in
$$(cat
$(PKG_BUILD_DIR
)/patches
/series
); do \
46 $(CP
) -v
"$(PKG_BUILD_DIR)/patches/$$patch" .
/patches
; \