summaryrefslogtreecommitdiff
path: root/mk/fetch/distclean.mk
blob: 3140e1b286b122b079f7ec243955c99e3d40004a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# $NetBSD: distclean.mk,v 1.1 2006/06/06 03:05:48 jlam Exp $

.PHONY: pre-distclean
.if !target(pre-distclean)
pre-distclean:
	@${DO_NADA}
.endif

.PHONY: distclean
.if !target(distclean)
distclean: pre-distclean clean
	@${PHASE_MSG} "Dist cleaning for ${PKGNAME}"
	${_PKG_SILENT}${_PKG_DEBUG}if [ -d ${_DISTDIR} ]; then		\
		cd ${_DISTDIR} &&					\
		${TEST} -z "${DISTFILES}" || ${RM} -f ${DISTFILES};	\
                if [ "${PKG_RESUME_TRANSFERS:M[Yy][Ee][Ss]}" ]; then    \
                    ${TEST} -z "${DISTFILES}.temp" || ${RM} -f ${DISTFILES}.temp;    \
                fi;                                                     \
		${TEST} -z "${PATCHFILES}" || ${RM} -f ${PATCHFILES};	\
	fi
.  if defined(DIST_SUBDIR)
	-${_PKG_SILENT}${_PKG_DEBUG}					\
	${TEST} ! -d ${_DISTDIR} || ${RMDIR} ${_DISTDIR} 2>/dev/null
.  endif
	${_PKG_SILENT}${_PKG_DEBUG}${RM} -f README.html
.endif