1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22PRJ=..
23
24.INCLUDE :	settings.mk
25
26version=4.0
27
28.IF "$(RAT_JAR_HOME)"=="BUILD"
29rat_jar_home=$(CLASSDIR)
30.ELSE
31rat_jar_home=$(RAT_JAR_HOME)
32.ENDIF
33.IF "$(OS)"=="WNT"
34rat_jar_home!:=$(shell cygpath -u $(rat_jar_home))
35.ENDIF
36
37rat_scan_output:=$(MISC)/rat-output.xml
38.IF "$(OS)"=="WNT"
39rat_scan_output!:=$(shell cygpath -m $(rat_scan_output))
40.ENDIF
41
42all : $(MISC)/aoo-$(version)_rat-scan-output.html
43
44show-excludes .PHONY : $(MISC)/excluded-files.txt
45
46$(MISC)/aoo-$(version)_rat-scan-output.html : $(MISC)/rat-scan-output.xml
47	java -jar $(OUTDIR)/bin/saxon9.jar -t -s:$< -xsl:rat-output-to-html.xsl -o:$@ -l:on -warnings:fatal
48	@echo
49	@echo Find rat scan report in $@
50
51$(MISC)/rat-scan-output.xml : rat-scan.xml $(SRC_ROOT)/rat-excludes
52	$(ANT) -f rat-scan.xml -DRAT_SCAN_OUTPUT=$@ -DRAT_JAR_HOME=$(rat_jar_home)
53
54$(MISC)/excluded-files.txt : $(MISC)/excluded-files-raw.txt
55	cat $< | sed 's/;/\n/g' > $@
56
57$(MISC)/excluded-files-raw.txt : rat-scan.xml $(SRC_ROOT)/rat-excludes
58	$(ANT) -f rat-scan.xml -DEXCLUDED_FILES_OUTPUT=$@ -DEXCLUDED_SOLVER_OUTPUT=$@ \
59		-DRAT_JAR_HOME=$(rat_jar_home) show-excluded-files
60