1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 ifneq ($(strip ${PKG_SITES}),)
5 ifeq ($(strip ${DISTFILES}),)
6 DISTFILES
:= ${PKG_NAME}-${PKG_VERSION}.
tar.gz
10 # This is where all package operation is done in
11 WRKDIR?
= ${WRKDIR_BASE}/w-
${PKG_NAME}-${PKG_VERSION}-${PKG_RELEASE}
12 # This is where source code is extracted and patched
13 WRKDIST?
= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}
14 # This is where the configure script is seeked (localed)
16 # This is where configure, make and make install (fake) run from
18 # This is where make install (fake) writes to
19 WRKINST?
= ${WRKDIR}/fake-
${CPU_ARCH}/root
21 ifeq ($(strip ${NO_CHECKSUM}),)
22 _CHECKSUM_COOKIE
= ${WRKDIR}/.checksum_done
27 ${PACKAGE_DIR}/.stamps
:
28 @mkdir
-p
${PACKAGE_DIR}/.stamps
30 post-extract
: ${PACKAGE_DIR}/.stamps
32 ifeq ($(strip ${NO_DISTFILES}),1)
33 ${WRKDIST}/.extract_done
:
34 rm -rf
${WRKDIST} ${WRKSRC} ${WRKBUILD}
35 @mkdir
-p
${WRKDIR} ${WRKDIST}
37 @
${MAKE} post-extract
$(MAKE_TRACE
)
40 fetch refetch checksum do-extract
:
42 __use_generic_patch_target
:=42
43 else ifneq ($(strip ${DISTFILES}),)
44 include ${TOPDIR}/mk
/fetch.mk
46 ${WRKDIST}/.extract_done
: ${_CHECKSUM_COOKIE}
47 ifeq (${_CHECKSUM_COOKIE},)
48 rm -rf
${WRKDIST} ${WRKSRC} ${WRKBUILD}
51 @
${MAKE} post-extract
$(MAKE_TRACE
)
54 __use_generic_patch_target
:=42
55 else ifeq ($(strip ${_IN_PACKAGE}),1)
56 $(warning This package does not use the generic extraction and patch target
; it
's most likely to fail.)
59 ifeq ($(strip ${__use_generic_patch_target}),42)
61 ${WRKDIST}/.prepared: ${WRKDIST}/.extract_done
62 [ ! -d ./patches/${PKG_VERSION} ] || ${PREVENT_PATCH} ${PATCH} ${WRKDIST} ./patches/${PKG_VERSION} \
63 '{patch-
!(*.orig
),*.patch
}' $(MAKE_TRACE)
64 [ ! -d ./patches ] || ${PREVENT_PATCH} ${PATCH} ${WRKDIST} ./patches \
65 '{patch-
!(*.orig
),*.patch
}' $(MAKE_TRACE)
66 [ ! -d ./src ] || (cd src; $(PREVENT_PATCH) cp -Rp . ${WRKDIST}/) \
68 @${MAKE} post-patch $(MAKE_TRACE)
73 @test ! -d ${WRKDIR}.orig || rm -rf ${WRKDIR}.orig
74 @test ! -d ${WRKDIR}.orig
75 ifeq ($(strip ${_IN_PACKAGE})$(strip ${_IN_CVTC}),1)
76 @$(MAKE) -s V=0 patch WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1
78 @$(MAKE) -s V=0 prepare WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1
80 @# restore config.sub/config.guess
81 @for i in $$(find ${WRKDIR} -name config.sub);do \
82 if [ -f $$i.bak ];then \
86 @for i in $$(find ${WRKDIR} -name config.guess);do \
87 if [ -f $$i.bak ];then \
91 @toedit=$$(WRKDIST='${WRKDIST}' CURDIR=$$(pwd) \
92 PATCH_LIST='patch-
* *.patch
' WRKDIR1='${WRKDIR}' \
93 ${BASH} ${TOPDIR}/scripts/update-patches); \
94 if [[ -n $$toedit && $$toedit != FAIL ]]; then \
95 echo -n 'edit patches
: '; read i; \
96 cd patches && $${VISUAL:-$${EDITOR:-vi}} $$toedit; \
98 rm -rf ${WRKDIR}.orig; \
99 [[ $$toedit != FAIL ]]
101 .PHONY: update-patches