xref: /haiku/src/data/keymaps/Jamfile (revision 15fb7d88e971c4d6c787c6a3a5c159afb1ebf77b)
1SubDir HAIKU_TOP src data keymaps ;
2
3NotFile keymap_files ;
4Depends files : keymap_files ;
5
6rule MkKeymapComp
7{
8	local binary = $(1) ;
9	local source = $(2) ;
10
11	SEARCH on $(source) = $(SEARCH_SOURCE) ;
12	MakeLocateArch $(binary) ;
13
14	LocalDepends keymap_files : $(binary) ;
15	Depends $(binary) : $(source) <build>keymap ;
16	MkKeymapComp1 $(binary) : <build>keymap $(source) ;
17	LocalClean clean : $(binary) ;
18}
19
20actions MkKeymapComp1
21{
22	$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
23	$(2[1]) -o "$(1)" -c "$(2[2-])"
24}
25
26
27rule AddKeymapAlias alias : keymap
28{
29	alias = $(alias:G=keymap) ;
30	HAIKU_KEYMAP_FILE on $(alias) = $(keymap:G=keymap) ;
31	HAIKU_KEYMAP_ALIASES += $(alias) ;
32}
33
34
35rule GenerateKeymapLocalizationHeader keymaps
36{
37	local keymapNames = $(HAIKU_KEYMAP_FILES:BSM) $(HAIKU_KEYMAP_ALIASES:BSM) ;
38	local header = <keymap-locale>KeymapNames.h ;
39	MakeLocateCommonPlatform $(header) ;
40	Always $(header) ;
41	HAIKU_KEYMAP_NAMES on $(header) = $(keymapNames) ;
42	GenerateKeymapLocalizationHeader1 $(header) ;
43	LocalClean clean : $(header) ;
44}
45
46
47actions GenerateKeymapLocalizationHeader1
48{
49	$(RM) $(1)
50	echo "#undef B_TRANSLATION_CONTEXT" >> $(1)
51	echo "#define B_TRANSLATION_CONTEXT \"KeymapNames\"" >> $(1)
52	for name in "$(HAIKU_KEYMAP_NAMES)" ; do
53		echo "B_TRANSLATE_MARK_VOID(\"$name\")" >> $(1)
54	done
55}
56
57
58local keymapFiles = [ GLOB $(SUBDIR) : *.keymap ] ;
59
60# generate the binary file for the keymap files
61local keymapFile ;
62for keymapFile in [ FGristFiles $(keymapFiles:D=) ] {
63	local binary = $(keymapFile:BG=keymap) ;
64	MkKeymapComp $(binary) : $(keymapFile) ;
65	HAIKU_KEYMAP_FILES += $(binary) ;
66}
67
68AddKeymapAlias Finnish : Swedish ;
69AddKeymapAlias Croatian : Slovene ;
70AddKeymapAlias Brazilian : US-International ;
71
72GenerateKeymapLocalizationHeader ;
73