1*7871dc3eSAndrew Rist#************************************************************** 2*7871dc3eSAndrew Rist# 3*7871dc3eSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 4*7871dc3eSAndrew Rist# or more contributor license agreements. See the NOTICE file 5*7871dc3eSAndrew Rist# distributed with this work for additional information 6*7871dc3eSAndrew Rist# regarding copyright ownership. The ASF licenses this file 7*7871dc3eSAndrew Rist# to you under the Apache License, Version 2.0 (the 8*7871dc3eSAndrew Rist# "License"); you may not use this file except in compliance 9*7871dc3eSAndrew Rist# with the License. You may obtain a copy of the License at 10*7871dc3eSAndrew Rist# 11*7871dc3eSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 12*7871dc3eSAndrew Rist# 13*7871dc3eSAndrew Rist# Unless required by applicable law or agreed to in writing, 14*7871dc3eSAndrew Rist# software distributed under the License is distributed on an 15*7871dc3eSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*7871dc3eSAndrew Rist# KIND, either express or implied. See the License for the 17*7871dc3eSAndrew Rist# specific language governing permissions and limitations 18*7871dc3eSAndrew Rist# under the License. 19*7871dc3eSAndrew Rist# 20*7871dc3eSAndrew Rist#************************************************************** 21*7871dc3eSAndrew Rist 22*7871dc3eSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweirgb_Helper_NULLFILE := /dev/null 25cdf0e10cSrcweir 26cdf0e10cSrcweirgb_Helper_MISC := $(WORKDIR)/Misc 27cdf0e10cSrcweir 28cdf0e10cSrcweirifeq ($(JAVACOMPILER),) 29cdf0e10cSrcweirJAVACOMPILER := javac 30cdf0e10cSrcweirendif 31cdf0e10cSrcweir 32cdf0e10cSrcweirifeq ($(JAVAINTERPRETER),) 33cdf0e10cSrcweirJAVAINTERPRETER := java 34cdf0e10cSrcweirendif 35cdf0e10cSrcweir 36cdf0e10cSrcweir# general propose phony target 37cdf0e10cSrcweirgb_Helper_PHONY := $(gb_Helper_MISC)/PHONY 38cdf0e10cSrcweir 39cdf0e10cSrcweir# general propose empty dummy target 40cdf0e10cSrcweirgb_Helper_MISCDUMMY := $(gb_Helper_MISC)/DUMMY 41cdf0e10cSrcweir 42cdf0e10cSrcweirgb_Helper_REPOSITORYNAMES := 43cdf0e10cSrcweir 44cdf0e10cSrcweir.PHONY : $(WORKDIR)/Misc/PHONY 45cdf0e10cSrcweir$(gb_Helper_MISCDUMMY) : 46cdf0e10cSrcweir @mkdir -p $(dir $@) && touch $@ 47cdf0e10cSrcweir 48cdf0e10cSrcweirdefine gb_Helper_abbreviate_dirs 49cdf0e10cSrcweirR=$(REPODIR) && \ 50cdf0e10cSrcweir$(subst $(REPODIR)/,$$R/,S=$(SRCDIR) && \ 51cdf0e10cSrcweir$(subst $(SRCDIR)/,$$S/,O=$(OUTDIR)) && \ 52cdf0e10cSrcweir$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,W=$(WORKDIR) && $(subst $(WORKDIR)/,$$W/,$(1))))) 53cdf0e10cSrcweirendef 54cdf0e10cSrcweir 55cdf0e10cSrcweirdefine gb_Helper_make_clean_target 56cdf0e10cSrcweirgb_$(1)_get_clean_target = $(WORKDIR)/Clean/$(1)/$$(1) 57cdf0e10cSrcweir 58cdf0e10cSrcweirendef 59cdf0e10cSrcweir 60cdf0e10cSrcweirdefine gb_Helper_make_outdir_clean_target 61cdf0e10cSrcweirgb_$(1)_get_clean_target = $$(subst $(OUTDIR)/,$(WORKDIR)/Clean/OutDir/,$$(call gb_$(1)_get_target,$$(1))) 62cdf0e10cSrcweir 63cdf0e10cSrcweirendef 64cdf0e10cSrcweir 65cdf0e10cSrcweirdefine gb_Helper_make_dep_target 66cdf0e10cSrcweirgb_$(1)_get_dep_target = $(WORKDIR)/Dep/$(1)/$$(1).d 67cdf0e10cSrcweir 68cdf0e10cSrcweirendef 69cdf0e10cSrcweir 70cdf0e10cSrcweirdefine gb_Helper_make_clean_targets 71cdf0e10cSrcweir$(foreach targettype,$(1),\ 72cdf0e10cSrcweir $(call gb_Helper_make_clean_target,$(targettype))) 73cdf0e10cSrcweir 74cdf0e10cSrcweirendef 75cdf0e10cSrcweir 76cdf0e10cSrcweirdefine gb_Helper_make_outdir_clean_targets 77cdf0e10cSrcweir$(foreach targettype,$(1),\ 78cdf0e10cSrcweir $(call gb_Helper_make_outdir_clean_target,$(targettype))) 79cdf0e10cSrcweir 80cdf0e10cSrcweirendef 81cdf0e10cSrcweir 82cdf0e10cSrcweirdefine gb_Helper_make_dep_targets 83cdf0e10cSrcweir$(foreach targettype,$(1),\ 84cdf0e10cSrcweir $(call gb_Helper_make_dep_target,$(targettype))) 85cdf0e10cSrcweir 86cdf0e10cSrcweirendef 87cdf0e10cSrcweir 88cdf0e10cSrcweirdefine gb_Helper_get_outdir_clean_target 89cdf0e10cSrcweir$$(subst $(OUTDIR)/,$(WORKDIR)/Clean/OutDir/,$(1)) 90cdf0e10cSrcweirendef 91cdf0e10cSrcweir 92cdf0e10cSrcweirdefine gb_Helper_register_repository 93cdf0e10cSrcweirgb_Helper_CURRENTREPOSITORY := $(1) 94cdf0e10cSrcweirgb_Helper_REPOSITORYNAMES += $(1) 95cdf0e10cSrcweir 96cdf0e10cSrcweirendef 97cdf0e10cSrcweir 98cdf0e10cSrcweirdefine gb_Helper_add_repository 99cdf0e10cSrcweirgb_Helper_CURRENTREPOSITORY := 100cdf0e10cSrcweirinclude $(1)/Repository.mk 101cdf0e10cSrcweirifeq ($$(gb_Helper_CURRENTREPOSITORY),) 102cdf0e10cSrcweir$$(eval $$(call gb_Output_error,No call to gb_Helper_register_repository in Repository.mk for repository $(1))) 103cdf0e10cSrcweirendif 104cdf0e10cSrcweir$$(gb_Helper_CURRENTREPOSITORY) := $(1) 105cdf0e10cSrcweir 106cdf0e10cSrcweirendef 107cdf0e10cSrcweir 108cdf0e10cSrcweirdefine gb_Helper_add_repositories 109cdf0e10cSrcweir$(foreach repo,$(1),$(call gb_Helper_add_repository,$(repo))) 110cdf0e10cSrcweir 111cdf0e10cSrcweirendef 112cdf0e10cSrcweir 113cdf0e10cSrcweirdefine gb_Helper_init_registries 114cdf0e10cSrcweirgb_Executable_VALIDGROUPS := UREBIN SDK OOO BRAND NONE 115cdf0e10cSrcweirgb_Library_VALIDGROUPS := OOOLIBS PLAINLIBS_NONE PLAINLIBS_URE PLAINLIBS_OOO RTLIBS RTVERLIBS STLLIBS UNOLIBS_URE UNOLIBS_OOO UNOVERLIBS 116cdf0e10cSrcweirgb_StaticLibrary_VALIDGROUPS := PLAINLIBS 117cdf0e10cSrcweir 118cdf0e10cSrcweir$$(foreach group,$$(gb_Executable_VALIDGROUPS),$$(eval gb_Executable_$$(group) :=)) 119cdf0e10cSrcweir$$(foreach group,$$(gb_Library_VALIDGROUPS),$$(eval gb_Library_$$(group) :=)) 120cdf0e10cSrcweir$$(foreach group,$$(gb_StaticLibrary_VALIDGROUPS),$$(eval gb_StaticLibrary_$$(group) :=)) 121cdf0e10cSrcweir 122cdf0e10cSrcweirendef 123cdf0e10cSrcweir 124cdf0e10cSrcweirdefine gb_Helper_collect_libtargets 125cdf0e10cSrcweirgb_Library_TARGETS := $$(foreach group,$$(gb_Library_VALIDGROUPS),$$(gb_Library_$$(group))) 126cdf0e10cSrcweirgb_StaticLibrary_TARGETS := $$(foreach group,$$(gb_StaticLibrary_VALIDGROUPS),$$(gb_StaticLibrary_$$(group))) 127cdf0e10cSrcweir 128cdf0e10cSrcweirendef 129cdf0e10cSrcweir 130cdf0e10cSrcweirdefine gb_Helper_collect_knownlibs 131cdf0e10cSrcweirgb_Library_KNOWNLIBS := $$(foreach group,$$(gb_Library_VALIDGROUPS),$$(gb_Library_$$(group))) 132cdf0e10cSrcweirgb_StaticLibrary_KNOWNLIBS := $$(foreach group,$$(gb_StaticLibrary_VALIDGROUPS),$$(gb_StaticLibrary_$$(group))) 133cdf0e10cSrcweir 134cdf0e10cSrcweirendef 135cdf0e10cSrcweir 136cdf0e10cSrcweirdefine gb_Helper_register_executables 137cdf0e10cSrcweirifeq ($$(filter $(1),$$(gb_Executable_VALIDGROUPS)),) 138cdf0e10cSrcweir$$(eval $$(call gb_Output_error,$(1) is not a valid group for executables. Valid groups are: $$(gb_Executable_VALIDGROUPS))) 139cdf0e10cSrcweirendif 140cdf0e10cSrcweir 141cdf0e10cSrcweirgb_Executable_$(1) += $(2) 142cdf0e10cSrcweir 143cdf0e10cSrcweirendef 144cdf0e10cSrcweir 145cdf0e10cSrcweirdefine gb_Helper_register_libraries 146cdf0e10cSrcweirifeq ($$(filter $(1),$$(gb_Library_VALIDGROUPS)),) 147cdf0e10cSrcweir$$(eval $$(call gb_Output_error,$(1) is not a valid group for libraries. Valid groups are: $$(gb_Library_VALIDGROUPS))) 148cdf0e10cSrcweirendif 149cdf0e10cSrcweir 150cdf0e10cSrcweirgb_Library_$(1) += $(2) 151cdf0e10cSrcweir 152cdf0e10cSrcweirendef 153cdf0e10cSrcweir 154cdf0e10cSrcweirdefine gb_Helper_register_static_libraries 155cdf0e10cSrcweirifeq ($$(filter $(1),$$(gb_StaticLibrary_VALIDGROUPS)),) 156cdf0e10cSrcweir$$(eval $$(call gb_Output_error,$(1) is not a valid group for static libraries. Valid groups are: $$(gb_StaticLibrary_VALIDGROUPS))) 157cdf0e10cSrcweirendif 158cdf0e10cSrcweir 159cdf0e10cSrcweirgb_StaticLibrary_$(1) += $(2) 160cdf0e10cSrcweir 161cdf0e10cSrcweirendef 162cdf0e10cSrcweir 163cdf0e10cSrcweir# vim: set noet sw=4 ts=4: 164