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