xref: /aoo4110/main/solenv/gbuild/JavaClassSet.mk (revision b1cdbd2c)
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
23
24gb_JavaClassSet_REPOSITORYNAMES := $(gb_Helper_REPOSITORYNAMES)
25gb_JavaClassSet_JAVACCOMMAND := $(JAVACOMPILER)
26
27define gb_JavaClassSet__command
28$(call gb_Helper_abbreviate_dirs_native,\
29	mkdir -p $(dir $(1)) && \
30	$(gb_JavaClassSet_JAVACCOMMAND) -cp "$(CLASSPATH)" -d $(call gb_JavaClassSet_get_classdir,$(2)) $(3) && \
31	touch $(1))
32
33endef
34
35define gb_JavaClassSet__rules
36$$(call gb_JavaClassSet_get_repo_target,$(1),%) :
37	$$(call gb_JavaClassSet__command,$$@,$$*,$$?)
38
39$$(call gb_JavaClassSet_get_target,%) : $$(call gb_JavaClassSet_get_repo_target,$(1),%)
40	$$(call gb_Output_announce,$$*,$$(true),JCS,3)
41	$$(call gb_Helper_abbreviate_dirs,\
42		touch $$@)
43
44endef
45
46$(call gb_JavaClassSet_get_clean_target,%) :
47	$(call gb_Output_announce,$*,$(false),JCS,3)
48	$(call gb_Helper_abbreviate_dirs,\
49		rm -rf $(dir $(call gb_JavaClassSet_get_target,$*)))
50
51
52$(foreach reponame,$(gb_JavaClassSet_REPOSITORYNAMES),$(eval $(call gb_JavaClassSet__rules,$(reponame))))
53
54define gb_JavaClassSet_JavaClassSet
55endef
56
57define gb_JavaClassSet__get_sourcefile
58$(1)/$(2).java
59endef
60
61define gb_JavaClassSet_add_sourcefile
62$(foreach reponame,$(gb_JavaClassSet_REPOSITORYNAMES),\
63	$(eval $(call gb_JavaClassSet_get_repo_target,$(reponame),$(1)) : $(call gb_JavaClassSet__get_sourcefile,$($(reponame)),$(2))))
64
65endef
66
67define gb_JavaClassSet_add_sourcefiles
68$(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_sourcefile,$(1),$(sourcefile)))
69
70endef
71
72define gb_JavaClassSet_set_classpath
73$(call gb_JavaClassSet_get_target,$(1)) : CLASSPATH := $(2)
74
75endef
76
77# vim: set noet sw=4 ts=4:
78