~ubuntu-branches/debian/sid/mono-tools/sid

« back to all changes in this revision

Viewing changes to Mono.Profiler/Makefile.include

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-09-13 09:08:47 UTC
  • mfrom: (14.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100913090847-lhu3z021w2azaj8q
Tags: 2.6.2-3
Upload to Debian Unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
VALID_CULTURES =   ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT
2
 
 
3
 
s2q=$(subst \ ,?,$1)
4
 
q2s=$(subst ?,\ ,$1)
5
 
# use this when result will be quoted
6
 
unesc2=$(subst ?, ,$1)
7
 
 
8
 
build_sources = $(FILES) $(GENERATED_FILES)
9
 
build_sources_esc= $(call s2q,$(build_sources))
10
 
# use unesc2, as build_sources_embed is quoted
11
 
build_sources_embed= $(call unesc2,$(build_sources_esc:%='$(srcdir)/%'))
12
 
 
13
 
comma__=,
14
 
get_resource_name = $(firstword $(subst $(comma__), ,$1))
15
 
get_culture =  $(lastword $(subst ., ,$(basename $1)))
16
 
is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1)))))
17
 
 
18
 
RESOURCES_ESC=$(call s2q,$(RESOURCES))
19
 
 
20
 
build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),))
21
 
build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
22
 
build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
23
 
build_others_list = $(build_non_culture_others_list)
24
 
build_xamlg_list = $(filter %.xaml.g.cs, $(FILES))
25
 
 
26
 
# resgen all .resx resources
27
 
build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res)))
28
 
build_resx_resources_esc = $(build_resx_files:.resx=.resources)
29
 
build_resx_resources = $(call q2s,$(build_resx_resources_esc))
30
 
 
31
 
# embed resources for the main assembly
32
 
build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list))
33
 
# use unesc2, as build_resx_resources_embed is quoted
34
 
build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%'))
35
 
build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res))))
36
 
build_others_resources = $(build_others_files)
37
 
# use unesc2, as build_others_resources_embed is quoted
38
 
build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%'))
39
 
 
40
 
build_resources = $(build_resx_resources) $(build_others_resources)
41
 
build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed)
42
 
 
43
 
# -usesourcepath is available only for resgen2
44
 
emit_resgen_target_1=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')'
45
 
emit_resgen_target_2=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); $$(RESGEN) -usesourcepath '$$<' '$$@'
46
 
 
47
 
emit_resgen_target=$(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1))
48
 
emit_resgen_targets=$(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res))))
49
 
 
50
 
build_references_ref = $(call q2s,$(foreach ref, $(call s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref)))))
51
 
build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref)))
52
 
build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), -r:$(ref)))
53
 
 
54
 
s2q2s=$(call unesc2,$(call s2q,$1))
55
 
cp_actual=test -z $1 || cp $1 $2
56
 
cp=$(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)')
57
 
 
58
 
rm_actual=test -z '$1' || rm -f '$2'
59
 
rm=$(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)'))
60
 
 
61
 
EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files)
62
 
CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list)
63
 
DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/*
64
 
 
65
 
pkglib_SCRIPTS = $(ASSEMBLY)
66
 
bin_SCRIPTS = $(BINARIES)
67
 
 
68
 
linuxdesktopapplicationsdir = @datadir@/applications
69
 
linuxdesktopapplications_DATA = $(LINUX_DESKTOPAPPLICATIONS)
70
 
programfilesdir = @libdir@/@PACKAGE@
71
 
programfiles_DATA = $(PROGRAMFILES)
72
 
commonapplicationdatarootmanman1dir = @datadir@/man/man1
73
 
commonapplicationdatarootmanman1_DATA = $(COMMONAPPLICATIONDATAROOT_MAN_MAN1)
74
 
 
75
 
 
76
 
# macros
77
 
 
78
 
# $(call emit-deploy-target,deploy-variable-name)
79
 
define emit-deploy-target
80
 
$($1): $($1_SOURCE)
81
 
        mkdir -p '$$(shell dirname '$$@')'
82
 
        cp '$$<' '$$@'
83
 
endef
84
 
 
85
 
# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x)
86
 
# assumes that for a wrapper foo.pc its source template is foo.pc.in
87
 
# if $3 is non-empty then wrapper is marked exec
88
 
define emit-deploy-wrapper
89
 
$($1): $2 
90
 
        mkdir -p '$$(shell dirname '$$@')'
91
 
        cp '$$<' '$$@'
92
 
        $(if $3,chmod +x '$$@')
93
 
 
94
 
endef
95
 
 
96
 
# generating satellite assemblies
97
 
 
98
 
culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res)))
99
 
cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res)))))
100
 
culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2))
101
 
culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)')
102
 
build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)))
103
 
build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res))))
104
 
 
105
 
$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res))))))
106
 
$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res)))))
107
 
 
108
 
$(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME):
109
 
        mkdir -p '$(@D)'
110
 
        $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*)
 
 
b'\\ No newline at end of file'