xref: /aoo41x/main/solenv/gbuild/JavaClassSet.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28gb_JavaClassSet_REPOSITORYNAMES := $(gb_Helper_REPOSITORYNAMES)
29gb_JavaClassSet_JAVACCOMMAND := $(JAVACOMPILER)
30
31define gb_JavaClassSet__command
32$(call gb_Helper_abbreviate_dirs_native,\
33	mkdir -p $(dir $(1)) && \
34	$(gb_JavaClassSet_JAVACCOMMAND) -cp "$(CLASSPATH)" -d $(call gb_JavaClassSet_get_classdir,$(2)) $(3) && \
35	touch $(1))
36
37endef
38
39define gb_JavaClassSet__rules
40$$(call gb_JavaClassSet_get_repo_target,$(1),%) :
41	$$(call gb_JavaClassSet__command,$$@,$$*,$$?)
42
43$$(call gb_JavaClassSet_get_target,%) : $$(call gb_JavaClassSet_get_repo_target,$(1),%)
44	$$(call gb_Output_announce,$$*,$$(true),JCS,3)
45	$$(call gb_Helper_abbreviate_dirs,\
46		touch $$@)
47
48endef
49
50$(call gb_JavaClassSet_get_clean_target,%) :
51	$(call gb_Output_announce,$*,$(false),JCS,3)
52	$(call gb_Helper_abbreviate_dirs,\
53		rm -rf $(dir $(call gb_JavaClassSet_get_target,$*)))
54
55
56$(foreach reponame,$(gb_JavaClassSet_REPOSITORYNAMES),$(eval $(call gb_JavaClassSet__rules,$(reponame))))
57
58define gb_JavaClassSet_JavaClassSet
59endef
60
61define gb_JavaClassSet__get_sourcefile
62$(1)/$(2).java
63endef
64
65define gb_JavaClassSet_add_sourcefile
66$(foreach reponame,$(gb_JavaClassSet_REPOSITORYNAMES),\
67	$(eval $(call gb_JavaClassSet_get_repo_target,$(reponame),$(1)) : $(call gb_JavaClassSet__get_sourcefile,$($(reponame)),$(2))))
68
69endef
70
71define gb_JavaClassSet_add_sourcefiles
72$(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_sourcefile,$(1),$(sourcefile)))
73
74endef
75
76define gb_JavaClassSet_set_classpath
77$(call gb_JavaClassSet_get_target,$(1)) : CLASSPATH := $(2)
78
79endef
80
81# vim: set noet sw=4 ts=4:
82