office-gobmx/solenv/gbuild/JavaClassSet.mk
Michael Meeks 1e4422a4b4 re-base on ALv2 code. Includes:
Patches contributed by Mathias Bauer
        gnumake4 work variously
        http://svn.apache.org/viewvc?view=revision&revision=1394707
        http://svn.apache.org/viewvc?view=revision&revision=1394326
        http://svn.apache.org/viewvc?view=revision&revision=1397337
        http://svn.apache.org/viewvc?view=revision&revision=1397315
        http://svn.apache.org/viewvc?view=revision&revision=1396797

	Patches contributed by Andre Fischer
	Fixed getcsym.awk to handle #-comments that contain special regexp chars.
        http://svn.apache.org/viewvc?view=revision&revision=1230971
	118778: Added ADDITIONAL_REPOSITORIES environment variable and its
	automatic setup in configure.
        http://svn.apache.org/viewvc?view=revision&revision=1232004
	118160: Added external CoinMP library.
        http://svn.apache.org/viewvc?view=revision&revision=1233909

	Patches contributed by Herbert Duerr
	#i119168# use generic LICENSE file for langpacks and sdks
        http://svn.apache.org/viewvc?view=revision&revision=1310178
	macosxotoolhelper: need to quote perl regexp if it may contain regexp metachars
        http://svn.apache.org/viewvc?view=revision&revision=1183367
	allow gbuild with empty sysroot on linux
        http://svn.apache.org/viewvc?view=revision&revision=1179186

	Patches contributed by Ingo Schmidt
	native373: #164472# improvements for msi database
        http://svn.apache.org/viewvc?view=revision&revision=1167540
        http://svn.apache.org/viewvc?view=revision&revision=1167539

	Patches contributed by Jurgen Schmidt
	adapt setup package scripts to handle special DS_Store file for
	developer snapshot builds
        http://svn.apache.org/viewvc?view=revision&revision=1232430
	imported patch extensions_i117681.patch
	http://svn.apache.org/viewvc?view=revision&revision=1172102

	Patches contributed by Michael Stahl
	gbuild: RepositoryFixes.mk should be optional
        http://svn.apache.org/viewvc?view=revision&revision=1166123
	xslt filter: remove the FLA horror
	wordml import filter: replace FLA usage with plain XSLT
	http://svn.apache.org/viewvc?view=revision&revision=1363727

	Patch contributed by Oliver-Rainer Wittmann
	i#88652: applied patch, remove unicows deps
	http://svn.apache.org/viewvc?view=revision&revision=1177585

    Remove lots of OS2 conditionals, re-extract Rhino Java, unwind
    cppunit pieces, cleanup Mac image bits, remove coin-mp and
    re-package lpsolve, Oxygen & Crystal, fixup qstart bits, expand
    MPLv2 subset checking.

Change-Id: Iad5c8a76399620b892671633c0d8c29996db3564
2013-06-03 11:41:36 +01:00

200 lines
6.8 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
gb_JavaClassSet_JAVACCOMMAND := $(ICECREAM_RUN) $(JAVACOMPILER) $(JAVAFLAGS) \
-source $(JAVA_SOURCE_VER) -target $(JAVA_TARGET_VER) \
$(if $(JAVA_CLASSPATH_NOT_SET),-Xlint:-options)
gb_JavaClassSet_JAVACDEBUG :=
# Enforces correct dependency order for possibly generated stuff:
# generated sources, jars/classdirs etc.
gb_JavaClassSet_get_preparation_target = $(WORKDIR)/JavaClassSet/$(1).prepared
ifneq ($(gb_DEBUGLEVEL),0)
gb_JavaClassSet_JAVACDEBUG := -g
endif
define gb_JavaClassSet__command
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
$(if $(filter-out $(JARDEPS),$(4)), \
rm -rf $(call gb_JavaClassSet_get_classdir,$(2))/* && \
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\
$(filter-out $(JARDEPS),$(4))) && \
$(if $(3),$(gb_JavaClassSet_JAVACCOMMAND) \
$(gb_JavaClassSet_JAVACDEBUG) \
-classpath "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \
-d $(call gb_JavaClassSet_get_classdir,$(2)) \
@$$RESPONSEFILE &&) \
rm -f $$RESPONSEFILE &&) \
touch $(1))
endef
$(call gb_JavaClassSet_get_target,%) :
$(call gb_Output_announce,$*,$(true),JCS,3)
$(call gb_JavaClassSet__command,$@,$*,$?,$^)
$(call gb_JavaClassSet_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),JCS,3)
$(call gb_Helper_abbreviate_dirs,\
rm -rf $(dir $(call gb_JavaClassSet_get_target,$*))) \
$(call gb_JavaClassSet_get_preparation_target,$*)
$(call gb_JavaClassSet_get_preparation_target,%) :
mkdir -p $(dir $@) && touch $@
# depend on makefile to enforce a rebuild if files are removed from the classset
define gb_JavaClassSet_JavaClassSet
$(call gb_JavaClassSet_get_target,$(1)) : \
$(gb_Module_CURRENTMAKEFILE) \
$(call gb_JavaClassSet_get_preparation_target,$(1))
$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS := \
$(gb_Module_CURRENTMAKEFILE) \
$(call gb_JavaClassSet_get_preparation_target,$(1))
endef
define gb_JavaClassSet__get_sourcefile
$(SRCDIR)/$(1).java
endef
define gb_JavaClassSet__get_generated_sourcefile
$(WORKDIR)/$(1).java
endef
define gb_JavaClassSet_add_sourcefile
$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet__get_sourcefile,$(2))
endef
define gb_JavaClassSet_add_sourcefiles
$(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_sourcefile,$(1),$(sourcefile)))
endef
define gb_JavaClassSet_add_generated_sourcefile
$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet__get_generated_sourcefile,$(2))
$(call gb_JavaClassSet__get_generated_sourcefile,$(2)) :| $(call gb_JavaClassSet_get_preparation_target,$(1))
endef
define gb_JavaClassSet_add_generated_sourcefiles
$(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_generated_sourcefile,$(1),$(sourcefile)))
endef
define gb_JavaClassSet_set_classpath
$$(call gb_Output_error,\
gb_JavaClassSet_set_classpath: use gb_JavaClassSet_add_classpath instead.)
endef
define gb_JavaClassSet_add_classpath
$(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(if $$(T_CP),$$(T_CP)$$(gb_CLASSPATHSEP))$(strip $(2))
endef
define gb_JavaClassSet_add_jar
$$(call gb_Output_error,\
gb_JavaClassSet_add_jar: use gb_JavaClassSet_use_jar instead.)
endef
define gb_JavaClassSet_use_jar
ifneq (,$$(filter-out $(gb_Jar_KNOWN),$(2)))
$$(eval $$(call gb_Output_info,currently known jars are: $(sort $(gb_Jar_KNOWN)),ALL))
$$(eval $$(call gb_Output_error,Cannot link against jar $$(filter-out $(gb_Jar_KNOWN),$(2)). Jars must be registered in Repository.mk))
endif
$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_Jar_get_outdir_target,$(2))
$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS += $(call gb_Jar_get_outdir_target,$(2))
$(call gb_JavaClassSet_add_classpath,$(1),$(call gb_Jar_get_outdir_target,$(2)))
endef
# this does not generate dependency on the jar
define gb_JavaClassSet_add_system_jar
$$(call gb_Output_error,\
gb_JavaClassSet_add_system_jar: use gb_JavaClassSet_use_system_jar instead.)
endef
define gb_JavaClassSet_use_system_jar
$(call gb_JavaClassSet_add_classpath,$(1),$(2))
endef
define gb_JavaClassSet_add_jars
$$(call gb_Output_error,\
gb_JavaClassSet_add_jars: use gb_JavaClassSet_use_jars instead.)
endef
define gb_JavaClassSet_use_jars
$(foreach jar,$(2),$(call gb_JavaClassSet_use_jar,$(1),$(jar)))
endef
define gb_JavaClassSet_add_system_jars
$$(call gb_Output_error,\
gb_JavaClassSet_add_system_jars: use gb_JavaClassSet_use_system_jars instead.)
endef
define gb_JavaClassSet_use_system_jars
$(foreach jar,$(2),$(call gb_JavaClassSet_use_system_jar,$(1),$(jar)))
endef
define gb_JavaClassSet_add_jar_classset
$$(call gb_Output_error,\
gb_JavaClassSet_add_jar_classset: use gb_JavaClassSet_use_jar_classset instead.)
endef
# gb_JavaClassSet_use_jar_classset: Like gb_JavaClassSet_use_jar, but instead of
# using the jar, use the directory tree with the class files that make up the
# jar. This is sometimes necessary in JunitTests that have test classes in
# packages that belong to a sealed jar.
# $1: token identifying this JavaClassSet
# $2: token identifying the Jar being used
define gb_JavaClassSet_use_jar_classset
$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(2)))
$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS += $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(2)))
$(call gb_JavaClassSet_add_classpath,$(1),$(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,$(2))))
endef
define gb_JavaClassSet_use_external
$$(call gb_Output_error,\
gb_JavaClassSet_use_external: use gb_Jar_use_external instead.)
endef
define gb_JavaClassSet_use_externals
$(foreach external,$(2),$(call gb_JavaClassSet_use_external,$(1),$(external)))
endef
define gb_JavaClassSet_add_customtarget_dependency
$$(call gb_Output_error,\
gb_JavaClassSet_add_customtarget_dependency: use gb_JavaClassSet_use_customtarget instead.)
endef
define gb_JavaClassSet_use_customtarget
$(call gb_JavaClassSet_get_preparation_target,$(1)) : \
$(call gb_CustomTarget_get_target,$(2))
$(call gb_JavaClassSet_add_classpath,$(1),$(call gb_CustomTarget_get_workdir,$(2)))
endef
# vim: set noet sw=4: