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 .
22 # defined by platform:
23 # gb_WinResTarget_WinResTarget_platform
25 gb_WinResTarget_DEFAULTDEFS
:= $(gb_RCDEFS
)
27 define gb_WinResTarget_WinResTarget
28 $(call gb_WinResTarget_WinResTarget_init
,$(1))
29 $$(eval
$$(call gb_Module_register_target
,$(call gb_WinResTarget_get_target
,$(1)),$(call gb_WinResTarget_get_clean_target
,$(1))))
30 $(call gb_Helper_make_userfriendly_targets
,$(1),WinResTarget
)
34 define gb_WinResTarget_WinResTarget_init
35 $(call gb_WinResTarget_get_target
,$(1)) : DEFS
:= $(gb_WinResTarget_DEFAULTDEFS
)
36 $(call gb_WinResTarget_get_target
,$(1)) : INCLUDE
:= $(subst -isystem
,-I
,$(SOLARINC
)) -I
$(BUILDDIR
)/config_
$(gb_Side
)
37 $(call gb_WinResTarget_get_clean_target
,$(1)) : RCFILE
:=
38 $(call gb_WinResTarget_get_target
,$(1)) : RCFILE
:=
40 $(call gb_WinResTarget_WinResTarget_platform
,$(1))
42 ifeq ($(gb_FULLDEPS
),$(true
))
43 $(call gb_WinResTarget_get_dep_target
,$(1)) : DEFS
:= $$(gb_WinResTarget_DEFAULTDEFS
)
44 $(call gb_WinResTarget_get_dep_target
,$(1)) : INCLUDE
:= $$(gb_WinResTarget_INCLUDE
) -I
$(BUILDDIR
)/config_
$(gb_Side
)
45 $(call gb_WinResTarget_get_dep_target
,$(1)) : RCFILE
:=
47 -include $(call gb_WinResTarget_get_dep_target
,$(1))
52 ifeq ($(gb_FULLDEPS
),$(true
))
53 $(call gb_WinResTarget_get_dep_target
,%) : $(gb_WinResTarget__command_target
)
54 $(call gb_WinResTarget__command_dep
,$@
,$*,$(call gb_WinResTarget_get_target
,$*))
58 $(call gb_WinResTarget_get_target
,%) :
59 $(call gb_WinResTarget__command
,$@
,$*,$<)
61 $(call gb_WinResTarget_get_clean_target
,%) :
62 $(call gb_Output_announce
,$*,$(false
),RC
,3)
63 $(call gb_Helper_abbreviate_dirs
,\
64 rm -f
$(call gb_WinResTarget_get_target
,$*) \
65 $(call gb_WinResTarget_get_dep_target
,$*))
67 define gb_WinResTarget_set_defs
68 $$(call gb_Output_error
,gb_WinResTarget_set_defs
: use gb_WinResTarget_add_defs instead.
)
71 define gb_WinResTarget_add_defs
72 $(call gb_WinResTarget_get_target
,$(1)) : DEFS
+= $(2)
74 ifeq ($(gb_FULLDEPS
),$(true
))
75 $(call gb_WinResTarget_get_dep_target
,$(1)) : DEFS
+= $(2)
80 define gb_WinResTarget__add_include
81 $(call gb_WinResTarget_get_target
,$(1)) : INCLUDE
+= -I
$(2)
83 ifeq ($(gb_FULLDEPS
),$(true
))
84 $(call gb_WinResTarget_get_dep_target
,$(1)) : INCLUDE
+= -I
$(2)
89 define gb_WinResTarget_set_include
90 $(call gb_WinResTarget_get_target
,$(1)) : INCLUDE
:= $(2)
92 ifeq ($(gb_FULLDEPS
),$(true
))
93 $(call gb_WinResTarget_get_dep_target
,$(1)) : INCLUDE
:= $(2)
98 define gb_WinResTarget_add_file
99 $$(call gb_Output_error
,gb_WinResTarget_add_file
: use gb_WinResTarget_set_rcfile instead.
)
102 define gb_WinResTarget_set_rcfile
103 $(call gb_WinResTarget_get_clean_target
,$(1)) : RCFILE
:= $(SRCDIR
)/$(strip $(2)).rc
104 $(call gb_WinResTarget_get_target
,$(1)) : RCFILE
:= $(SRCDIR
)/$(strip $(2)).rc
105 $(call gb_WinResTarget_get_target
,$(1)) : $(SRCDIR
)/$(strip $(2)).rc
107 ifeq ($(gb_FULLDEPS
),$(true
))
108 $(call gb_WinResTarget_get_dep_target
,$(1)) : RCFILE
:= $(SRCDIR
)/$(strip $(2)).rc
113 define gb_WinResTarget_add_dependency
114 $(call gb_WinResTarget_get_target
,$(1)) : $(SRCDIR
)/$(strip $(2))
118 define gb_WinResTarget_add_dependencies
119 $(foreach dep
,$(2),$(call gb_WinResTarget_add_dependency
,$(1),$(dep
)))
123 define gb_WinResTarget__use_custom_headers
124 $(call gb_WinResTarget_get_target
,$(1)) : $(call gb_CustomTarget_get_target
,$(2))
125 $(call gb_WinResTarget__add_include
,$(1),$(call gb_CustomTarget_get_workdir
,$(2)))
129 define gb_WinResTarget_use_custom_headers
130 $(foreach customtarget
,$(2),$(call gb_WinResTarget__use_custom_headers
,$(1),$(customtarget
)))
134 # vim: set noet sw=4 ts=4: