| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 | # This file is part of the OpenADK project. OpenADK is copyrighted# material, please see the LICENCE file in the top-level directory.ifneq ($(strip ${PKG_SITES}),)ifeq ($(strip ${DISTFILES}),)DISTFILES:=		${PKG_NAME}-${PKG_VERSION}.tar.gzendifendif# This is where all package operation is done inWRKDIR?=		${WRKDIR_BASE}/w-${PKG_NAME}-${PKG_VERSION}-${PKG_RELEASE}# This is where source code is extracted and patchedWRKDIST?=		${WRKDIR}/${PKG_NAME}-${PKG_VERSION}# This is where the configure script is seeked (localed)WRKSRC?=		${WRKDIST}# This is where configure, make and make install (fake) run fromWRKBUILD?=		${WRKSRC}# This is where make install (fake) writes toWRKINST?=		${WRKDIR}/fake-${CPU_ARCH}/rootifeq ($(strip ${NO_CHECKSUM}),)_CHECKSUM_COOKIE=      ${WRKDIR}/.checksum_doneelse_CHECKSUM_COOKIE=endifpost-extract:ifeq ($(strip ${NO_DISTFILES}),1)${WRKDIST}/.extract_done:	rm -rf ${WRKDIST} ${WRKSRC} ${WRKBUILD}	@mkdir -p ${WRKDIR} ${WRKDIST}	${MAKE} do-extract	@${MAKE} post-extract $(MAKE_TRACE)	touch $@fetch refetch checksum do-extract:__use_generic_patch_target:=42else ifneq ($(strip ${DISTFILES}),)include ${TOPDIR}/mk/fetch.mk${WRKDIST}/.extract_done: ${_CHECKSUM_COOKIE}ifeq (${_CHECKSUM_COOKIE},)	rm -rf ${WRKDIST} ${WRKSRC} ${WRKBUILD}endif	${EXTRACT_CMD}	@${MAKE} post-extract $(MAKE_TRACE)	touch $@__use_generic_patch_target:=42else ifeq ($(strip ${_IN_PACKAGE}),1)$(warning This package does not use the generic extraction and patch target; it's most likely to fail.)endififeq ($(strip ${__use_generic_patch_target}),42)post-patch:${WRKDIST}/.prepared: ${WRKDIST}/.extract_done	[ ! -d ./patches/${PKG_VERSION} ] || ${PREVENT_PATCH} ${PATCH} ${WRKDIST} ./patches/${PKG_VERSION} \	    '{patch-!(*.orig),*.patch}' $(MAKE_TRACE)	[ ! -d ./patches ] || ${PREVENT_PATCH} ${PATCH} ${WRKDIST} ./patches \	    '{patch-!(*.orig),*.patch}' $(MAKE_TRACE)	[ ! -d ./src ] || (cd src; $(PREVENT_PATCH) cp -Rp . ${WRKDIST}/) \		$(MAKE_TRACE)	@${MAKE} post-patch $(MAKE_TRACE)	touch $@endifupdate-patches:	@test ! -d ${WRKDIR}.orig || rm -rf ${WRKDIR}.orig	@test ! -d ${WRKDIR}.origifeq ($(strip ${_IN_PACKAGE})$(strip ${_IN_CVTC}),1)	@$(MAKE) -s V=0 patch WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1else	@$(MAKE) -s V=0 prepare WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1endif	@# restore config.sub/config.guess	@for i in $$(find ${WRKDIR} -name config.sub);do \		if [ -f $$i.bak ];then \			mv $$i.bak $$i; \		fi;\	done	@for i in $$(find ${WRKDIR} -name config.guess);do \		if [ -f $$i.bak ];then \			mv $$i.bak $$i; \		fi;\	done	@toedit=$$(WRKDIST='${WRKDIST}' CURDIR=$$(pwd) \	    PATCH_LIST='patch-* *.patch' WRKDIR1='${WRKDIR}' \	    ${BASH} ${TOPDIR}/scripts/update-patches); \	    if [[ -n $$toedit && $$toedit != FAIL ]]; then \		echo -n 'edit patches: '; read i; \		cd patches && $${VISUAL:-$${EDITOR:-vi}} $$toedit; \	    fi; \	    rm -rf ${WRKDIR}.orig; \	    [[ $$toedit != FAIL ]].PHONY: update-patches
 |