Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. echo off
  2. rem ***************************************************************************
  3. rem Generate script file for the linker to go throuth linker command line too
  4. rem long trouble under windows (32 000 char max)
  5. rem ***************************************************************************
  6. rem Lunch in pre-build step is not advised, this commande is run in paralel
  7. rem with build step that can temporarie supress obj file need to run
  8. rem compilation a 2nd time to have a script file up to date for the linker.
  9. rem Run in pre-build step generate trouble in debug mode.
  10. rem
  11. rem Use manual lunch with 2 parameters :
  12. rem create a .bat file per build with the folowing commande :
  13. rem gen__link_ld.bat ./project relative path and .ld file name ./project relative build path
  14. rem in linker commande line pattern replace {INPUT}
  15. rem by -Xlinker --script=${ProjDirPath}/${ConfigName}/___link.ld
  16. rem and add manualy librairie after ___link.ld, in this case library include
  17. rem throuth graphical build setting don't work, they may use {INPUT} from the
  18. rem standard commande
  19. rem ***************************************************************************
  20. echo **************************************************************************
  21. echo ***************************** *****************************
  22. echo ***************************** WARNING *****************************
  23. echo ***************************** *****************************
  24. echo **************************************************************************
  25. echo Generate script file for the linker to go throuth linker command line too
  26. echo long trouble under windows (32 000 char max)
  27. echo
  28. echo List only existing obj file.
  29. echo The best way is to use manual lunch with one .bat file per build.
  30. echo follow information in r e m above to use it.
  31. echo
  32. echo Run this commande evry time that obj liste is modified.
  33. echo WARNING this function don't delete obj file for file recently exclude
  34. echo frome build.
  35. echo To secure the compilation need a clean to suppress all obj, run a first
  36. echo build witch compile all file without error (with only linker error) to
  37. echo generate an obj file listing up to date and run a second buid for a
  38. echo successful linker step. When the OJB file listing is up to date, only
  39. echo eclipse build commande is needed
  40. echo **************************************************************************
  41. echo Linker file use : %1
  42. echo Build path use : %2
  43. echo **************************************************************************
  44.  
  45. setlocal ENABLEDELAYEDEXPANSION
  46. set destination=%2
  47. set destination=%destination:/=%
  48. rem *** Generate obj file listing ***
  49. echo INPUT(>%destination%___link.ld
  50. dir %destination%*.o /s /b >>%destination%___link.ld
  51. echo )>>%destination%___link.ld
  52.  
  53. rem *** Concatenat obj file listing with ld file from parameter 1 ***
  54. set str=%1
  55. set str=%str:/=%
  56. type %str%>>%destination%___link.ld
  57. echo *** OBJ file listing up to date
  58. echo **************************************************************************
  59. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement