Add one more special target 'checkmissing'. It supposed to process

tree and find all files/directories which are not used by Makefile's.
Found files are: forgotten or build only (these should be handled later)
This commit is contained in:
Alexey Zelkin 2004-04-05 23:45:05 +00:00
parent 746e692884
commit 15d2dc0c1f
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=20526

View file

@ -30,6 +30,7 @@ CGIMODE?= 775
CP?= /bin/cp
CVS?= /usr/bin/cvs
ECHO_CMD?= echo
FIND?= /usr/bin/find
SETENV?= /usr/bin/env
LN?= /bin/ln
MKDIR?= /bin/mkdir
@ -185,7 +186,6 @@ ORPHANS:= ${ORPHANS:N*.sgml}
-${TIDY} ${TIDYOPTS} ${.TARGET}
.endif
##################################################################
# Special Targets
@ -209,6 +209,41 @@ webcheck:
@[ -d ${WEBCHECKINSTALLDIR} ] || ${MKDIR} ${WEBCHECKINSTALLDIR}
${WEBCHECK} ${WEBCHECKOPTS} -o ${WEBCHECKINSTALLDIR} ${WEBCHECKURL}
#
# Check if all directories and files in current directory are listed in
# Makefile as processing source. If anything not listed is found, then
# user is warned about (it can be forgotten file or directory).
#
.if make(checkmissing)
_DIREXCL= ! -name CVS
.for entry in ${SUBDIR}
_DIREXCL+= ! -name ${entry}
.endfor
MISSDIRS!= ${FIND} ./ -type d ${_DIREXCL} -maxdepth 1 | ${SED} "s%./%%g"
_FILEEXCL= ! -name Makefile\* ! -name includes.\*
.for entry in ${DOCS} ${DATA} ${CGI}
_FILEEXCL+= ! -name ${entry}
.endfor
MISSFILES!= ${FIND} ./ -type f ${_FILEEXCL} -maxdepth 1 | ${SED} "s%./%%g"
checkmissing: _PROGSUBDIR
.if !empty(MISSDIRS)
@${ECHO_CMD} -n "Directories not listed in SUBDIR: "
.for entry in ${MISSDIRS}
@${ECHO_CMD} -n "${entry} "
.endfor
@${ECHO_CMD}
.endif
.if !empty(MISSFILES)
@${ECHO_CMD} -n "Files not listed in DOCS/DATA/CGI: "
.for entry in ${MISSFILES}
@${ECHO_CMD} -n "${entry} "
.endfor
@${ECHO_CMD}
.endif
.endif
##################################################################
# Main Targets