1
VALID_CULTURES = %%VALID_CULTURES%%
1
3
build_sources = $(FILES) $(GENERATED_FILES)
2
4
build_sources_embed = $(build_sources:%='$(srcdir)/%')
5
build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(firstword $(subst $(comma__), ,$(res)))),$(res),))
6
build_others_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(firstword $(subst $(comma__), ,$(res)))), ,$(res)))
7
get_resource_name = $(firstword $(subst $(comma__), ,$1))
8
get_culture = $(lastword $(subst ., ,$(basename $1)))
9
is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1)))))
11
build_resx_list = $(foreach res, $(RESOURCES), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),))
12
build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
13
build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
14
build_others_list = $(build_non_culture_others_list)
7
15
build_xamlg_list = $(filter %.xaml.g.cs, $(FILES))
9
build_resx_files = $(foreach res, $(build_resx_list), $(firstword $(subst $(comma__), ,$(res))))
17
# resgen all .resx resources
18
build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res)))
10
19
build_resx_resources = $(build_resx_files:.resx=.resources)
11
build_resx_resources_hack = $(subst .resx,.resources, $(build_resx_list))
21
# embed resources for the main assembly
22
build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list))
12
23
build_resx_resources_embed = $(build_resx_resources_hack:%='-resource:%')
14
build_others_files = $(foreach res, $(build_others_list), $(firstword $(subst $(comma__), ,$(res))))
24
build_others_files = $(foreach res, $(build_others_list),$(call get_resource_name,$(res)))
15
25
build_others_resources = $(build_others_files)
16
26
build_others_resources_embed = $(build_others_list:%='-resource:$(srcdir)/%')
22
32
build_references_ref += $(foreach ref, $(DLL_REFERENCES), -r:$(ref))
23
33
build_references_ref += $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref))
25
EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES)
26
CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources)
35
EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files)
36
CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list)
27
37
DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/*
29
39
pkglib_SCRIPTS = $(ASSEMBLY)
30
40
bin_SCRIPTS = $(BINARIES)
46
# $(call emit-deploy-target,deploy-variable-name)
47
define emit-deploy-target
49
mkdir -p $$(dir $($1))
53
# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x)
54
# assumes that for a wrapper foo.pc its source template is foo.pc.in
55
# if $3 is non-empty then wrapper is marked exec
56
define emit-deploy-wrapper
57
$($1): $2 %%CONFIG_MAKE_DEP%%
60
$(if $3,chmod +x '$$@')
64
# generating satellite assemblies
66
culture_resources = $(foreach res, $(RESOURCES), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res)))
67
cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res)))))
68
culture_resource_dependencies = $(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2)
69
culture_resource_commandlines = cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)'
70
build_satellite_assembly_list = $(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME))
71
build_culture_res_files = $(foreach res, $(culture_resources),$(call get_resource_name,$(res)))
73
$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res))))))
74
$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res)))))
76
$(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME):
78
$(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*)