Branch libreoffice-5-0-4
[LibreOffice.git] / solenv / gbuild / PrecompiledHeaders.mk
blob089cdb8d14bcdabd19dce8a1280958bc56a56581
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
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/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 # PrecompiledHeader class
23 ifeq ($(gb_ENABLE_PCH),$(true))
25 # gb_PrecompiledHeader_get_enableflags defined by platform
26 ifneq ($(strip $(gb_DEBUGLEVEL)$(gb_SYMBOLS)),0)
27 gb_PrecompiledHeader_DEBUGDIR := debug
28 else
29 gb_PrecompiledHeader_DEBUGDIR := nodebug
30 endif
32 $(call gb_PrecompiledHeader_get_dep_target,%) :
33 $(call gb_Helper_abbreviate_dirs,\
34 mkdir -p $(dir $@) && \
35 echo "$(call gb_PrecompiledHeader_get_target,$*) : $(gb_Helper_PHONY)" > $@)
37 # despite this being only one .d file, need to run concat-deps on it to
38 # re-write external headers from UnpackedTarball
39 $(call gb_PrecompiledHeader_get_target,%) :
40 rm -f $@
41 $(call gb_PrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_PrecompiledHeader_EXCEPTIONFLAGS),$(INCLUDE))
42 ifeq ($(gb_FULLDEPS),$(true))
43 $(call gb_Helper_abbreviate_dirs,\
44 RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,$(call gb_PrecompiledHeader_get_dep_target_tmp,$*)) && \
45 $(call gb_Executable_get_command,concat-deps) $${RESPONSEFILE} \
46 > $(call gb_PrecompiledHeader_get_dep_target,$*) && \
47 rm -f $${RESPONSEFILE} $(call gb_PrecompiledHeader_get_dep_target_tmp,$*))
48 endif
50 .PHONY : $(call gb_PrecompiledHeader_get_clean_target,%)
51 $(call gb_PrecompiledHeader_get_clean_target,%) :
52 $(call gb_Output_announce,$*,$(false),PCH,1)
53 -$(call gb_Helper_abbreviate_dirs,\
54 rm -f $(call gb_PrecompiledHeader_get_target,$*) \
55 $(call gb_PrecompiledHeader_get_target,$*).obj \
56 $(call gb_PrecompiledHeader_get_target,$*).pdb \
57 $(call gb_PrecompiledHeader_get_timestamp,$*) \
58 $(call gb_PrecompiledHeader_get_dep_target,$*))
60 endif
62 $(call gb_PrecompiledHeader_get_timestamp,%) :
63 mkdir -p $(dir $@) && touch $@
65 # vim: set noet sw=4: