xref: /aoo41x/main/solenv/gbuild/WinResTarget.mk (revision cdf0e10c)
1
2# WinResTarget class
3
4gb_WinResTarget_DEFAULTDEFS := $(gb_RCDEFS)
5
6define gb_WinResTarget_WinResTarget
7$(call gb_WinResTarget_WinResTarget_init,$(1))
8$$(eval $$(call gb_Module_register_target,$(call gb_WinResTarget_get_target,$(1)),$(call gb_WinResTarget_get_clean_target,$(1))))
9
10endef
11
12define gb_WinResTarget_WinResTarget_init
13$(call gb_WinResTarget_get_target,$(1)) : DEFS := $(gb_WinResTarget_DEFAULTDEFS)
14$(call gb_WinResTarget_get_target,$(1)) : INCLUDE := $(SOLARINC)
15$(call gb_WinResTarget_get_clean_target,$(1)) : RCFILE :=
16$(call gb_WinResTarget_get_target,$(1)) : RCFILE :=
17ifeq ($(gb_FULLDEPS),$(true))
18$(call gb_WinResTarget_get_target,$(1)) : $(call gb_WinResTarget_get_dep_target,$(1))
19ifneq ($(wildcard $(call gb_WinResTarget_get_dep_target,$(1))),)
20include $(call gb_WinResTarget_get_dep_target,$(1))
21else
22$(firstword $(MAKEFILE_LIST)) : $(call gb_WinResTarget_get_dep_target,$(1))
23endif
24$(call gb_WinResTarget_get_dep_target,$(1)) : DEFS := $$(gb_WinResTarget_DEFAULTDEFS)
25$(call gb_WinResTarget_get_dep_target,$(1)) : INCLUDE := $$(gb_WinResTarget_INCLUDE)
26$(call gb_WinResTarget_get_dep_target,$(1)) : RCFILE :=
27endif
28
29endef
30
31ifeq ($(gb_FULLDEPS),$(true))
32$(call gb_WinResTarget_get_dep_target,%) : $(gb_Helper_MISCDUMMY)
33		mkdir -p $(dir $@) && \
34			echo '$(call gb_WinResTarget_get_target,$*) : $$(gb_Helper_PHONY)' > $@
35endif
36
37
38$(call gb_WinResTarget_get_target,%) :
39	$(call gb_Output_announce,$*,$(true),RES,1)
40	$(call gb_WinResTarget__command_dep,$*,$<)
41	$(call gb_Helper_abbreviate_dirs,\
42		mkdir -p $(dir $@))
43	$(call gb_WinResTarget__command,$@)
44
45$(call gb_WinResTarget_get_clean_target,%) :
46	$(call gb_Helper_abbreviate_dirs,\
47		rm -f $(call gb_WinResTarget_get_target,$*))
48
49define gb_WinResTarget_set_defs
50$(call gb_WinResTarget_get_target,$(1)) : DEFS := $(2)
51$(call gb_WinResTarget_get_dep_target,$(1)) : DEFS := $(2)
52
53endef
54
55define gb_WinResTarget_set_include
56$(call gb_WinResTarget_get_target,$(1)) : INCLUDE := $(2)
57
58endef
59
60define gb_WinResTarget_add_file
61$(call gb_WinResTarget_get_clean_target,$(1)) : RCFILE=$(gb_Helper_SRCDIR_NATIVE)/$(2).rc
62$(call gb_WinResTarget_get_target,$(1)) : RCFILE=$(foreach file,$(gb_REPOS),$(realpath $(file)/$(strip $(2)).rc))
63$(call gb_WinResTarget_get_target,$(1)) : $(foreach file,$(gb_REPOS),$(realpath $(file)/$(strip $(2)).rc))
64
65endef
66
67define gb_WinResTarget_add_dependency
68$(call gb_WinResTarget_get_target,$(1)) : $(foreach file,$(2),$(foreach repo,$(gb_REPOS),$(realpath $(repo)/$(strip $(file)))))
69
70endef
71