summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libjpeg/makeproj.mac
blob: e5b510238b1c096fc70dee01ae862dd0c51d3d5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
--
-- makeproj.mac
--
-- This AppleScript builds Code Warrior PRO Release 2 project files for the
-- libjpeg library as well as the test programs 'cjpeg', 'djpeg', 'jpegtran'.
-- (We'd distribute real project files, except they're not text
-- and would create maintenance headaches.)
--
-- The script then compiles and links the library and the test programs.
-- NOTE: if you haven't already created a 'jconfig.h' file, the script
-- automatically copies 'jconfig.mac' to 'jconfig.h'.
--
-- To use this script, you must have AppleScript 1.1 or later installed
-- and a suitable AppleScript editor like Script Editor or Script Debugger
-- (http://www.latenightsw.com). Open this file with your AppleScript
-- editor and execute the "run" command to build the projects.
--
-- Thanks to Dan Sears and Don Agro for this script.
-- Questions about this script can be addressed to dogpark@interlog.com
--

on run

	choose folder with prompt ">>> Select IJG source folder <<<"
	set ijg_folder to result

	choose folder with prompt ">>> Select MetroWerks folder <<<"
	set cw_folder to result

	-- if jconfig.h doesn't already exist, copy jconfig.mac

	tell application "Finder"
		if not (exists file "jconfig.h" of ijg_folder) then
			duplicate {file "jconfig.mac" of folder ijg_folder}
			select file "jconfig.mac copy" of folder ijg_folder
			set name of selection to "jconfig.h"
		end if
	end tell

	tell application "CodeWarrior IDE 2.1"
	  with timeout of 10000 seconds

		-- create libjpeg project

		activate
		Create Project (ijg_folder as string) & "libjpeg.proj"
		Set Preferences of panel "Target Settings" to {Target Name:"libjpeg"}
		Set Preferences of panel "PPC Project" to {File Name:"libjpeg"}
		Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
		Set Preferences of panel "PPC Project" to {Project Type:library}
		Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
		Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
		Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
		Set Preferences of panel "PPC Linker" to {Generate SYM File:false}

		Add Files (ijg_folder as string) & "jaricom.c" To Segment 1
		Add Files (ijg_folder as string) & "jcapimin.c" To Segment 1
		Add Files (ijg_folder as string) & "jcapistd.c" To Segment 1
		Add Files (ijg_folder as string) & "jcarith.c" To Segment 1
		Add Files (ijg_folder as string) & "jctrans.c" To Segment 1
		Add Files (ijg_folder as string) & "jcparam.c" To Segment 1
		Add Files (ijg_folder as string) & "jdatadst.c" To Segment 1
		Add Files (ijg_folder as string) & "jcinit.c" To Segment 1
		Add Files (ijg_folder as string) & "jcmaster.c" To Segment 1
		Add Files (ijg_folder as string) & "jcmarker.c" To Segment 1
		Add Files (ijg_folder as string) & "jcmainct.c" To Segment 1
		Add Files (ijg_folder as string) & "jcprepct.c" To Segment 1
		Add Files (ijg_folder as string) & "jccoefct.c" To Segment 1
		Add Files (ijg_folder as string) & "jccolor.c" To Segment 1
		Add Files (ijg_folder as string) & "jcsample.c" To Segment 1
		Add Files (ijg_folder as string) & "jchuff.c" To Segment 1
		Add Files (ijg_folder as string) & "jcdctmgr.c" To Segment 1
		Add Files (ijg_folder as string) & "jfdctfst.c" To Segment 1
		Add Files (ijg_folder as string) & "jfdctflt.c" To Segment 1
		Add Files (ijg_folder as string) & "jfdctint.c" To Segment 1
		Add Files (ijg_folder as string) & "jdapimin.c" To Segment 1
		Add Files (ijg_folder as string) & "jdapistd.c" To Segment 1
		Add Files (ijg_folder as string) & "jdarith.c" To Segment 1
		Add Files (ijg_folder as string) & "jdtrans.c" To Segment 1
		Add Files (ijg_folder as string) & "jdatasrc.c" To Segment 1
		Add Files (ijg_folder as string) & "jdmaster.c" To Segment 1
		Add Files (ijg_folder as string) & "jdinput.c" To Segment 1
		Add Files (ijg_folder as string) & "jdmarker.c" To Segment 1
		Add Files (ijg_folder as string) & "jdhuff.c" To Segment 1
		Add Files (ijg_folder as string) & "jdmainct.c" To Segment 1
		Add Files (ijg_folder as string) & "jdcoefct.c" To Segment 1
		Add Files (ijg_folder as string) & "jdpostct.c" To Segment 1
		Add Files (ijg_folder as string) & "jddctmgr.c" To Segment 1
		Add Files (ijg_folder as string) & "jidctfst.c" To Segment 1
		Add Files (ijg_folder as string) & "jidctflt.c" To Segment 1
		Add Files (ijg_folder as string) & "jidctint.c" To Segment 1
		Add Files (ijg_folder as string) & "jdsample.c" To Segment 1
		Add Files (ijg_folder as string) & "jdcolor.c" To Segment 1
		Add Files (ijg_folder as string) & "jquant1.c" To Segment 1
		Add Files (ijg_folder as string) & "jquant2.c" To Segment 1
		Add Files (ijg_folder as string) & "jdmerge.c" To Segment 1
		Add Files (ijg_folder as string) & "jcomapi.c" To Segment 1
		Add Files (ijg_folder as string) & "jutils.c" To Segment 1
		Add Files (ijg_folder as string) & "jerror.c" To Segment 1
		Add Files (ijg_folder as string) & "jmemmgr.c" To Segment 1
		Add Files (ijg_folder as string) & "jmemmac.c" To Segment 1

		-- compile and link the library

		Make Project
		Close Project

		-- create cjpeg project

		activate
		Create Project (ijg_folder as string) & "cjpeg.proj"
		Set Preferences of panel "Target Settings" to {Target Name:"cjpeg"}
		Set Preferences of panel "PPC Project" to {File Name:"cjpeg"}
		Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
		Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
		Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
		Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
		Set Preferences of panel "PPC Linker" to {Generate SYM File:false}

		Add Files (ijg_folder as string) & "cjpeg.c" To Segment 1
		Add Files (ijg_folder as string) & "rdppm.c" To Segment 1
		Add Files (ijg_folder as string) & "rdgif.c" To Segment 1
		Add Files (ijg_folder as string) & "rdtarga.c" To Segment 1
		Add Files (ijg_folder as string) & "rdrle.c" To Segment 1
		Add Files (ijg_folder as string) & "rdbmp.c" To Segment 1
		Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
		Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1

		Add Files (ijg_folder as string) & "libjpeg" To Segment 2

		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3

		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4

		-- compile and link cjpeg

		Make Project
		Close Project

		-- create djpeg project

		activate
		Create Project (ijg_folder as string) & "djpeg.proj"
		Set Preferences of panel "Target Settings" to {Target Name:"djpeg"}
		Set Preferences of panel "PPC Project" to {File Name:"djpeg"}
		Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
		Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
		Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
		Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
		Set Preferences of panel "PPC Linker" to {Generate SYM File:false}

		Add Files (ijg_folder as string) & "djpeg.c" To Segment 1
		Add Files (ijg_folder as string) & "wrppm.c" To Segment 1
		Add Files (ijg_folder as string) & "wrgif.c" To Segment 1
		Add Files (ijg_folder as string) & "wrtarga.c" To Segment 1
		Add Files (ijg_folder as string) & "wrrle.c" To Segment 1
		Add Files (ijg_folder as string) & "wrbmp.c" To Segment 1
		Add Files (ijg_folder as string) & "rdcolmap.c" To Segment 1
		Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1

		Add Files (ijg_folder as string) & "libjpeg" To Segment 2

		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3

		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4

		-- compile and link djpeg

		Make Project
		Close Project

		-- create jpegtran project

		activate
		Create Project (ijg_folder as string) & "jpegtran.proj"
		Set Preferences of panel "Target Settings" to {Target Name:"jpegtran"}
		Set Preferences of panel "PPC Project" to {File Name:"jpegtran"}
		Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
		Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true}
		Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true}
		Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC}
		Set Preferences of panel "PPC Linker" to {Generate SYM File:false}

		Add Files (ijg_folder as string) & "jpegtran.c" To Segment 1
		Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1
		Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1
		Add Files (ijg_folder as string) & "transupp.c" To Segment 1

		Add Files (ijg_folder as string) & "libjpeg" To Segment 2

		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3

		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4
		Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4

		-- compile and link jpegtran

		Make Project
		Close Project

		quit

	  end timeout
	end tell
end run