Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.5 KiB

  1. !ifndef LANGUAGE
  2. LANGUAGE=eng
  3. !endif
  4. LANG_TOK=.\$(@F)
  5. COMMON_LANG_TOKDIR=..\..\..\common\tokens\$(LANGUAGE)
  6. BUILD_CONTROL=$(LOROOT)\makefile.inc $(LOROOT)\sources.inc
  7. LOCALIZEDBINLIST=..\..\localize.lst
  8. !ifdef WORKING_DIR
  9. BINPLACE_PLACEFILE=$(WORKING_DIR)\placefil.txt
  10. !else
  11. BINPLACE_PLACEFILE=$(TARGETPATH)\placefil.txt
  12. !endif
  13. !if ("$(MULTI_LINGUAL)" == "1")
  14. MULTI_TEMPFILE=$(WORKING_DIR)\$(@B).tmp
  15. US_TOK=$(WORKING_DIR)\$(BINARY_NAME).ustok
  16. MULTI_DUMMY=$(WORKING_DIR)\$(BINARY_NAME).$(LANGUAGE).flag
  17. STRIP_TOKEN=bingen -n -f -i 9 1 -p 1252 -t $(UNLOCALIZED_BIN) $(US_TOK)
  18. LOCALIZE_CMD=-bingen -n -l -f -i 9 1 -o $(PRILANG) $(SECLANG) -p $(CODEPAGE) -a $@ $(LANG_TOK) $(MULTI_TEMPFILE)
  19. !else
  20. LOCALIZE_CMD=-bingen -n -l -f -i 9 1 -o $(PRILANG) $(SECLANG) -p $(CODEPAGE) -r $(UNLOCALIZED_BIN) $(LANG_TOK) $@
  21. !endif
  22. $(NTTARGETFILES): $(BINPLACE_PLACEFILE) $(BUILD_CONTROL) $(LOCALIZEDBINLIST)
  23. -$(MAKE) -NOLOGO BINARY_NAME=$(@F:|=.) UNLOCALIZED_BIN=$(@:|=.) WORKING_DIR=$(TARGETPATH) $(TARGETPATH)\$(@F:|=.) MULTI_LINGUAL=$(MULTI_LINGUAL) ALT_PROJECT_TARGET=. LANG_TOK=.\$(@F:|=.)
  24. $(BINPLACE_PLACEFILE): $(LOCALIZEDBINLIST)
  25. @echo Build_Status Generating : $@
  26. !if ( "$(MULTI_PLACEFILE)" == "1")
  27. -for %a in ($(PRELOCBINS)) do @echo %~nxa LOCALIZED\MULTI>>$@
  28. !else
  29. -for %a in ($(PRELOCBINS)) do @echo %~nxa LOCALIZED\$(LANGUAGE)>>$@
  30. !endif
  31. @if not exist $@ @echo MISC-WORK : ERROR GENFAIL : $@ not generated
  32. $(WORKING_DIR)\$(BINARY_NAME): $(UNLOCALIZED_BIN) \
  33. !if ("$(MULTI_LINGUAL)" == "1")
  34. $(US_TOK) \
  35. $(MULTI_DUMMY) \
  36. !endif
  37. $(LANG_TOK)
  38. !if ("$(MULTI_LINGUAL)" == "1")
  39. @echo Build_Status LOCALIZING (MULTI) : Adding $(LANGUAGE) resources to $(@F:|=.)
  40. if not exist $@ copy $(UNLOCALIZED_BIN) $@
  41. $(LOCALIZE_CMD)
  42. @if not exist $(MULTI_TEMPFILE) echo localizing : ERROR MULTI-LOCFAIL : Localization of $@ for $(LANGUAGE) failed
  43. if exist $(MULTI_TEMPFILE) (del $@ & ren $(MULTI_TEMPFILE) $(@F))
  44. !else
  45. @echo Build_Status LOCALIZING (MONO) : Creating $(@F:|=.) for $(LANGUAGE)
  46. $(LOCALIZE_CMD)
  47. !endif
  48. $(BINPLACE_CMD)
  49. @if exist $(COMMON_LANG_TOKDIR)\$(LANG_TOK) del $(LANG_TOK)
  50. @if not exist $@ echo localizing : ERROR LOCFAIL : Localization failed for $@
  51. !if ("$(MULTI_LINGUAL)" == "1")
  52. $(US_TOK):
  53. if not exist $@ @echo Build_Status LOCALIZING (MULTI) : Striping US resources from $(@F:.ustok=) & $(STRIP_TOKEN)
  54. $(MULTI_DUMMY):
  55. echo "">$@
  56. !endif
  57. $(LANG_TOK):
  58. @if exist $(COMMON_LANG_TOKDIR)\$@ copy $(COMMON_LANG_TOKDIR)\$@