bump product version to 6.3.0.0.beta1
[LibreOffice.git] / odk / build-examples_common.mk
blob4d7d645ed40abde667ba64697ac8448c1778e173
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 define odk_build-examples_test
12 $(eval $(call gb_CustomTarget_CustomTarget,$(1)))
14 $(call gb_CustomTarget_get_target,$(1)): \
15 $(call gb_CustomTarget_get_workdir,$(1))/setsdkenv
16 ifneq ($(gb_SUPPRESS_TESTS),)
17 @true
18 else
19 $$(call gb_Output_announce,$(subst $(WORKDIR)/,,$(1)),$(true),CHK,1)
20 rm -fr $(call gb_CustomTarget_get_workdir,$(1))/{out,user}
21 ifeq (MACOSX,$(OS))
22 $(eval ODK_BUILD_SHELL := $(shell $(gb_MKTEMP)))
23 cp /bin/sh "$(ODK_BUILD_SHELL)"
24 chmod 0700 "$(ODK_BUILD_SHELL)"
25 endif
26 (saved_library_path=$$$${$(gb_Helper_LIBRARY_PATH_VAR)} && . $$< \
27 $(if $(filter MACOSX,$(OS)),, \
28 && $(gb_Helper_LIBRARY_PATH_VAR)=$$$$saved_library_path) \
29 && export \
30 UserInstallation=$(call gb_Helper_make_url,$(call gb_CustomTarget_get_workdir,$(1))/user) \
31 $(foreach my_dir,$(2), \
32 && (cd $(INSTDIR)/$(SDKDIRNAME)/examples/$(my_dir) \
33 && printf 'yes\n' | LC_ALL=C make \
34 CC="$(CXX)" LINK="$(CXX)" LIB="$(CXX)" \
35 $(if $(filter MACOSX,$(OS)), SHELL=$(ODK_BUILD_SHELL), )))) \
36 >$(call gb_CustomTarget_get_workdir,$(1))/log 2>&1 \
37 || (RET=$$$$? \
38 $(if $(filter MACOSX,$(OS)), && rm -f $(ODK_BUILD_SHELL) , ) \
39 && cat $(call gb_CustomTarget_get_workdir,$(1))/log \
40 && exit $$$$RET)
41 ifeq (MACOSX,$(OS))
42 -rm -f $(ODK_BUILD_SHELL)
43 endif
44 endif
46 $(call gb_CustomTarget_get_workdir,$(1))/setsdkenv: \
47 $(SRCDIR)/odk/config/setsdkenv_unix.sh.in \
48 $(BUILDDIR)/config_$(gb_Side).mk | \
49 $(call gb_CustomTarget_get_workdir,$(1))/.dir
50 $$(call gb_Output_announce,$(subst $(WORKDIR)/,,$(1)),$(true),SED,1)
51 sed -e 's!@OO_SDK_NAME@!sdk!' \
52 -e 's!@OO_SDK_HOME@!$(INSTDIR)/$(SDKDIRNAME)!' \
53 -e 's!@OFFICE_HOME@!$(INSTROOTBASE)!' -e 's!@OO_SDK_MAKE_HOME@!!' \
54 -e 's!@OO_SDK_ZIP_HOME@!!' -e 's!@OO_SDK_CAT_HOME@!!' \
55 -e 's!@OO_SDK_SED_HOME@!!' -e 's!@OO_SDK_CPP_HOME@!!' \
56 -e 's!@OO_SDK_JAVA_HOME@!$(JAVA_HOME)!' \
57 -e 's!@OO_SDK_OUTPUT_DIR@!$(call gb_CustomTarget_get_workdir,$(1))/out!' \
58 -e 's!@SDK_AUTO_DEPLOYMENT@!YES!' $$< > $$@
60 .PHONY: $(call gb_CustomTarget_get_target,$(1))
62 endef
64 # vim: set noet sw=4 ts=4: