Subject: Re: Makefile structure in htdocs
To: None <netbsd-docs@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: netbsd-docs
Date: 10/09/2005 19:04:16
This is a multi-part message in MIME format.
--------------030001080102070009000702
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Roland Illig wrote:
> This patch implements the above paragraph. The only Makefile.inc that
> needs to be modified is the one in ${WEB_PREFIX}, as the others only
> contain conditional definitions.
_This_ patch ... ;)
Roland
--------------030001080102070009000702
Content-Type: text/plain;
name="htdocs.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="htdocs.patch"
Index: Makefile.inc
===================================================================
RCS file: /cvsroot/htdocs/Makefile.inc,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile.inc
--- Makefile.inc 19 Apr 2005 15:46:52 -0000 1.18
+++ Makefile.inc 9 Oct 2005 16:38:45 -0000
@@ -1,5 +1,10 @@
# $NetBSD: Makefile.inc,v 1.18 2005/04/19 15:46:52 hrs Exp $
+.if defined(_HTDOCS_TOPLEVEL_MAKEFILE_INC)
+_!= echo "warning: top-level Makefile.inc included more than once." 1>&2; echo .
+.else
+_HTDOCS_TOPLEVEL_MAKEFILE_INC= #defined
+
WEB_PREFIX?= ${.CURDIR}
DOCLANG?= en
@@ -48,3 +53,5 @@ ${EVENTS_DIR}/events.html: ${EVENTS_DIR}
.endif
.endif
+
+.endif
Index: share/mk/web.site.mk
===================================================================
RCS file: /cvsroot/htdocs/share/mk/web.site.mk,v
retrieving revision 1.41
diff -u -p -r1.41 web.site.mk
--- share/mk/web.site.mk 26 Sep 2005 14:23:00 -0000 1.41
+++ share/mk/web.site.mk 9 Oct 2005 16:38:48 -0000
@@ -12,11 +12,31 @@
# clean -- remove anything generated by processing
#
-DOCLANG?= en
+.if defined(_HTDOCS_WEB_SITE_MK)
+_!= echo "warning: web.site.mk is included more than once." 1>&2; echo .
+.else
+_HTDOCS_WEB_SITE_MK= #defined
-.if exists(${.CURDIR}/../Makefile.inc)
-.include "${.CURDIR}/../Makefile.inc"
-.endif
+# look for the root directory of htdocs
+_HTDOCS_SUBDIRS= #none
+.for _d_ in . .. ../.. ../../.. ../../../..
+. if !defined(_HTDOCS_PREFIX)
+_HTDOCS_SUBDIRS+= ${_d_}
+. if exists(${.CURDIR}/${_d_}/robots.txt)
+_HTDOCS_PREFIX?= ${.CURDIR}/${_d_}
+. endif
+. endif
+.endfor
+WEB_PREFIX?= ${_HTDOCS_PREFIX}
+
+# include all Makefile.inc files on the way from ${.CURDIR} to ${WEB_PREFIX}
+.for _d_ in ${_HTDOCS_SUBDIRS}
+. if exists(${.CURDIR}/${_d_}/Makefile.inc)
+. include "${.CURDIR}/${_d_}/Makefile.inc"
+. endif
+.endfor
+
+DOCLANG?= en
# include settings from /etc/mk.conf first
.include <bsd.own.mk>
@@ -452,4 +472,5 @@ PARAMS+= SGMLOPTS="${SGMLOPTS}"
.include <bsd.obj.mk>
+.endif
# THE END
--------------030001080102070009000702--