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
29 ifeq ($(strip ${NO_DISTFILES}),1)
30 ${WRKDIST}/.extract_done
:
31 rm -rf
${WRKDIST} ${WRKSRC} ${WRKBUILD}
32 mkdir
-p
${WRKDIR} ${WRKDIST}
37 fetch refetch checksum do-extract
:
39 __use_generic_patch_target
:=42
40 else ifneq ($(strip ${DISTFILES}),)
41 include ${TOPDIR}/mk
/fetch.mk
43 ${WRKDIST}/.extract_done
: ${_CHECKSUM_COOKIE}
44 ifeq (${_CHECKSUM_COOKIE},)
45 rm -rf
${WRKDIST} ${WRKSRC} ${WRKBUILD}
51 __use_generic_patch_target
:=42
52 else ifeq ($(strip ${_IN_PACKAGE}),1)
53 $(warning This package does not use the generic extraction and patch target
; it
's most likely to fail.)
56 ifeq ($(strip ${__use_generic_patch_target}),42)
58 ${WRKDIST}/.prepared: ${WRKDIST}/.extract_done
59 [ ! -d ./patches ] || ${PREVENT_PATCH} ${PATCH} ${WRKDIST} ./patches \
60 '{patch-
!(*.orig
),*.patch
}' $(MAKE_TRACE)
61 [ ! -d ./extra ] || (cd extra; $(PREVENT_PATCH) cp -Rp . ${WRKDIST}/) \
63 @${MAKE} post-patch $(MAKE_TRACE)
68 @test ! -d ${WRKDIR}.orig || rm -rf ${WRKDIR}.orig
69 @test ! -d ${WRKDIR}.orig
70 ifeq ($(strip ${_IN_PACKAGE})$(strip ${_IN_CVTC}),1)
71 @$(MAKE) -s V=0 patch WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1
73 @$(MAKE) -s V=0 prepare WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1
75 @# restore config.sub/config.guess
76 @for i in $$(find ${WRKDIR} -name config.sub);do \
77 if [ -f $$i.bak ];then \
81 @for i in $$(find ${WRKDIR} -name config.guess);do \
82 if [ -f $$i.bak ];then \
86 @toedit=$$(WRKDIST='${WRKDIST}' CURDIR=$$(pwd) \
87 PATCH_LIST='patch-
* *.patch
' WRKDIR1='${WRKDIR}' \
88 ${BASH} ${TOPDIR}/scripts/update-patches); \
89 if [[ -n $$toedit && $$toedit != FAIL ]]; then \
90 echo -n 'edit patches
: '; read i; \
91 cd patches && $${VISUAL:-$${EDITOR:-vi}} $$toedit; \
93 rm -rf ${WRKDIR}.orig; \
94 [[ $$toedit != FAIL ]]
96 .PHONY: update-patches