1SubDir HAIKU_TOP src data keymaps ; 2 3SetSubDirSupportedPlatformsBeOSCompatible ; 4 5NotFile keymap_files ; 6Depends files : keymap_files ; 7 8rule MkKeymapComp 9{ 10 local binary = $(1) ; 11 local source = $(2) ; 12 13 SEARCH on $(source) = $(SEARCH_SOURCE) ; 14 MakeLocateArch $(binary) ; 15 16 LocalDepends keymap_files : $(binary) ; 17 Depends $(binary) : $(source) <build>keymap ; 18 MkKeymapComp1 $(binary) : <build>keymap $(source) ; 19 LocalClean clean : $(binary) ; 20} 21 22actions MkKeymapComp1 23{ 24 $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) 25 $(2[1]) -o "$(1)" -c "$(2[2-])" ; 26} 27 28 29rule AddKeymapAlias alias : keymap 30{ 31 alias = $(alias:G=keymap) ; 32 HAIKU_KEYMAP_FILE on $(alias) = $(keymap:G=keymap) ; 33 HAIKU_KEYMAP_ALIASES += $(alias) ; 34} 35 36 37rule GenerateKeymapLocalizationHeader keymaps 38{ 39 local keymapNames = $(HAIKU_KEYMAP_FILES:BSM) $(HAIKU_KEYMAP_ALIASES:BSM) ; 40 local header = <keymap-locale>KeymapNames.h ; 41 MakeLocateCommonPlatform $(header) ; 42 Always $(header) ; 43 HAIKU_KEYMAP_NAMES on $(header) = $(keymapNames) ; 44 GenerateKeymapLocalizationHeader1 $(header) ; 45 LocalClean clean : $(header) ; 46} 47 48 49actions GenerateKeymapLocalizationHeader1 50{ 51 $(RM) $(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