mksymbian.pas 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {
  2. mksymbian.pas
  3. Main program file
  4. Copyright (C) 2006-2007 Felipe Monteiro de Carvalho
  5. This file is part of MkSymbian build tool.
  6. MkSymbian is free software;
  7. you can redistribute it and/or modify it under the
  8. terms of the GNU General Public License version 2
  9. as published by the Free Software Foundation.
  10. MkSymbian is distributed in the hope
  11. that it will be useful, but WITHOUT ANY WARRANTY; without even
  12. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  13. PURPOSE. See the GNU General Public License for more details.
  14. Please note that the General Public License version 2 does not permit
  15. incorporating MkSymbian into proprietary programs.
  16. }
  17. program mksymbian;
  18. {$ifdef fpc}
  19. {$mode delphi}{$H+}
  20. {$endif}
  21. {$apptype console}
  22. uses
  23. Classes, SysUtils,
  24. cmdline, constants, cfgfile, sdkutil, compiler, projectparser;
  25. var
  26. opts: TMkSymbianOptions;
  27. begin
  28. vProject := TProject.Create;
  29. vSDKUtil := TSDKUtil.Create;
  30. vCmdLine := TCmdLine.Create;
  31. vCompiler := TCompiler.Create;
  32. try
  33. vCmdLine.ParseCmdLineOptions(opts);
  34. vCompiler.opts := opts;
  35. vProject.opts := opts;
  36. case opts.task of
  37. stBuildApp:
  38. begin
  39. vProject.ParseFile;
  40. { compilation }
  41. if CompareText(vProject.Language, STR_OPT_Cpp) = 0 then
  42. vCompiler.MakeBuildCpp
  43. else
  44. vCompiler.MakeBuildPascal;
  45. if vSDKUtil.SDKVersion = sdkUIQ3 then
  46. begin
  47. { Main resource file }
  48. vCompiler.BuildResource(vProject.MainResource);
  49. vCompiler.InstallResource(vProject.MainResource);
  50. { Registration resource file }
  51. vCompiler.BuildResource(vProject.RegResource);
  52. vCompiler.RegisterInEmulator;
  53. end;
  54. end;
  55. stBuildBindings:
  56. begin
  57. vProject.ParseFile;
  58. vCompiler.MakeBuildBindings;
  59. end;
  60. end;
  61. finally
  62. vCmdLine.Free;
  63. vSDKUtil.Free;
  64. vCompiler.Free;
  65. vProject.Free;
  66. end;
  67. end.