ATF-log archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

org.NetBSD.atf.htdocs.revamp: 0acb92fcae0efda8c829971ee257ff2484246d35



#
#
# patch "Makefile"
#  from [0e5a419589eb88786c93af89ffe0ea7b0d6afa56]
#    to [2e37b9918186b3dd53b9bb70abac62b4204f2d4c]
#
============================================================
--- Makefile    0e5a419589eb88786c93af89ffe0ea7b0d6afa56
+++ Makefile    2e37b9918186b3dd53b9bb70abac62b4204f2d4c
@@ -1,12 +1,43 @@
+#
+# Automated Testing Framework (atf)
+#
+# Copyright (c) 2010 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+# -------------------------------------------------------------------------
+# Tunable variables.
+# -------------------------------------------------------------------------
+
+# Location of build directory.
 HTDOCS = htdocs
 
+# Program names.
 MTN = mtn
 XSLTPROC = xsltproc
 
-.PHONY: all
-.ORDER: dirs build
-all: dirs build
-
 # -------------------------------------------------------------------------
 # Output control.
 # -------------------------------------------------------------------------
@@ -17,7 +48,7 @@ INFO_GENERATE = echo "generate"
 INFO_GENERATE = echo "generate"
 
 # -------------------------------------------------------------------------
-# Special targets.
+# Directory creation.
 # -------------------------------------------------------------------------
 
 DIRS = $(HTDOCS)
@@ -34,10 +65,6 @@ dirs:
        fi
 .endfor
 
-.PHONY: clean
-clean:
-       test -f $(HTDOCS)/revision.tag && rm -rf $(HTDOCS)
-
 # -------------------------------------------------------------------------
 # Documents.
 # -------------------------------------------------------------------------
@@ -74,34 +101,20 @@ $(HTDOCS)/revision.tag: Makefile _MTN/re
 # images directory.
 # -------------------------------------------------------------------------
 
-IMAGES = components.png
-IMAGES += logo-web.png
-IMAGES += rss-icon.png
-IMAGES += test-structure.png
+IMAGES = images/components.png
+IMAGES += images/logo-web.png
+IMAGES += images/rss-icon.png
+IMAGES += images/test-structure.png
 
-build: copy-images
-copy-images:
-.for image in $(IMAGES)
-copy-images: $(HTDOCS)/images/$(image)
-$(HTDOCS)/images/$(image): images/$(image)
-       @$(INFO_COPY) $(HTDOCS)/images/$(image)
-       @install -m 444 images/$(image) $(HTDOCS)/images/$(image)
-.endfor
+COPY_FILES += $(IMAGES)
 
 # -------------------------------------------------------------------------
 # styles directory.
 # -------------------------------------------------------------------------
 
-CSS = style.css
+CSS = styles/style.css
 
-build: copy-css
-copy-css:
-.for css in $(CSS)
-copy-css: $(HTDOCS)/styles/$(css)
-$(HTDOCS)/styles/$(css): styles/$(css)
-       @$(INFO_COPY) $(HTDOCS)/styles/$(css)
-       @install -m 444 styles/$(css) $(HTDOCS)/styles/$(css)
-.endfor
+COPY_FILES += $(CSS)
 
 # -------------------------------------------------------------------------
 # rss directory.
@@ -113,8 +126,28 @@ $(HTDOCS)/rss/rss.xml: rss/generate.xsl 
        @$(INFO_BUILD) $(HTDOCS)/rss/rss.xml
        @$(XSLTPROC) rss/generate.xsl rss/source.xml >$(HTDOCS)/rss/rss.xml
 
-build: copy-rss
-copy-rss: $(HTDOCS)/rss/.htaccess
-$(HTDOCS)/rss/.htaccess: rss/dot.htaccess
-       @$(INFO_COPY) $(HTDOCS)/rss/.htaccess
-       @install -m 444 rss/dot.htaccess $(HTDOCS)/rss/.htaccess
+COPY_FILES += rss/dot.htaccess
+
+# -------------------------------------------------------------------------
+# Generic rules.
+# -------------------------------------------------------------------------
+
+.MAIN: all
+.PHONY: all
+.ORDER: dirs build
+all: dirs build
+
+build: copy-files
+copy-files:
+.for file in $(COPY_FILES)
+src_file_$(file) ?= $(file)
+dst_file_$(file) ?= $(file:S/dot././g)
+copy-files: $(HTDOCS)/$(dst_file_$(file))
+$(HTDOCS)/$(dst_file_$(file)): $(src_file_$(file))
+       @$(INFO_COPY) $(HTDOCS)/$(dst_file_$(file))
+       @install -m 444 $(src_file_$(file)) $(HTDOCS)/$(dst_file_$(file))
+.endfor
+
+.PHONY: clean
+clean:
+       test -f $(HTDOCS)/revision.tag && rm -rf $(HTDOCS)


Home | Main Index | Thread Index | Old Index