summaryrefslogtreecommitdiffstats
path: root/solenv/gbuild/Jar.mk
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2011-02-23 11:43:04 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-16 10:49:06 +0200
commita308b650377c0cf63e5fbd23bada11f12bc6c698 (patch)
tree885f116d8d75bc7c5901f40baf26821b4ef12f86 /solenv/gbuild/Jar.mk
parentCWS gnumake4: some improvements for zip+jar, documentation (diff)
downloadcore-a308b650377c0cf63e5fbd23bada11f12bc6c698.tar.gz
core-a308b650377c0cf63e5fbd23bada11f12bc6c698.zip
CWS gnumake4: use pattern rules for zip and jar
Diffstat (limited to 'solenv/gbuild/Jar.mk')
-rw-r--r--solenv/gbuild/Jar.mk20
1 files changed, 9 insertions, 11 deletions
diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk
index 7404b39e0d3b..4cb7ecf15a77 100644
--- a/solenv/gbuild/Jar.mk
+++ b/solenv/gbuild/Jar.mk
@@ -60,33 +60,31 @@ $(call gb_Jar_get_clean_target,%) : $(call gb_JavaClassSet_get_clean_target,$(ca
rm -f $(call gb_Jar_get_final_target,$*) && \
rm -f $(call gb_Jar_get_outdir_target,$*))
+# the final target is a touch target; we use it as registered targets should be in workdir, not in outdir
+# the outdir target depends on the workdir target and is built by delivering the latter
+# the workdir target is created by cd'ing to the target directory and adding/updating the files
$(call gb_Jar_get_final_target,%) : $(call gb_Jar_get_outdir_target,%)
$(call gb_Helper_abbreviate_dirs,\
touch $@)
+# rule for creating the jar file using the command defined above
+$(call gb_Jar_get_target,%) : $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,%))
+ $(call gb_Jar__command,$*,$@,$*,$?)
+
# resets scoped variables (see explanations where they are set)
# creates a class set and a dependency to it
# registers target and clean target
# adds jar files to DeliverLogTarget
-# creates a deliver rule
+# adds dependency for outdir target to workdir target (pattern rule for delivery is in Package.mk)
define gb_Jar_Jar
-
$(call gb_Jar_get_target,$(1)) : CLASSPATH := $(value XCLASSPATH)
$(call gb_Jar_get_target,$(1)) : MANIFEST :=
$(call gb_Jar_get_target,$(1)) : JARCLASSPATH :=
$(call gb_Jar_get_target,$(1)) : PACKAGEROOTS :=
-
$(call gb_JavaClassSet_JavaClassSet,$(call gb_Jar_get_classsetname,$(1)))
-$(call gb_Jar_get_target,$(1)) : $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(1)))
- $$(call gb_Jar__command,$(1),$$@,$$*,$$?)
-
-$(call gb_Jar_get_outdir_target,$(1)) : $(call gb_Jar_get_target,$(1))
- $(call gb_Helper_abbreviate_dirs,\
- $$(call gb_Deliver_deliver,$$<,$$@))
-
$(eval $(call gb_Module_register_target,$(call gb_Jar_get_final_target,$(1)),$(call gb_Jar_get_clean_target,$(1))))
-
$(call gb_Deliver_add_deliverable,$(call gb_Jar_get_outdir_target,$(1)),$(call gb_Jar_get_target,$(1)))
+$(call gb_Jar_get_outdir_target,$(1)) : $(call gb_Jar_get_target,$(1))
endef