Source

cpython-withatomic / RISCOS / Makefile

The branch '2.1' does not exist.
  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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# RISC OS Python
LIBSROOT = $.AcornC_C++.Libraries

# You may need to change some of the following
OSLIB = $(LIBSROOT).OSLib
CLIB = $(LIBSROOT).clib
SOCKLIB = $(LIBSROOT).netlib
DLKLIB = $(LIBSROOT).dlk
ZLIB = $(LIBSROOT).zlib
EXPAT = $(LIBSROOT).expat.lib

OBJSCAN = $(DLKLIB).objscan
MAKEDLK = $(DLKLIB).makedlk

# change from time to time (don't forget to change !Boot also)
TARGET=Python21
BUILD=12


#
# You shouldn't need to change anything below this line
#
OSLIBS = OSLib:Computer,OSLib:Core,OSLib:User

DLKFLAG= -DDLK
DLKOBJS = $(DLKLIB).o.dlk_load @.o.linktab

HEADERS = @,@.^.Include,@.^.Modules,@.^.Objects,@.^.Python,$(CLIB),$(OSLIBS),$(DLKLIB)

CC = cc -c -j$(HEADERS) $(DLKFLAG) -DRISCOS -DHAVE_CONFIG_H -wad -throwback
#-depend !Depend
CCEXPAT = cc -c -j$(HEADERS),$(EXPAT) $(DLKFLAG) -DHAVE_EXPAT_H -DRISCOS -DHAVE_CONFIG_H -wad -throwback

LINK = link
LINKFLAGS = -aif #-NOUNUSED #-d
LOADLIBS = $(CLIB).o.Stubs $(OSLIB).o.OSLib $(DLKOBJS)


.c.o  :
       $(CC) -o $@ $*.c


# code for main Python binary
MODULES_STATIC =\
	@.^.Modules.o.python\
	@.^.Modules.o.main\
	Modules.o.config\
	@.^.Modules.o.getbuildinfo\
	Modules.o.getpath_riscos\
	Modules.o.riscosmodule


# dynamic Modules
MODULES_DYNAMIC =\
	@.^.Lib.array/pyd\
	@.^.Lib.audioop/pyd\
	@.^.Lib.binascii/pyd\
	@.^.Lib.cmath/pyd\
	@.^.Lib.cPickle/pyd\
	@.^.Lib.cStringIO/pyd\
	@.^.Lib.errno/pyd\
	@.^.Lib.imageop/pyd\
	@.^.Lib.math/pyd\
	@.^.Lib.md5/pyd\
	@.^.Lib.new/pyd\
	@.^.Lib.operator/pyd\
	@.^.Lib.parser/pyd\
	@.^.Lib.pcre/pyd\
	@.^.Lib.regex/pyd\
	@.^.Lib.rgbimg/pyd\
	@.^.Lib.rotor/pyd\
	@.^.Lib.sha/pyd\
	@.^.Lib.signal/pyd\
	@.^.Lib.struct/pyd\
	@.^.Lib.time/pyd\
	@.^.Lib._locale/pyd\
	@.^.Lib.zlib/pyd\
	@.^.Lib.select/pyd\
	@.^.Lib._socket/pyd\
	@.^.Lib._codecs/pyd\
	@.^.Lib._weakref/pyd\
	@.^.Lib._testcapi/pyd\
	@.^.Lib.unicodedata/pyd\
	@.^.Lib.xreadlines/pyd\
	@.^.Lib.pyexpat/pyd\
	@.^.Lib.plat-riscos.drawf/pyd\
	@.^.Lib.plat-riscos.swi/pyd\
	@.^.Lib._sre/pyd


OBJECTS_PYTHON =\
	@.^.Python.o.traceback\
	@.^.Python.o.sysmodule\
	@.^.Python.o.structmember\
	@.^.Python.o.strdup\
	@.^.Python.o.sigcheck\
	@.^.Python.o.pythonrun\
	@.^.Python.o.pystate\
	@.^.Python.o.pyfpe\
	@.^.Python.o.mystrtoul\
	@.^.Python.o.modsupport\
	@.^.Python.o.marshal\
	@.^.Python.o.importdl\
	@.^.Python.o.import\
	@.^.Python.o.graminit\
	@.^.Python.o.getversion\
	@.^.Python.o.getplatform\
	@.^.Python.o.getopt\
	@.^.Python.o.getcopyright\
	@.^.Python.o.getcompiler\
	@.^.Python.o.getargs\
	@.^.Python.o.frozenmain\
	@.^.Python.o.frozen\
	@.^.Python.o.errors\
	@.^.Python.o.compile\
	@.^.Python.o.ceval\
	@.^.Python.o.bltinmodule\
	@.^.Python.o.exceptions\
	@.^.Python.o.hypot\
	@.^.Python.o.codecs\
	@.^.Python.o.symtable\
	@.^.Python.o.future


OBJECTS_RISCOS = \
	@.Python.o.dynload_riscos\
	@.Python.o.getcwd_riscos\
	@.Python.o.getmtime_riscos\
	@.o.unixstuff


OBJECTS_OBJECTS =\
	@.^.Objects.o.typeobject\
	@.^.Objects.o.tupleobject\
	@.^.Objects.o.stringobject\
	@.^.Objects.o.sliceobject\
	@.^.Objects.o.rangeobject\
	@.^.Objects.o.object\
	@.^.Objects.o.moduleobject\
	@.^.Objects.o.methodobject\
	@.^.Objects.o.longobject\
	@.^.Objects.o.listobject\
	@.^.Objects.o.intobject\
	@.^.Objects.o.funcobject\
	@.^.Objects.o.frameobject\
	@.^.Objects.o.floatobject\
	@.^.Objects.o.fileobject\
	@.^.Objects.o.dictobject\
	@.^.Objects.o.complexobject\
	@.^.Objects.o.cobject\
	@.^.Objects.o.classobject\
	@.^.Objects.o.cellobject\
	@.^.Objects.o.bufferobject\
	@.^.Objects.o.abstract\
	@.^.Objects.o.unicodectype\
	@.^.Objects.o.unicodeobject


OBJECTS_PARSER =\
	@.^.Parser.o.tokenizer\
	@.^.Parser.o.printgrammar\
	@.^.Parser.o.parsetok\
	@.^.Parser.o.parser\
	@.^.Parser.o.node\
	@.^.Parser.o.myreadline\
	@.^.Parser.o.metagrammar\
	@.^.Parser.o.listnode\
	@.^.Parser.o.intrcheck\
	@.^.Parser.o.grammar1\
	@.^.Parser.o.grammar\
	@.^.Parser.o.firstsets\
	@.^.Parser.o.bitset\
	@.^.Parser.o.acceler

SUPPORT_FILES = @.^.!Boot @.^.!Run @.^.!Sprites @.^.!Sprites22 @.^.AddToPath

OBJECTS = $(OBJECTS_PYTHON) $(OBJECTS_PARSER) $(MODULES_STATIC) $(OBJECTS_OBJECTS) $(OBJECTS_RISCOS)


all: @.^.$(TARGET) $(MODULES_DYNAMIC) $(SUPPORT_FILES)

@.^.Modules.o.getbuildinfo: @.^.Modules.c.getbuildinfo
       $(CC) -DBUILD=$(BUILD) -o @.^.Modules.o.getbuildinfo @.^.Modules.c.getbuildinfo


@.^.$(TARGET):  $(OBJECTS) o.linktab
	$(LINK) -o @.^.$(TARGET) $(OBJECTS) $(LOADLIBS)


#########################################################################
# RISC OS support files
#
@.^.!Boot: support.!Boot
	copy support.!Boot @.^.!Boot ~C~VF
	settype @.^.!Boot feb
@.^.!Run:  support.!Run
	copy support.!Run @.^.!Run ~C~VF
	settype @.^.!Run feb
@.^.!Sprites: support.!Sprites
	copy support.!Sprites @.^.!Sprites ~C~VF
	settype @.^.!Sprites ff9
@.^.!Sprites22: support.!Sprites22
	copy support.!Sprites22 @.^.!Sprites22 ~C~VF
	settype @.^.!Sprites22 ff9
@.^.AddToPath: support.AddToPath
	copy support.AddToPath @.^.AddToPath ~C~VF
	settype @.^.AddToPath ffc


#########################################################################
# Dynamic Modules
#
@.^.Lib.array/pyd: @.^.Modules.o.arraymodule s.linktab
	$(MAKEDLK) -d @.^.Lib.array/pyd -s s.linktab -o @.^.Modules.o.arraymodule -e initarray

@.^.Lib.audioop/pyd: @.^.Modules.o.audioop # s.linktab
	$(MAKEDLK) -d @.^.Lib.audioop/pyd -s s.linktab -o @.^.Modules.o.audioop -e initaudioop

@.^.Lib.binascii/pyd: @.^.Modules.o.binascii s.linktab
	$(MAKEDLK) -d @.^.Lib.binascii/pyd -s s.linktab -o @.^.Modules.o.binascii -e initbinascii

@.^.Lib.cmath/pyd: @.^.Modules.o.cmathmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.cmath/pyd -s s.linktab -o @.^.Modules.o.cmathmodule -e initcmath

@.^.Lib.cPickle/pyd: @.^.Modules.o.cPickle s.linktab
	$(MAKEDLK) -d @.^.Lib.cPickle/pyd -s s.linktab -o @.^.Modules.o.cPickle -e initcPickle

@.^.Lib.cStringIO/pyd: @.^.Modules.o.cStringIO s.linktab
	$(MAKEDLK) -d @.^.Lib.cStringIO/pyd -s s.linktab -o @.^.Modules.o.cStringIO -e initcStringIO

@.^.Lib.plat-riscos.drawf/pyd: Modules.o.drawfmodule #s.linktab
	$(LINK) -aof -o Modules.o.drawflink Modules.o.drawfmodule $(OSLIB).o.OSLIB
	$(MAKEDLK) -d @.^.Lib.plat-riscos.drawf/pyd -s s.linktab -o Modules.o.drawflink -e initdrawf

@.^.Lib.errno/pyd: @.^.Modules.o.errnomodule #s.linktab
	$(MAKEDLK) -d @.^.Lib.errno/pyd -s s.linktab -o @.^.Modules.o.errnomodule -e initerrno

@.^.Lib.imageop/pyd: @.^.Modules.o.imageop s.linktab
	$(MAKEDLK) -d @.^.Lib.imageop/pyd -s s.linktab -o @.^.Modules.o.imageop -e initimageop

@.^.Lib.math/pyd: @.^.Modules.o.mathmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.math/pyd -s s.linktab -o @.^.Modules.o.mathmodule -e initmath

@.^.Lib.mmap/pyd: @.^.Modules.o.mmapmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.mmap/pyd -s s.linktab -o @.^.Modules.o.mmapmodule -e initmmap

@.^.Lib.md5/pyd: @.^.Modules.o.md5c @.^.Modules.o.md5module s.linktab
	$(LINK) -aof -o @.^.Modules.o.md5link @.^.Modules.o.md5c @.^.Modules.o.md5module
	$(MAKEDLK) -d @.^.Lib.md5/pyd -s s.linktab -o @.^.Modules.o.md5link -e initmd5

@.^.Lib.new/pyd: @.^.Modules.o.newmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.new/pyd -s s.linktab -o @.^.Modules.o.newmodule -e initnew

@.^.Lib.operator/pyd: @.^.Modules.o.operator s.linktab
	$(MAKEDLK) -d @.^.Lib.operator/pyd -s s.linktab -o @.^.Modules.o.operator -e initoperator

@.^.Lib.parser/pyd: @.^.Modules.o.parsermodule s.linktab
	$(MAKEDLK) -d @.^.Lib.parser/pyd -s s.linktab -o @.^.Modules.o.parsermodule -e initparser

@.^.Lib.pcre/pyd: @.^.Modules.o.pcremodule @.^.Modules.o.pypcre s.linktab
	$(LINK) -aof -o @.^.Modules.o.pcrelink @.^.Modules.o.pcremodule @.^.Modules.o.pypcre
	$(MAKEDLK) -d @.^.Lib.pcre/pyd -s s.linktab -o @.^.Modules.o.pcrelink -e initpcre

@.^.Lib.regex/pyd: @.^.Modules.o.regexmodule @.^.Modules.o.regexpr s.linktab
	$(LINK) -aof -o @.^.Modules.o.regexlink @.^.Modules.o.regexmodule @.^.Modules.o.regexpr
	$(MAKEDLK) -d @.^.Lib.regex/pyd -s s.linktab -o @.^.Modules.o.regexlink -e initregex

@.^.Lib.rgbimg/pyd: @.^.Modules.o.rgbimgmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.rgbimg/pyd -s s.linktab -o @.^.Modules.o.rgbimgmodule -e initrgbimg

@.^.Lib.rotor/pyd: @.^.Modules.o.rotormodule s.linktab
	$(MAKEDLK) -d @.^.Lib.rotor/pyd -s s.linktab -o @.^.Modules.o.rotormodule -e initrotor

@.^.Lib.sha/pyd: @.^.Modules.o.shamodule s.linktab
	$(MAKEDLK) -d @.^.Lib.sha/pyd -s s.linktab -o @.^.Modules.o.shamodule -e initsha

@.^.Lib.signal/pyd: @.^.Modules.o.signalmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.signal/pyd -s s.linktab -o @.^.Modules.o.signalmodule -e initsignal

#@.^.Lib.soundex/pyd: @.^.Modules.o.soundex s.linktab
#	$(MAKEDLK) -d @.^.Lib.soundex/pyd -s s.linktab -o @.^.Modules.o.soundex -e initsoundex

@.^.Lib.strop/pyd: @.^.Modules.o.stropmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.strop/pyd -s s.linktab -o @.^.Modules.o.stropmodule -e initstrop

@.^.Lib.struct/pyd: @.^.Modules.o.structmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.struct/pyd -s s.linktab -o @.^.Modules.o.structmodule -e initstruct

@.^.Lib.plat-riscos.swi/pyd: Modules.o.swimodule s.linktab
	$(LINK) -aof -o Modules.o.swilink Modules.o.swimodule $(OSLIB).o.OSLIB
	$(MAKEDLK) -d @.^.Lib.plat-riscos.swi/pyd -s s.linktab -o Modules.o.swilink -e initswi

@.^.Lib._locale/pyd: @.^.Modules.o._localemodule s.linktab
	$(MAKEDLK) -d @.^.Lib._locale/pyd -s s.linktab -o @.^.Modules.o._localemodule -e init_locale

@.^.Lib._sre/pyd: @.^.Modules.o._sre s.linktab
	$(MAKEDLK) -d @.^.Lib._sre/pyd -s s.linktab -o @.^.Modules.o._sre -e init_sre

@.^.Lib._codecs/pyd: @.^.Modules.o._codecsmodule s.linktab
	$(MAKEDLK) -d @.^.Lib._codecs/pyd -s s.linktab -o @.^.Modules.o._codecsmodule -e init_codecs

@.^.Lib._weakref/pyd: @.^.Modules.o._weakref s.linktab
	$(MAKEDLK) -d @.^.Lib._weakref/pyd -s s.linktab -o @.^.Modules.o._weakref -e init_weakref

@.^.Lib._testcapi/pyd: @.^.Modules.o._testcapimodule s.linktab
	$(MAKEDLK) -d @.^.Lib._testcapi/pyd -s s.linktab -o @.^.Modules.o._testcapimodule -e init_testcapi

@.^.Lib.unicodedata/pyd: @.^.Modules.o.unicodedata s.linktab
	$(MAKEDLK) -d @.^.Lib.unicodedata/pyd -s s.linktab -o @.^.Modules.o.unicodedata -e initunicodedata

@.^.Lib.xreadlines/pyd: @.^.Modules.o.xreadlinesmodule s.linktab
	$(MAKEDLK) -d @.^.Lib.xreadlines/pyd -s s.linktab -o @.^.Modules.o.xreadlinesmodule -e initxreadlines



############################################################################
# Dynamic Modules with other dependencies
#
@.^.Lib.select/pyd:  @.^.Modules.o.selectmodule s.linktab
	$(LINK) -aof -o @.^.Modules.o.selectlink @.^.Modules.o.selectmodule $(SOCKLIB).o.socklib
	$(MAKEDLK) -d @.^.Lib.select/pyd -s s.linktab -o @.^.Modules.o.selectlink -e initselect

@.^.Modules.o.selectmodule: @.^.Modules.c.selectmodule
	$(CC) -I$(SOCKLIB).include -o $@ @.^.Modules.c.selectmodule

@.^.Lib._socket/pyd: @.^.Modules.o.socketmodule s.linktab 
	$(LINK) -aof -o @.^.Modules.o._socketlink @.^.Modules.o.socketmodule $(SOCKLIB).o.inetlib $(SOCKLIB).o.unixlib $(SOCKLIB).o.socklib
	$(MAKEDLK) -d @.^.Lib._socket/pyd -s s.linktab -o @.^.Modules.o._socketlink -e init_socket

@.^.Modules.o.socketmodule: @.^.Modules.c.socketmodule
	$(CC) -I$(SOCKLIB).include -o $@ @.^.Modules.c.socketmodule


@.^.Lib.zlib/pyd: @.^.Modules.o.zlibmodule s.linktab
	$(LINK) -aof -o @.^.Modules.o.zliblink @.^.Modules.o.zlibmodule $(ZLIB).zlib_lib
	$(MAKEDLK) -d @.^.Lib.zlib/pyd -s s.linktab -o @.^.Modules.o.zliblink -e initzlib

@.^.Modules.o.zlibmodule: @.^.Modules.c.zlibmodule
	$(CC) -I$(ZLIB) -o $@ @.^.Modules.c.zlibmodule


@.^.Lib.time/pyd: @.^.Modules.o.timemodule s.linktab @.o.sleep
	$(LINK) -aof -o @.^.Modules.o.timelink @.^.Modules.o.timemodule @.o.sleep $(OSLIB).o.OSLib
	$(MAKEDLK) -d @.^.Lib.time/pyd -s s.linktab -o @.^.Modules.o.timelink -e inittime


@.^.Lib.pyexpat/pyd: @.^.Modules.o.pyexpat s.linktab
	$(LINK) -aof -o @.^.Modules.o.pyexpatlink @.^.Modules.o.pyexpat $(EXPAT).expat_lib
	$(MAKEDLK) -d @.^.Lib.pyexpat/pyd -s s.linktab -o @.^.Modules.o.pyexpatlink -e initpyexpat

@.^.Modules.o.pyexpat: @.^.Modules.c.pyexpat
	$(CCEXPAT) -o $@ @.^.Modules.c.pyexpat


##########################################################################
# dynamic linking symbol table
#
o.linktab: s.linktab
	ObjAsm s.linktab o.linktab

s.linktab: $(OBJECTS)
	$(OBJSCAN) -s s.linktab -o $(OBJECTS) $(clib).o.stubs

##########################################################################
# special targets
#
libclean:
	create @.^.Lib.dummy/pyc
	create @.^.Lib.dummy/pyo
	create @.^.Lib.plat-riscos.dummy/pyc
	create @.^.Lib.plat-riscos.dummy/pyo
	create @.^.Lib.test.dummy/pyc
	create @.^.Lib.test.dummy/pyo
	wipe @.^.Lib.*/pyc ~C~V
	wipe @.^.Lib.*/pyo ~C~V
	wipe @.^.Lib.plat-riscos.*/pyc ~C~V
	wipe @.^.Lib.plat-riscos.*/pyo ~C~V
	wipe @.^.Lib.test.*/pyc ~C~V
	wipe @.^.Lib.test.*/pyo ~C~V

clean: libclean
	create @.^.Objects.o.dummy
	create @.^.Parser.o.dummy
	create @.^.Modules.o.dummy
	create o.dummy
	create @.^.Python.o.dummy
	wipe @.^.Modules.o.* ~C ~V
	wipe @.^.Objects.o.* ~C ~V
	wipe @.^.Parser.o.* ~C ~V
	wipe @.^.Python.o.* ~C ~V
	wipe o.* ~C ~V

rebuild: clean
	create @.^.Lib.dummy/pyd
	create @.^.$(TARGET)
	create @.^.Lib.plat-riscos.dummy/pyd
	create s.linktab
	create o.linktab
	wipe @.^.$(TARGET) ~C~V
	wipe @.^.Lib.*/pyd ~C ~V
	wipe @.^.Lib.plat-riscos.*/pyd ~C~V
	wipe s.linktab ~C~V
	wipe o.linktab ~C~V

cdirs:
	cdir @.Modules.o
	cdir @.Python.o
	cdir @.s
	cdir @.o
	cdir @.^.Python.o
	cdir @.^.Parser.o
	cdir @.^.Objects.o
	cdir @.^.Modules.o


# Dynamic dependencies:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.