mksymbian.pas 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. vSDKUtil := TSDKUtil.Create;
  29. vCmdLine := TCmdLine.Create;
  30. vCompiler := TCompiler.Create;
  31. vProject := TProject.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. if CompareText(vProject.Language, STR_OPT_Cpp) = 0 then
  41. vCompiler.MakeBuildCpp
  42. else
  43. vCompiler.MakeBuildPascal;
  44. vCompiler.BuildResource(vProject.MainResource);
  45. vCompiler.RegisterInEmulator;
  46. end;
  47. stBuildBindings:
  48. begin
  49. vProject.ParseFile;
  50. vCompiler.MakeBuildBindings;
  51. end;
  52. end;
  53. finally
  54. vCmdLine.Free;
  55. vSDKUtil.Free;
  56. vCompiler.Free;
  57. vProject.Free;
  58. end;
  59. end.