Bump for 3.6-28
[LibreOffice.git] / solenv / gbuild / WinResTarget.mk
blob1731db63a38a23d61072d5e507f43064f229ccc1
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # WinResTarget class
5 gb_WinResTarget_DEFAULTDEFS := $(gb_RCDEFS)
7 define gb_WinResTarget_WinResTarget
8 $(call gb_WinResTarget_WinResTarget_init,$(1))
9 $$(eval $$(call gb_Module_register_target,$(call gb_WinResTarget_get_target,$(1)),$(call gb_WinResTarget_get_clean_target,$(1))))
11 endef
13 define gb_WinResTarget_WinResTarget_init
14 $(call gb_WinResTarget_get_target,$(1)) : DEFS := $(gb_WinResTarget_DEFAULTDEFS)
15 $(call gb_WinResTarget_get_target,$(1)) : INCLUDE := $(SOLARINC)
16 $(call gb_WinResTarget_get_clean_target,$(1)) : RCFILE :=
17 $(call gb_WinResTarget_get_target,$(1)) : RCFILE :=
19 ifeq ($(gb_FULLDEPS),$(true))
20 $(call gb_WinResTarget_get_dep_target,$(1)) : DEFS := $$(gb_WinResTarget_DEFAULTDEFS)
21 $(call gb_WinResTarget_get_dep_target,$(1)) : INCLUDE := $$(gb_WinResTarget_INCLUDE)
22 $(call gb_WinResTarget_get_dep_target,$(1)) : RCFILE :=
24 -include $(call gb_WinResTarget_get_dep_target,$(1))
25 endif
27 endef
29 ifeq ($(gb_FULLDEPS),$(true))
30 $(call gb_WinResTarget_get_dep_target,%) :
31 $(call gb_WinResTarget__command_dep,$@,$*,$<)
32 endif
35 $(call gb_WinResTarget_get_target,%) :
36 $(call gb_WinResTarget__command,$@,$*,$<)
38 $(call gb_WinResTarget_get_clean_target,%) :
39 $(call gb_Output_announce,$*,$(false),RES,3)
40 $(call gb_Helper_abbreviate_dirs,\
41 rm -f $(call gb_WinResTarget_get_target,$*) \
42 $(call gb_WinResTarget_get_dep_target,$*))
44 define gb_WinResTarget_set_defs
45 $$(call gb_Output_error,gb_WinResTarget_set_defs: use gb_WinResTarget_add_defs instead.)
46 endef
48 define gb_WinResTarget_add_defs
49 $(call gb_WinResTarget_get_target,$(1)) : DEFS += $(2)
51 ifeq ($(gb_FULLDEPS),$(true))
52 $(call gb_WinResTarget_get_dep_target,$(1)) : DEFS += $(2)
53 endif
55 endef
57 define gb_WinResTarget__add_include
58 $(call gb_WinResTarget_get_target,$(1)) : INCLUDE += -I$(2)
60 ifeq ($(gb_FULLDEPS),$(true))
61 $(call gb_WinResTarget_get_dep_target,$(1)) : INCLUDE += -I$(2)
62 endif
64 endef
66 define gb_WinResTarget_set_include
67 $(call gb_WinResTarget_get_target,$(1)) : INCLUDE := $(2)
69 ifeq ($(gb_FULLDEPS),$(true))
70 $(call gb_WinResTarget_get_dep_target,$(1)) : INCLUDE := $(2)
71 endif
73 endef
75 define gb_WinResTarget_add_file
76 $$(call gb_Output_error,gb_WinResTarget_add_file: use gb_WinResTarget_set_rcfile instead.)
77 endef
79 define gb_WinResTarget_set_rcfile
80 $(call gb_WinResTarget_get_clean_target,$(1)) : RCFILE := $(SRCDIR)/$(strip $(2)).rc
81 $(call gb_WinResTarget_get_target,$(1)) : RCFILE := $(SRCDIR)/$(strip $(2)).rc
82 $(call gb_WinResTarget_get_target,$(1)) : $$(RCFILE)
84 ifeq ($(gb_FULLDEPS),$(true))
85 $(call gb_WinResTarget_get_dep_target,$(1)) : RCFILE := $(SRCDIR)/$(strip $(2)).rc
86 endif
88 endef
90 define gb_WinResTarget_add_dependency
91 $(call gb_WinResTarget_get_target,$(1)) : $(SRCDIR)/$(strip $(2))
93 endef
95 define gb_WinResTarget_add_dependencies
96 $(foreach dep,$(2),$(call gb_WinResTarget_add_dependency,$(1),$(dep)))
98 endef
100 define gb_WinResTarget__use_custom_headers
101 $(call gb_WinResTarget_get_target,$(1)) : $(call gb_CustomTarget_get_target,$(2))
102 $(call gb_WinResTarget__add_include,$(1),$(call gb_CustomTarget_get_workdir,$(2)))
104 endef
106 define gb_WinResTarget_use_custom_headers
107 $(foreach customtarget,$(2),$(call gb_WinResTarget__use_custom_headers,$(1),$(customtarget)))
109 endef
111 # vim: set noet sw=4 ts=4: