1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28
29# PrecompiledHeader class
30
31ifeq ($(gb_ENABLE_PCH),$(true))
32
33# gb_PrecompiledHeader_get_enableflags defined by platform
34ifeq ($(gb_DEBUGLEVEL),2)
35gb_PrecompiledHeader_DEBUGDIR := debug
36gb_NoexPrecompiledHeader_DEBUGDIR := debug
37else
38gb_PrecompiledHeader_DEBUGDIR := nodebug
39gb_NoexPrecompiledHeader_DEBUGDIR := nodebug
40endif
41
42$(call gb_PrecompiledHeader_get_dep_target,%) :
43	$(call gb_Helper_abbreviate_dirs,\
44		mkdir -p $(dir $@) && \
45		echo '$(call gb_PrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
46
47$(call gb_NoexPrecompiledHeader_get_dep_target,%) :
48	$(call gb_Helper_abbreviate_dirs,\
49		mkdir -p $(dir $@) && \
50		echo '$(call gb_NoexPrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
51
52$(call gb_PrecompiledHeader_get_target,%) :
53	$(call gb_PrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_PrecompiledHeader_EXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
54
55$(call gb_NoexPrecompiledHeader_get_target,%) :
56	$(call gb_NoexPrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
57
58.PHONY : $(call gb_PrecompiledHeader_get_clean_target,%) $(call gb_NoExPrecompiledHeader_get_clean_target,%)
59$(call gb_PrecompiledHeader_get_clean_target,%) :
60	$(call gb_Output_announce,$*,$(false),PCH,1)
61	-$(call gb_Helper_abbreviate_dirs,\
62		rm -f $(call gb_PrecompiledHeader_get_target,$*) \
63		    $(call gb_PrecompiledHeader_get_target,$*).obj \
64		    $(call gb_PrecompiledHeader_get_target,$*).pdb \
65			$(call gb_PrecompiledHeader_get_dep_target,$*))
66
67
68$(call gb_NoexPrecompiledHeader_get_clean_target,%) :
69	$(call gb_Output_announce,$*,$(false),PCH,1)
70	-$(call gb_Helper_abbreviate_dirs,\
71		rm -f $(call gb_NoexPrecompiledHeader_get_target,$*) \
72		    $(call gb_NoexPrecompiledHeader_get_target,$*).obj \
73		    $(call gb_NoexPrecompiledHeader_get_target,$*).pdb \
74			$(call gb_NoexPrecompiledHeader_get_dep_target,$*))
75endif
76
77# vim: set noet sw=4 ts=4:
78