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
22
23PRJ = ..$/..$/..$/..$/..
24PRJNAME = filter
25TARGET  = TypeDetection
26PACKAGE = complex$/filter$/detection$/typeDetection
27
28# --- Settings -----------------------------------------------------
29.INCLUDE: settings.mk
30
31
32#----- compile .java files -----------------------------------------
33
34JARFILES        = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
35JAVAFILES       = TypeDetection.java Helper.java
36JAVACLASSFILES	= $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
37
38#----- make a jar from compiled files ------------------------------
39
40MAXLINELENGTH = 100000
41
42JARCLASSDIRS    = $(PACKAGE)
43JARTARGET       = $(TARGET).jar
44JARCOMPRESS 	= TRUE
45
46# --- Parameters for the test --------------------------------------
47
48# start an office if the parameter is set for the makefile
49.IF "$(OFFICE)" == ""
50CT_APPEXECCOMMAND =
51.ELSE
52CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
53.ENDIF
54
55# test base is java complex
56CT_TESTBASE = -TestBase java_complex
57
58# test looks something like the.full.package.TestName
59CT_TEST     = -o $(PACKAGE:s\$/\.\).TypeDetection
60
61# start the runner application
62CT_APP      = org.openoffice.Runner
63
64# --- Targets ------------------------------------------------------
65
66.IF "$(depend)" == ""
67        CHMOD $(CLASSDIR)$/$(PACKAGE)$/TypeDetection.props \
68        $(CLASSDIR)$/$(PACKAGE)$/preselectedFilter.csv \
69        $(CLASSDIR)$/$(PACKAGE)$/preselectedType.csv \
70        $(CLASSDIR)$/$(PACKAGE)$/serviceName.csv \
71        $(CLASSDIR)$/$(PACKAGE)$/files.csv : ALLTAR
72.ELSE
73        CHMOD $(CLASSDIR)$/$(PACKAGE)$/TypeDetection.props \
74        $(CLASSDIR)$/$(PACKAGE)$/preselectedFilter.csv \
75        $(CLASSDIR)$/$(PACKAGE)$/preselectedType.csv \
76        $(CLASSDIR)$/$(PACKAGE)$/serviceName.csv \
77        $(CLASSDIR)$/$(PACKAGE)$/files.csv : ALLDEP
78.ENDIF
79
80.INCLUDE :  target.mk
81
82$(CLASSDIR)$/$(PACKAGE)$/preselectedFilter.csv : preselectedFilter.csv
83    cp preselectedFilter.csv $(CLASSDIR)$/$(PACKAGE)$/preselectedFilter.csv
84    jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/preselectedFilter.csv
85
86$(CLASSDIR)$/$(PACKAGE)$/preselectedType.csv : preselectedType.csv
87    cp preselectedType.csv $(CLASSDIR)$/$(PACKAGE)$/preselectedType.csv
88    jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/preselectedType.csv
89
90$(CLASSDIR)$/$(PACKAGE)$/serviceName.csv : serviceName.csv
91    cp serviceName.csv $(CLASSDIR)$/$(PACKAGE)$/serviceName.csv
92    jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/serviceName.csv
93
94$(CLASSDIR)$/$(PACKAGE)$/files.csv : files.csv
95    cp files.csv $(CLASSDIR)$/$(PACKAGE)$/files.csv
96    jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/files.csv
97
98$(CLASSDIR)$/$(PACKAGE)$/TypeDetection.props : TypeDetection.props
99    cp TypeDetection.props $(CLASSDIR)$/$(PACKAGE)$/TypeDetection.props
100    jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/TypeDetection.props
101
102# --- chmod --------------------------------------------------------
103
104CHMOD :
105	chmod 444 $(CLASSDIR)$/$(PACKAGE)$/*.csv
106	chmod 666 $(CLASSDIR)$/$(PACKAGE)$/*.props
107
108RUN: run
109
110run:
111    java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST)
112
113
114
115