makeproj.mac 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. --
  2. -- makeproj.mac
  3. --
  4. -- This AppleScript builds Code Warrior PRO Release 2 project files for the
  5. -- libjpeg library as well as the test programs 'cjpeg', 'djpeg', 'jpegtran'.
  6. -- (We'd distribute real project files, except they're not text
  7. -- and would create maintenance headaches.)
  8. --
  9. -- The script then compiles and links the library and the test programs.
  10. -- NOTE: if you haven't already created a 'jconfig.h' file, the script
  11. -- automatically copies 'jconfig.mac' to 'jconfig.h'.
  12. --
  13. -- To use this script, you must have AppleScript 1.1 or later installed
  14. -- and a suitable AppleScript editor like Script Editor or Script Debugger
  15. -- (http://www.latenightsw.com). Open this file with your AppleScript
  16. -- editor and execute the "run" command to build the projects.
  17. --
  18. -- Thanks to Dan Sears and Don Agro for this script.
  19. -- Questions about this script can be addressed to dogpark@interlog.com
  20. --
  21. on run
  22. choose folder with prompt ">>> Select IJG source folder <<<"
  23. set ijg_folder to result
  24. choose folder with prompt ">>> Select MetroWerks folder <<<"
  25. set cw_folder to result
  26. -- if jconfig.h doesn't already exist, copy jconfig.mac
  27. tell application "Finder"
  28. if not (exists file "jconfig.h" of ijg_folder) then
  29. duplicate {file "jconfig.mac" of folder ijg_folder}
  30. select file "jconfig.mac copy" of folder ijg_folder
  31. set name of selection to "jconfig.h"
  32. end if
  33. end tell
  34. tell application "CodeWarrior IDE 2.1"
  35. with timeout of 10000 seconds
  36. -- create libjpeg project
  37. activate
  38. Create Project (ijg_folder as string) & "libjpeg.proj"
  39. Set Preferences of panel "Target Settings" to {Target Name:"libjpeg"}
  40. Set Preferences of panel "PPC Project" to {File Name:"libjpeg"}
  41. Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
  42. Set Preferences of panel "PPC Project" to {Project Type:library}
  43. Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
  44. Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
  45. Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
  46. Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
  47. Add Files (ijg_folder as string) & "jcapimin.c" To Segment 1
  48. Add Files (ijg_folder as string) & "jcapistd.c" To Segment 1
  49. Add Files (ijg_folder as string) & "jctrans.c" To Segment 1
  50. Add Files (ijg_folder as string) & "jcparam.c" To Segment 1
  51. Add Files (ijg_folder as string) & "jdatadst.c" To Segment 1
  52. Add Files (ijg_folder as string) & "jcinit.c" To Segment 1
  53. Add Files (ijg_folder as string) & "jcmaster.c" To Segment 1
  54. Add Files (ijg_folder as string) & "jcmarker.c" To Segment 1
  55. Add Files (ijg_folder as string) & "jcmainct.c" To Segment 1
  56. Add Files (ijg_folder as string) & "jcprepct.c" To Segment 1
  57. Add Files (ijg_folder as string) & "jccoefct.c" To Segment 1
  58. Add Files (ijg_folder as string) & "jccolor.c" To Segment 1
  59. Add Files (ijg_folder as string) & "jcsample.c" To Segment 1
  60. Add Files (ijg_folder as string) & "jchuff.c" To Segment 1
  61. Add Files (ijg_folder as string) & "jcphuff.c" To Segment 1
  62. Add Files (ijg_folder as string) & "jcdctmgr.c" To Segment 1
  63. Add Files (ijg_folder as string) & "jfdctfst.c" To Segment 1
  64. Add Files (ijg_folder as string) & "jfdctflt.c" To Segment 1
  65. Add Files (ijg_folder as string) & "jfdctint.c" To Segment 1
  66. Add Files (ijg_folder as string) & "jdapimin.c" To Segment 1
  67. Add Files (ijg_folder as string) & "jdapistd.c" To Segment 1
  68. Add Files (ijg_folder as string) & "jdtrans.c" To Segment 1
  69. Add Files (ijg_folder as string) & "jdatasrc.c" To Segment 1
  70. Add Files (ijg_folder as string) & "jdmaster.c" To Segment 1
  71. Add Files (ijg_folder as string) & "jdinput.c" To Segment 1
  72. Add Files (ijg_folder as string) & "jdmarker.c" To Segment 1
  73. Add Files (ijg_folder as string) & "jdhuff.c" To Segment 1
  74. Add Files (ijg_folder as string) & "jdphuff.c" To Segment 1
  75. Add Files (ijg_folder as string) & "jdmainct.c" To Segment 1
  76. Add Files (ijg_folder as string) & "jdcoefct.c" To Segment 1
  77. Add Files (ijg_folder as string) & "jdpostct.c" To Segment 1
  78. Add Files (ijg_folder as string) & "jddctmgr.c" To Segment 1
  79. Add Files (ijg_folder as string) & "jidctfst.c" To Segment 1
  80. Add Files (ijg_folder as string) & "jidctflt.c" To Segment 1
  81. Add Files (ijg_folder as string) & "jidctint.c" To Segment 1
  82. Add Files (ijg_folder as string) & "jidctred.c" To Segment 1
  83. Add Files (ijg_folder as string) & "jdsample.c" To Segment 1
  84. Add Files (ijg_folder as string) & "jdcolor.c" To Segment 1
  85. Add Files (ijg_folder as string) & "jquant1.c" To Segment 1
  86. Add Files (ijg_folder as string) & "jquant2.c" To Segment 1
  87. Add Files (ijg_folder as string) & "jdmerge.c" To Segment 1
  88. Add Files (ijg_folder as string) & "jcomapi.c" To Segment 1
  89. Add Files (ijg_folder as string) & "jutils.c" To Segment 1
  90. Add Files (ijg_folder as string) & "jerror.c" To Segment 1
  91. Add Files (ijg_folder as string) & "jmemmgr.c" To Segment 1
  92. Add Files (ijg_folder as string) & "jmemmac.c" To Segment 1
  93. -- compile and link the library
  94. Make Project
  95. Close Project
  96. -- create cjpeg project
  97. activate
  98. Create Project (ijg_folder as string) & "cjpeg.proj"
  99. Set Preferences of panel "Target Settings" to {Target Name:"cjpeg"}
  100. Set Preferences of panel "PPC Project" to {File Name:"cjpeg"}
  101. Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
  102. Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
  103. Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
  104. Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
  105. Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
  106. Add Files (ijg_folder as string) & "cjpeg.c" To Segment 1
  107. Add Files (ijg_folder as string) & "rdppm.c" To Segment 1
  108. Add Files (ijg_folder as string) & "rdgif.c" To Segment 1
  109. Add Files (ijg_folder as string) & "rdtarga.c" To Segment 1
  110. Add Files (ijg_folder as string) & "rdrle.c" To Segment 1
  111. Add Files (ijg_folder as string) & "rdbmp.c" To Segment 1
  112. Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
  113. Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
  114. Add Files (ijg_folder as string) & "libjpeg" To Segment 2
  115. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
  116. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
  117. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
  118. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
  119. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
  120. -- compile and link cjpeg
  121. Make Project
  122. Close Project
  123. -- create djpeg project
  124. activate
  125. Create Project (ijg_folder as string) & "djpeg.proj"
  126. Set Preferences of panel "Target Settings" to {Target Name:"djpeg"}
  127. Set Preferences of panel "PPC Project" to {File Name:"djpeg"}
  128. Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
  129. Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
  130. Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
  131. Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
  132. Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
  133. Add Files (ijg_folder as string) & "djpeg.c" To Segment 1
  134. Add Files (ijg_folder as string) & "wrppm.c" To Segment 1
  135. Add Files (ijg_folder as string) & "wrgif.c" To Segment 1
  136. Add Files (ijg_folder as string) & "wrtarga.c" To Segment 1
  137. Add Files (ijg_folder as string) & "wrrle.c" To Segment 1
  138. Add Files (ijg_folder as string) & "wrbmp.c" To Segment 1
  139. Add Files (ijg_folder as string) & "rdcolmap.c" To Segment 1
  140. Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
  141. Add Files (ijg_folder as string) & "libjpeg" To Segment 2
  142. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
  143. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
  144. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
  145. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
  146. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
  147. -- compile and link djpeg
  148. Make Project
  149. Close Project
  150. -- create jpegtran project
  151. activate
  152. Create Project (ijg_folder as string) & "jpegtran.proj"
  153. Set Preferences of panel "Target Settings" to {Target Name:"jpegtran"}
  154. Set Preferences of panel "PPC Project" to {File Name:"jpegtran"}
  155. Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
  156. Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
  157. Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
  158. Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
  159. Set Preferences of panel "PPC Linker" to {Generate SYM File:false}
  160. Add Files (ijg_folder as string) & "jpegtran.c" To Segment 1
  161. Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
  162. Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
  163. Add Files (ijg_folder as string) & "transupp.c" To Segment 1
  164. Add Files (ijg_folder as string) & "libjpeg" To Segment 2
  165. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
  166. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
  167. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3
  168. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
  169. Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4
  170. -- compile and link jpegtran
  171. Make Project
  172. Close Project
  173. quit
  174. end timeout
  175. end tell
  176. end run