~ubuntu-branches/ubuntu/natty/monodevelop/natty

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.Autotools/templates/Makefile.include

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-03-29 23:36:33 UTC
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: james.westby@ubuntu.com-20080329233633-l550uuwvfh1e68at
Tags: upstream-1.0+dfsg
ImportĀ upstreamĀ versionĀ 1.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
VALID_CULTURES = %%VALID_CULTURES%%
 
2
 
1
3
build_sources = $(FILES) $(GENERATED_FILES)
2
4
build_sources_embed = $(build_sources:%='$(srcdir)/%')
3
5
 
4
6
comma__=,
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)))))
 
10
 
 
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))
8
16
 
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))
 
20
 
 
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:%')
13
 
 
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)/%')
17
27
 
22
32
build_references_ref += $(foreach ref, $(DLL_REFERENCES), -r:$(ref))
23
33
build_references_ref += $(foreach ref, $(PROJECT_REFERENCES), -r:$(ref))
24
34
 
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)/*
28
38
 
29
39
pkglib_SCRIPTS = $(ASSEMBLY)
30
40
bin_SCRIPTS = $(BINARIES)
31
41
 
32
42
%%DEPLOY_DIRS%%
 
43
 
 
44
# macros
 
45
 
 
46
# $(call emit-deploy-target,deploy-variable-name)
 
47
define emit-deploy-target
 
48
$($1): $($1_SOURCE)
 
49
        mkdir -p $$(dir $($1))
 
50
        cp '$$<' '$$@'
 
51
endef
 
52
 
 
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%%
 
58
        mkdir -p '$$(@D)'
 
59
        cp '$$<' '$$@'
 
60
        $(if $3,chmod +x '$$@')
 
61
%%WRAPPER_SED%%
 
62
endef
 
63
 
 
64
# generating satellite assemblies
 
65
 
 
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)))
 
72
 
 
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)))))
 
75
 
 
76
$(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME):
 
77
        mkdir -p '$(@D)'
 
78
        $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*)