This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
GvFILE() cannot be a pointer to the memory owned by the COP, because
[perl5.git] / wince / Makefile.ce
CommitLineData
e4451f11
JH
1# perl makefile for wince
2#
ca6c63e1 3# Time-stamp: <26/10/01 15:10:06 keuchel@keuchelnt>
e4451f11
JH
4
5SRCDIR = ..
78a7c709 6PV = 59
a1e6f3ef 7INST_VER = 5.9.4
42165d27 8
18f68570 9# INSTALL_ROOT specifies a path where this perl will be installed on CE device
42165d27 10INSTALL_ROOT=/netzwerk/sprache/perl
18f68570
VK
11INST_TOP=$(INSTALL_ROOT)
12INST_VER=
42165d27
VK
13
14# PERLCEDIR shoud be set to current directory
e4451f11 15PERLCEDIR = H:\src\wince\perl\wince
42165d27 16
18f68570 17# WCEROOT is a directory where Windows CE Tools was installed
ca6c63e1 18WCEROOT = D:\Windows CE Tools
18f68570
VK
19
20# HPERL stands for host perl, which is perl on local desktop machine
21# which is usually ..\miniperl.exe
22#HPERL = N:\Programme\perl\bin\perl.exe
23HPERL = $(MAKEDIR)\..\miniperl.exe
24
ca6c63e1
JH
25CEPATH = D:\Programme\Microsoft eMbedded Tools\EVC\WCE211\BIN
26CELIBDLLDIR = h:\src\wince\celib-palm-3.0
e4451f11 27CECONSOLEDIR = h:\src\wince\w32console
18f68570
VK
28
29# specify following options to build perl on local machine, by MSVC
30MSVCDIR = D:\MSVStudio\VC98
31CCHOME = $(MSVCDIR)
32CCINCDIR = $(CCHOME)\include
33CCLIBDIR = $(CCHOME)\lib
34
e4451f11 35# Only for WIN2000
ca6c63e1 36#YES = /y
e4451f11
JH
37COPY = copy $(YES)
38XCOPY = xcopy $(YES) /f /r /i /d
39RCOPY = xcopy $(YES) /f /r /i /e /d
42165d27
VK
40
41# cecopy program. Make shure it is in your path, as well as cemkdir, cedel
42CECOPY = cecopy
43
18f68570
VK
44#
45# Comment out next assign to disable perl's I/O subsystem and use compiler's
46# stdio for IO - depending on your compiler vendor and run time library you may
47# then get a number of fails from make test i.e. bugs - complain to them not us ;-).
48# You will also be unable to take full advantage of perl5.8's support for multiple
49# encodings and may see lower IO performance. You have been warned.
50USE_PERLIO = define
51
2e64bfdb
JH
52#
53# set this if you wish to use perl's malloc
54# This will make perl run few times faster
55# WARNING: Turning this on/off WILL break binary compatibility with extensions
56# you may have compiled with/without it.
57#
58PERL_MALLOC = define
59
18f68570 60
e4451f11
JH
61NOOP = @echo
62# keep this untouched!
63NULL =
64
42165d27 65
aebd5ec7
VK
66#CFG=DEBUG
67CFG=RELEASE
e4451f11
JH
68
69!if "$(MACHINE)" == ""
70MACHINE=wince-arm-hpc-wce300
71#MACHINE=wince-arm-hpc-wce211
72#MACHINE=wince-sh3-hpc-wce211
73#MACHINE=wince-mips-hpc-wce211
74#MACHINE=wince-sh3-hpc-wce200
75#MACHINE=wince-mips-hpc-wce200
76#MACHINE=wince-arm-pocket-wce300
77#MACHINE=wince-mips-pocket-wce300
78#MACHINE=wince-sh3-pocket-wce300
79#MACHINE=wince-x86em-pocket-wce300
80#MACHINE=wince-mips-palm-wce211
81#MACHINE=wince-sh3-palm-wce211
82#MACHINE=wince-x86em-palm-wce211
83!endif
84
2e64bfdb
JH
85# set this to your email address
86#
87#EMAIL =
88
89##################### CHANGE THESE ONLY IF YOU MUST #####################
90
e4451f11
JH
91######################################################################
92# machines
93
94!if "$(MACHINE)" == "wince-sh3-hpc-wce211"
95CC = shcl.exe
96ARCH = SH3
97CPU = SH3
98TARGETCPU = SH3
99CEVersion = 211
100OSVERSION = WCE211
101PLATFORM = MS HPC Pro
102MCFLAGS = -MDd -DSH3 -D_SH3_ -DSHx -DPROCESSOR_SH3 -DPALM_SIZE \
103 -I $(CELIBDLLDIR)\inc
104SUBSYS = -subsystem:windowsce,2.11
105CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
106LDLIBPATH = -libpath:$(CELIBPATH)
107STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
108 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
109!endif
110
111!if "$(MACHINE)" == "wince-mips-hpc-wce211"
112CC = clmips.exe
113ARCH = MIPS
114CPU = MIPS
115TARGETCPU = MIPS
116CEVersion = 211
117OSVERSION = WCE211
118PLATFORM = MS HPC Pro
119MCFLAGS = -D _MT -D _DLL \
120 -D MIPS -D mips -D _MIPS_ -D _mips_ -DPROCESSOR_MIPS \
121 -D PALM_SIZE \
122 -I $(CELIBDLLDIR)\inc
123SUBSYS = -subsystem:windowsce,2.11
124CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
125LDLIBPATH = -libpath:$(CELIBPATH)
126STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
127 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
128!endif
129
130!if "$(MACHINE)" == "wince-mips-hpc-wce200"
131CC = clmips.exe
132ARCH = MIPS
133CPU = MIPS
134TARGETCPU = MIPS
135CEVersion = 200
136OSVERSION = WCE200
137PLATFORM = MS HPC
138# MUST USE -MD to get the right FPE stuff...
139MCFLAGS = -D _MT -D _DLL -MD \
140 -D MIPS -D mips -D _MIPS_ -D _mips_ -DPROCESSOR_MIPS \
141 -D PALM_SIZE \
142 -I $(CELIBDLLDIR)\inc
143SUBSYS = -subsystem:windowsce,2.00
144CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
145LDLIBPATH = -libpath:$(CELIBPATH)
146STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
147 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
148!endif
149
150!if "$(MACHINE)" == "wince-sh3-hpc-wce200"
151CC = shcl.exe
152ARCH = SH3
153CPU = SH3
154TARGETCPU = SH3
155CEVersion = 200
156OSVERSION = WCE200
157PLATFORM = MS HPC
158# MUST USE -MD to get the right FPE stuff...
159MCFLAGS = -D _MT -D _DLL -MD \
160 -D SH3 -D sh3 -D _SH3_ -D _sh3_ -D SHx -DPROCESSOR_SH3 \
161 -D PALM_SIZE \
162 -I $(CELIBDLLDIR)\inc
163SUBSYS = -subsystem:windowsce,2.00
164CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
165LDLIBPATH = -libpath:$(CELIBPATH)
166STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
167 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
168!endif
169
170!if "$(MACHINE)" == "wince-arm-hpc-wce211"
171CC = clarm.exe
172ARCH = ARM
173CPU = ARM
174TARGETCPU = ARM
175CEVersion = 211
176OSVERSION = WCE211
177PLATFORM = MS HPC Pro
178MCFLAGS = -D _MT -D _DLL -D ARM -D arm -D _arm_ -D _ARM_ \
179 -DPROCESSOR_ARM -DPALM_SIZE \
180 -I $(CELIBDLLDIR)\inc
181SUBSYS = -subsystem:windowsce,2.11
182CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
183LDLIBPATH = -libpath:$(CELIBPATH)
184STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
185 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
186!endif
187
188!if "$(MACHINE)" == "wince-arm-hpc-wce300"
189CC = clarm.exe
190ARCH = ARM
191CPU = ARM
192TARGETCPU = ARM
193CEVersion = 300
194OSVERSION = WCE300
c96f74ce 195#PLATFORM = HPC2000
e4451f11
JH
196MCFLAGS = -D _MT -D _DLL -D ARM -D arm -D _arm_ -D _ARM_ \
197 -DPROCESSOR_ARM -DPALM_SIZE \
198 -I $(CELIBDLLDIR)\inc
199SUBSYS = -subsystem:windowsce,3.00
200CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
201LDLIBPATH = -libpath:$(CELIBPATH)
202STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
203 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
204!endif
205
206!if "$(MACHINE)" == "wince-mips-palm-wce211"
207CC = clmips.exe
208ARCH = MIPS
209CPU = MIPS
210TARGETCPU = MIPS
211CEVersion = 211
212OSVERSION = WCE211
213PLATFORM = MS Palm Size PC
214MCFLAGS = -DMIPS -D_MIPS_ -DPROCESSOR_MIPS -D PALM_SIZE -D _DLL -D _MT \
215 -I $(CELIBDLLDIR)\inc
216SUBSYS = -subsystem:windowsce,2.11
217CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
218LDLIBPATH = -libpath:$(CELIBPATH)
219STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
220 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
221!endif
222
223!if "$(MACHINE)" == "wince-sh3-palm-wce211"
224CC = shcl.exe
225ARCH = SH3
226CPU = SH3
227TARGETCPU = SH3
228CEVersion = 211
229OSVERSION = WCE211
230PLATFORM = MS Palm Size PC
231MCFLAGS = -D _MT -D _DLL -DSH3 -D_SH3_ -DSHx -DPROCESSOR_SH3 -DPALM_SIZE \
232 -I $(CELIBDLLDIR)\inc
233SUBSYS = -subsystem:windowsce,2.11
234CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
235LDLIBPATH = -libpath:$(CELIBPATH)
236STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
237 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
238!endif
239
240!if "$(MACHINE)" == "wince-x86em-palm-wce211"
241CC = cl.exe
242ARCH = X86EM
243CPU = X86
244TARGETCPU = X86
245CEVersion = 211
246OSVERSION = WCE211
247PLATFORM = MS Palm Size PC
248MCFLAGS = -MDd -DX86 -D_X86_ -DPROCESSOR_X86 \
249 -D_WIN32_WCE_EMULATION -DPALM_SIZE \
250 -I $(CELIBDLLDIR)\inc
251MACH = -machine:x86
252SUBSYS = -subsystem:windows
253CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
254LDLIBPATH = -libpath:$(CELIBPATH)
255STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
256 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
257!endif
258
259!if "$(MACHINE)" == "wince-x86em-pocket-wce300"
260CC = cl.exe
261ARCH = X86EM
262CPU = X86
263TARGETCPU = X86
264CEVersion = 300
265OSVERSION = WCE300
266PLATFORM = MS Pocket PC
267MCFLAGS = -DX86 -D_X86_ -DPROCESSOR_X86 -D _MT -D _DLL \
268 -D_WIN32_WCE_EMULATION -DPALM_SIZE -DPOCKET_SIZE \
269 -I $(CELIBDLLDIR)\inc
270MACH = -machine:x86
271SUBSYS = -subsystem:windows
272CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
273LDLIBPATH = -libpath:$(CELIBPATH)
274STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
275 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
276!endif
277
278!if "$(MACHINE)" == "wince-mips-pocket-wce300"
279CC = clmips.exe
280ARCH = MIPS
281CPU = MIPS
282TARGETCPU = MIPS
283CEVersion = 300
284OSVERSION = WCE300
285PLATFORM = MS Pocket PC
286MCFLAGS = -D MIPS -D mips -D _MIPS_ -D _mips_ -DPROCESSOR_MIPS \
287 -D _MT -D _DLL -DPALM_SIZE -DPOCKET_SIZE \
288 -I $(CELIBDLLDIR)\inc
289MACH = -machine:mips
290SUBSYS = -subsystem:windowsce,3.00
291CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
216db7ee 292#STDLIBPATH = $(WCEROOT)\$(OSVERSION)\$(PLATFORM)\lib\$(CPU)
e4451f11 293LDLIBPATH = -libpath:$(CELIBPATH)
216db7ee 294#"-libpath:$(STDLIBPATH)"
e4451f11
JH
295STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
296 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
297!endif
298
299!if "$(MACHINE)" == "wince-sh3-pocket-wce300"
300CC = shcl.exe
301ARCH = SH3
302CPU = SH3
303TARGETCPU = SH3
304CEVersion = 300
305OSVERSION = WCE300
306PLATFORM = MS Pocket PC
307MCFLAGS = -D _MT -D _DLL -DSH3 -D_SH3_ -DSHx -DPROCESSOR_SH3 \
308 -DPALM_SIZE -DPOCKET_SIZE \
309 -I $(CELIBDLLDIR)\inc
2e64bfdb 310MACH = -machine:sh3
e4451f11
JH
311SUBSYS = -subsystem:windowsce,3.00
312CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
313LDLIBPATH = -libpath:$(CELIBPATH)
314STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
315 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
316!endif
317
318!if "$(MACHINE)" == "wince-arm-pocket-wce300"
319CC = clarm.exe
320ARCH = ARM
321CPU = ARM
322TARGETCPU = ARM
323CEVersion = 300
324OSVERSION = WCE300
325PLATFORM = MS Pocket PC
326MCFLAGS = -D ARM -D arm -D _ARM_ -D _arm_ -DPROCESSOR_ARM \
327 -D _MT -D _DLL -DPALM_SIZE -DPOCKET_SIZE \
328 -I $(CELIBDLLDIR)\inc
329MACH = -machine:arm
330SUBSYS = -subsystem:windowsce,3.00
331CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
332LDLIBPATH = -libpath:$(CELIBPATH)
333STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
334 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
335!endif
336
337######################################################################
338# common section
339
340CEDEFS = -D_WINDOWS -D_WIN32_WCE=$(CEVersion) -DUNDER_CE=$(CEVersion) \
ca6c63e1
JH
341 $(MCFLAGS) -D PERL
342
e4451f11
JH
343#CEDEFS = $(CEDEFS) -DDEBUGGING_OPS
344
345CECFLAGS = $(CEDEFS)
346
347!if "$(CFG)" == "DEBUG"
348CECFLAGS = $(CECFLAGS) -Zi -Od
349!endif
350
351!if "$(CFG)" == "RELEASE"
352# -O2 and -Ot give internal compiler error in perl.c and lexer.
353# Also the dll cannot be loaded by perl.exe...
c96f74ce
JH
354!if "$(CPU)" == "SH3"
355!else
2e64bfdb 356CECFLAGS = $(CECFLAGS) -O2 -Ot
e4451f11
JH
357!endif
358
c96f74ce
JH
359!endif
360
e4451f11
JH
361RCDEFS = /l 0x407 /r /d "UNICODE" /d UNDER_CE=$(CEVersion) \
362 /d _WIN32_WCE=$(CEVersion)
363
364PATH=$(CEPATH);$(PATH)
365
366INCLUDE=$(WCEROOT)\$(OSVERSION)\$(PLATFORM)\include
367LIB=$(WCEROOT)\$(OSVERSION)\$(PLATFORM)\lib\$(ARCH)
368
369######################################################################
370
371!message
372!message Compiling for $(MACHINE)
373!message LIB=$(LIB)
374!message INCLUDE=$(INCLUDE)
375!message PATH=$(CEPATH)
376!message
377
378######################################################################
379#
380# Additional compiler flags can be specified here.
381#
382
383BUILDOPT = $(BUILDOPT) $(CECFLAGS)
384
e4451f11
JH
385
386!IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
387D_CRYPT = undef
388!ELSE
389D_CRYPT = define
390CRYPT_FLAG = -DHAVE_DES_FCRYPT
391!ENDIF
392
e4451f11
JH
393!IF "$(PERL_MALLOC)" == ""
394PERL_MALLOC = undef
395!ENDIF
396
e4451f11
JH
397!IF "$(USE_MULTI)" == ""
398USE_MULTI = undef
399!ENDIF
400
e4451f11
JH
401!IF "$(USE_ITHREADS)" == ""
402USE_ITHREADS = undef
403!ENDIF
404
405!IF "$(USE_IMP_SYS)" == ""
406USE_IMP_SYS = undef
407!ENDIF
408
18f68570
VK
409!IF "$(USE_PERLIO)" == ""
410USE_PERLIO = undef
411!ENDIF
412
e4451f11
JH
413!IF "$(USE_PERLCRT)" == ""
414USE_PERLCRT = undef
415!ENDIF
416
3db8f154 417!IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef"
e4451f11
JH
418USE_MULTI = define
419!ENDIF
420
acfe0abc 421!IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
e4451f11 422USE_MULTI = define
e4451f11
JH
423!ENDIF
424
3db8f154 425!IF "$(USE_MULTI)" != "undef"
e4451f11
JH
426BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
427!ENDIF
428
429!IF "$(USE_IMP_SYS)" != "undef"
430BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_SYS
431!ENDIF
432
18f68570
VK
433!IF "$(USE_PERLIO)" == "define"
434BUILDOPT = $(BUILDOPT) -DUSE_PERLIO
435!ENDIF
436
47bcb90d 437!IF "$(CROSS_NAME)" == ""
2e64bfdb 438CROSS_NAME = $(MACHINE)
47bcb90d
VK
439!ENDIF
440
e4451f11
JH
441# new option - automatically defined in perl.h...
442#BUILDOPT = $(BUILDOPT) -DUSE_ENVIRON_ARRAY
443
444PROCESSOR_ARCHITECTURE = $(TARGETCPU)
445ARCHNAME = $(PLATFORM)-$(OSVERSION)-$(PROCESSOR_ARCHITECTURE)
e4451f11
JH
446ARCHDIR = ..\lib\$(ARCHNAME)
447COREDIR = ..\lib\CORE
e2a02c1e 448XCOREDIR = ..\xlib\$(CROSS_NAME)\CORE
e4451f11
JH
449AUTODIR = ..\lib\auto
450LIBDIR = ..\lib
451EXTDIR = ..\ext
452PODDIR = ..\pod
453EXTUTILSDIR = $(LIBDIR)\ExtUtils
454
455LINK32 = link
456LIB32 = $(LINK32) -lib
457RSC = rc
458
814ffeea 459INCLUDES = -I.\include -I..\win32\include -I. -I..
e4451f11
JH
460DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG) $(CECFLAGS)
461LOCDEFS = -DPERLDLL -DPERL_CORE
216db7ee 462CXX_FLAG = -TP
e4451f11
JH
463
464PERLEXE_RES = perl.res
465PERLDLL_RES =
466
e4451f11
JH
467!if "$(CFG)" == "RELEASE"
468CELIB = celib.lib
469!endif
470
471!if "$(CFG)" == "DEBUG"
472CELIB = celib.lib
473!endif
474
475CELIBS = -nodefaultlib \
476 winsock.lib $(CELIB) coredll.lib
477
478!if $(CEVersion) > 200
479CELIBS = $(CELIBS) corelibc.lib
480!else
481CELIBS = $(CELIBS) msvcrt.lib
482!endif
483
484LIBBASEFILES = $(CRYPT_LIB) $(CELIBS)
485
486LIBFILES = $(LIBBASEFILES) $(LIBC)
487
488CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
489 $(PCHFLAGS) $(OPTIMIZE)
490
491LINK_FLAGS = -nologo -machine:$(PROCESSOR_ARCHITECTURE)
492
493!if "$(CFG)" == "DEBUG"
494LINK_FLAGS = $(LINK_FLAGS) -debug:full -pdb:none
2e64bfdb
JH
495!else
496LINK_FLAGS = $(LINK_FLAGS) -release
e4451f11
JH
497!endif
498
499OBJOUT_FLAG = -Fo
500EXEOUT_FLAG = -Fe
501
502CFLAGS_O = $(CFLAGS) $(BUILDOPT)
503
504o = .obj
505
506#
507# Rules
508#
509
510.SUFFIXES : .c $(o) .dll .lib .exe .rc .res
511
512.c$(o):
513 $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
514
515.y.c:
516 $(NOOP)
517
518$(o).dll:
519 $(LINK32) -dll $(SUBSYS) $(LDLIBPATH) \
520 -implib:$(*B).lib -def:$(*B).def \
521 -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
522
523.rc.res:
524 $(RSC) -i.. $<
525
526# This must be relative to ../lib/CORE, else the ext dll build fails...
e2a02c1e 527PERLIMPLIB_EXP = ..\..\..\xlib\$(CROSS_NAME)\CORE\perl$(PV).lib
e4451f11
JH
528PERLIMPLIB = $(PERLCEDIR)\$(MACHINE)\perl$(PV).lib
529PERLDLL = $(MACHINE)\perl$(PV).dll
530
531DLLDIR = $(MACHINE)\dll
532PERLEXE = $(MACHINE)\perl.exe
533
e2a02c1e 534CONFIGPM = ..\xlib\$(CROSS_NAME)\Config.pm
e4451f11
JH
535MINIMOD = ..\lib\ExtUtils\Miniperl.pm
536
42d1cefd
RGS
537# Unicode data files generated by mktables
538UNIDATAFILES = ..\lib\unicore\Canonical.pl ..\lib\unicore\Exact.pl \
539 ..\lib\unicore\Properties ..\lib\unicore\Decomposition.pl \
540 ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \
541 ..\lib\unicore\PVA.pl
542
543# Directories of Unicode data files generated by mktables
544UNIDATADIR1 = ..\lib\unicore\To
545UNIDATADIR2 = ..\lib\unicore\lib
546
fefd7080
VK
547# Nominate a target which causes extensions to be re-built
548# This used to be $(PERLEXE), but at worst it is the .dll that they depend
549# on and really only the interface - i.e. the .def file used to export symbols
550# from the .dll
551PERLDEP = perldll.def
552
e4451f11
JH
553MAKE = nmake -nologo
554
555CFGSH_TMPL = config.ce
556CFGH_TMPL = config_H.ce
557
558#
559# filenames given to xsubpp must have forward slashes (since it puts
560# full pathnames in #line strings)
fefd7080 561XSUBPP = $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) ..\$(EXTUTILSDIR)\xsubpp \
e4451f11
JH
562 -C++ -prototypes
563
564MICROCORE_SRC = \
565 ..\av.c \
566 ..\deb.c \
567 ..\doio.c \
568 ..\doop.c \
569 ..\dump.c \
570 ..\globals.c \
571 ..\gv.c \
572 ..\hv.c \
573 ..\mg.c \
574 ..\op.c \
b475b3e6 575 ..\pad.c \
e4451f11
JH
576 ..\perl.c \
577 ..\perlapi.c \
578 ..\perly.c \
579 ..\pp.c \
580 ..\pp_ctl.c \
581 ..\pp_hot.c \
84d4ea48
JH
582 ..\pp_pack.c \
583 ..\pp_sort.c \
e4451f11 584 ..\pp_sys.c \
10bc17b6 585 ..\reentr.c \
e4451f11
JH
586 ..\regcomp.c \
587 ..\regexec.c \
588 ..\run.c \
589 ..\scope.c \
590 ..\sv.c \
591 ..\taint.c \
592 ..\toke.c \
593 ..\universal.c \
594 ..\utf8.c \
595 ..\util.c \
596 ..\xsutils.c
597
598EXTRACORE_SRC = $(EXTRACORE_SRC) perllib.c
599
600!IF "$(PERL_MALLOC)" == "define"
601EXTRACORE_SRC = $(EXTRACORE_SRC) ..\malloc.c
602!ENDIF
603
42165d27 604EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c .\win32io.c
e4451f11
JH
605
606WIN32_SRC = \
607 .\wince.c \
608 .\wincesck.c \
609 .\win32thread.c
610
611!IF "$(CRYPT_SRC)" != ""
612WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC)
613!ENDIF
614
615DLL_SRC = $(DYNALOADER).c
616
617CORE_NOCFG_H = \
618 ..\av.h \
619 ..\cop.h \
620 ..\cv.h \
621 ..\dosish.h \
622 ..\embed.h \
623 ..\form.h \
624 ..\gv.h \
625 ..\handy.h \
626 ..\hv.h \
627 ..\iperlsys.h \
628 ..\mg.h \
629 ..\nostdio.h \
630 ..\op.h \
631 ..\opcode.h \
632 ..\perl.h \
633 ..\perlapi.h \
634 ..\perlsdio.h \
635 ..\perlsfio.h \
636 ..\perly.h \
637 ..\pp.h \
638 ..\proto.h \
639 ..\regexp.h \
640 ..\scope.h \
641 ..\sv.h \
642 ..\thread.h \
643 ..\unixish.h \
644 ..\utf8.h \
645 ..\util.h \
646 ..\warnings.h \
647 ..\XSUB.h \
648 ..\EXTERN.h \
649 ..\perlvars.h \
650 ..\intrpvar.h \
651 ..\thrdvar.h \
652 .\include\dirent.h \
653 .\include\netdb.h \
654 .\include\sys\socket.h \
655 .\win32.h
656
2e64bfdb
JH
657CORE_H = $(CORE_NOCFG_H) .\config.h
658
659MICROCORE_OBJ = $(MICROCORE_SRC:.c=.obj)
660CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj)
661WIN32_OBJ = $(WIN32_SRC:.c=.obj)
662#WIN32_OBJ = $(WIN32_OBJ:.\=.\$(DLLDIR)\)
663MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\$(DLLDIR)\) \
664 $(MINIDIR)\miniperlmain$(o) \
665 $(MINIDIR)\perlio$(o)
666MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\$(DLLDIR)\)
667MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
668DLL_OBJ = $(DLL_SRC:.c=.obj)
669X2P_OBJ = $(X2P_SRC:.c=.obj)
670
671PERLDLL_OBJ = $(CORE_OBJ)
672PERLEXE_OBJ = perlmain$(o)
673
674PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
675#PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
676
e4451f11
JH
677!IF "$(USE_SETARGV)" != ""
678SETARGV_OBJ = setargv$(o)
679!ENDIF
680
681DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
682 Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
683 Sys/Hostname
684
685STATIC_EXT = DynaLoader
e4451f11
JH
686
687DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
e4451f11
JH
688
689ERRNO_PM = $(LIBDIR)\Errno.pm
690
e4451f11
JH
691
692EXTENSION_PM = \
693 $(ERRNO_PM)
694
695POD2HTML = $(PODDIR)\pod2html
696POD2MAN = $(PODDIR)\pod2man
697POD2LATEX = $(PODDIR)\pod2latex
698POD2TEXT = $(PODDIR)\pod2text
699
700CFG_VARS = \
701 "INST_DRV=$(INST_DRV)" \
702 "INST_TOP=$(INST_TOP)" \
703 "INST_VER=$(INST_VER)" \
704 "INST_ARCH=$(INST_ARCH)" \
705 "archname=$(ARCHNAME)" \
74d57dc4 706 "CC=$(CC)" \
e4451f11 707 "ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT)" \
1829b0dc
VK
708 "cppflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT)" \
709 "cf_by=vkon" \
2e64bfdb 710 "cf_email=$(EMAIL)" \
e4451f11
JH
711 "d_crypt=$(D_CRYPT)" \
712 "d_mymalloc=$(PERL_MALLOC)" \
713 "libs=$(LIBFILES)" \
714 "incpath=$(CCINCDIR)" \
715 "libperl=$(PERLIMPLIB_EXP)" \
716 "libpth=$(LIBPATH)" \
717 "libc=$(LIBC)" \
718 "make=nmake" \
719 "static_ext=$(STATIC_EXT)" \
720 "dynamic_ext=$(DYNAMIC_EXT)" \
e4451f11 721 "useithreads=$(USE_ITHREADS)" \
e4451f11 722 "usemultiplicity=$(USE_MULTI)" \
18f68570 723 "useperlio=$(USE_PERLIO)" \
e4451f11
JH
724 "LINK_FLAGS=$(LDLIBPATH) $(LINK_FLAGS) $(SUBSYS)" \
725 "optimize=$(OPTIMIZE)"
726
727#
728# Top targets
729#
730
42d1cefd 731all: hostminiperl $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) Extensions
e4451f11
JH
732
733$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
734
e2a02c1e 735$(CONFIGPM): .\config.h ..\config.sh ..\minimod.pl
fefd7080 736 cd .. && $(HPERL) configpm --cross=$(CROSS_NAME) --no-glossary
e2a02c1e
VK
737 -mkdir $(XCOREDIR)
738 $(XCOPY) ..\*.h $(XCOREDIR)\*.*
0f133d1f 739 $(XCOPY) ..\*.inc $(XCOREDIR)\*.*
e2a02c1e 740 $(XCOPY) *.h $(XCOREDIR)\*.*
e4451f11 741 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
e2a02c1e 742 $(RCOPY) include $(XCOREDIR)\*.*
814ffeea 743 $(XCOPY) ..\win32\include $(XCOREDIR)\*.*
42d1cefd 744 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) config_h.PL "INST_VER=$(INST_VER)" "CORE_DIR=$(XCOREDIR)"
e4451f11 745
e2a02c1e
VK
746.\config.h:
747 -del /f config.h
748 copy config_H.ce config.h
749
750..\config.sh: config.ce config_sh.PL
fefd7080 751 $(HPERL) -I..\lib -I..\win32 config_sh.PL $(CFG_VARS) config.ce > ..\config.sh
e4451f11
JH
752
753$(MINIMOD) : ..\minimod.pl
18f68570 754 cd .. && $(HPERL) minimod.pl > lib\ExtUtils\Miniperl.pm
e4451f11
JH
755
756perlmain.c : runperl.c
757 $(COPY) runperl.c perlmain.c
758
759$(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
760 if not exist $(AUTODIR) mkdir $(AUTODIR)
761 cd $(EXTDIR)\$(*B)
3f2394f2
VK
762 $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) $(*B)_pm.PL
763 $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) XSLoader_pm.PL
e4451f11
JH
764 cd ..\..\wince
765 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
766 $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
767 cd $(EXTDIR)\$(*B)
768 $(XSUBPP) dl_win32.xs > $(*B).c
769 cd ..\..\wince
770
771$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
772 $(COPY) dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
773
fefd7080 774#----------------------------------------------------------------------------------
94081db1
VK
775NOT_COMPILE_EXT =
776!if "$(MACHINE)" == "wince-sh3-palm-wce211"
777NOT_COMPILE_EXT = $(NOT_COMPILE_EXT) !XS/Typemap
778!endif
779!if "$(MACHINE)" == "wince-mips-palm-wce211"
780NOT_COMPILE_EXT = $(NOT_COMPILE_EXT) !XS/Typemap
781!endif
782
fefd7080
VK
783Extensions: ..\win32\buildext.pl $(PERLDEP) $(CONFIGPM)
784 $(HPERL) -I..\lib -I..\win32 -MCross=$(CROSS_NAME) ..\win32\buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) \
75472953 785 !POSIX $(NOT_COMPILE_EXT)
fefd7080
VK
786
787Extensions_clean:
788 -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
789
790#----------------------------------------------------------------------------------
791
476a6acb 792$(PERLEXE_RES): perl.rc perl.ico
e4451f11
JH
793 rc $(RCDEFS) perl.rc
794
795clean:
796 -rm -f $(MACHINE)/dll/*
797 -rm -f $(MACHINE)/*.obj
798 -rm -f $(MACHINE)/*.exe
799 -rm -f $(MACHINE)/*.dll
800 -rm -f $(MACHINE)/*.lib
801 -rm -f ../config.sh ../lib/Config.pm
802 -rm -f config.h perl.res
803
e4451f11
JH
804XDLLOBJS = \
805$(DLLDIR)\av.obj \
806$(DLLDIR)\deb.obj \
807$(DLLDIR)\doio.obj \
808$(DLLDIR)\doop.obj \
809$(DLLDIR)\dump.obj \
810$(DLLDIR)\globals.obj \
811$(DLLDIR)\gv.obj \
812$(DLLDIR)\hv.obj \
813$(DLLDIR)\locale.obj \
7ee2227d 814$(DLLDIR)\mathoms.obj \
e4451f11
JH
815$(DLLDIR)\mg.obj \
816$(DLLDIR)\numeric.obj \
817$(DLLDIR)\op.obj \
b475b3e6 818$(DLLDIR)\pad.obj \
e4451f11
JH
819$(DLLDIR)\perl.obj \
820$(DLLDIR)\perlapi.obj \
821$(DLLDIR)\perlio.obj \
822$(DLLDIR)\perly.obj \
823$(DLLDIR)\pp.obj \
824$(DLLDIR)\pp_ctl.obj \
825$(DLLDIR)\pp_hot.obj \
826$(DLLDIR)\pp_pack.obj \
84d4ea48 827$(DLLDIR)\pp_sort.obj \
e4451f11 828$(DLLDIR)\pp_sys.obj \
10bc17b6 829$(DLLDIR)\reentr.obj \
e4451f11
JH
830$(DLLDIR)\regcomp.obj \
831$(DLLDIR)\regexec.obj \
832$(DLLDIR)\run.obj \
833$(DLLDIR)\scope.obj \
834$(DLLDIR)\sv.obj \
835$(DLLDIR)\taint.obj \
836$(DLLDIR)\toke.obj \
837$(DLLDIR)\universal.obj \
838$(DLLDIR)\utf8.obj \
839$(DLLDIR)\util.obj \
840$(DLLDIR)\win32thread.obj \
841$(DLLDIR)\wince.obj \
42165d27 842$(DLLDIR)\win32io.obj \
e4451f11
JH
843$(DLLDIR)\wincesck.obj \
844$(DLLDIR)\xsutils.obj \
845$(DLLDIR)\perllib.obj \
846$(DLLDIR)\DynaLoader.obj
2e64bfdb
JH
847!IF "$(PERL_MALLOC)" == "define"
848XDLLOBJS = $(XDLLOBJS) $(DLLDIR)\malloc.obj
849!ENDIF
81003058
VK
850!IF "$(CRYPT_SRC)" != ""
851XDLLOBJS = $(XDLLOBJS) $(DLLDIR)\fcrypt.obj
852!ENDIF
e4451f11
JH
853
854{$(SRCDIR)}.c{$(DLLDIR)}.obj:
216db7ee
VK
855 $(CC) -c $(CFLAGS_O) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ $<
856
857# compiler explains that it will optimize toke.c if we'll give it an
858# option -QMOb<num> with num>=4178
859$(DLLDIR)\toke.obj:
860 $(CC) -c $(CFLAGS_O) -QMOb9000 -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ ..\toke.c
e4451f11
JH
861
862{$(SRCDIR)/wince}.c{$(DLLDIR)}.obj:
216db7ee
VK
863 $(CC) -c $(CFLAGS_O) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ $<
864
865# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
866# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
867!IF "$(USE_IMP_SYS)" == "define"
8f33b42a 868$(DLLDIR)\perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
216db7ee
VK
869 $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
870 rem (frustrated) mv perllib.obj $(DLLDIR)
871!ENDIF
e4451f11 872
47bcb90d 873perldll.def : $(HPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
18f68570
VK
874 $(HPERL) -w ..\makedef.pl PLATFORM=wince $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
875 CCTYPE=$(CCTYPE) -DPERL_DLL=$(PERLDLL) > perldll.def
876
e4451f11
JH
877$(PERLDLL) : $(DLLDIR) perldll.def $(XDLLOBJS) $(PERLDLL_RES)
878 $(LINK32) -dll -def:perldll.def -out:$@ \
879 $(SUBSYS) $(LDLIBPATH) \
880 $(LINK_FLAGS) $(LIBFILES) \
881 $(XDLLOBJS) $(PERLDLL_RES)
882
883$(DLLDIR) :
884 if not exist "$(DLLDIR)" mkdir "$(DLLDIR)"
885
886$(DLLDIR)\DynaLoader.obj: $(EXTDIR)\DynaLoader\DynaLoader.c
216db7ee 887 $(CC) -c $(CFLAGS_O) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ \
e4451f11
JH
888 $(EXTDIR)\DynaLoader\DynaLoader.c
889
890XPERLEXEOBJS = \
891$(MACHINE)\perlmain.obj
892
893$(PERLEXE) : $(PERLDLL) $(CONFIGPM) $(XPERLEXEOBJS) $(PERLEXE_RES) $(STARTOBJS)
e2a02c1e 894 $(XCOPY) $(MACHINE)\*.lib $(XCOREDIR)
2e64bfdb 895 $(LINK32) $(SUBSYS) $(LDLIBPATH) \
e4451f11
JH
896 -entry:wWinMainCRTStartup \
897 -out:$(MACHINE)\perl.exe \
898 -stack:0x100000 $(LINK_FLAGS) $(STARTOBJS) $(XPERLEXEOBJS) \
899 $(PERLIMPLIB) $(PERLEXE_RES) $(LIBFILES)
900
901$(MACHINE)\perlmain.obj : perlmain.c
902 $(CC) $(CFLAGS_O) -UPERLDLL -Fo$(MACHINE)\ -c perlmain.c
903
904iodll: $(IO_DLL)
905socketdll: $(SOCKET_DLL)
906dumperdll: $(DUMPER_DLL)
907
908dlls: socketdll iodll dumperdll
909 -xmkdir -p $(MACHINE)/lib/auto/IO
910 cp ../lib/auto/IO/IO.bs $(MACHINE)/lib/auto/IO
911 cp ../lib/auto/IO/IO.dll $(MACHINE)/lib/auto/IO
912 -xmkdir $(MACHINE)/lib/auto/Socket
913 cp ../lib/auto/Socket/Socket.bs $(MACHINE)/lib/auto/Socket
914 cp ../lib/auto/Socket/Socket.dll $(MACHINE)/lib/auto/Socket
915 -xmkdir -p $(MACHINE)/lib/auto/Data/Dumper
916 cp ../lib/auto/Data/Dumper/Dumper.bs $(MACHINE)/lib/auto/Data/Dumper
917 cp ../lib/auto/Data/Dumper/Dumper.dll $(MACHINE)/lib/auto/Data/Dumper
918
919makedist: all dlls
920 $(COPY) $(CELIBPATH)\celib.dll $(MACHINE)
921 cp perl.txt $(MACHINE)
922 cp registry.bat $(MACHINE)
923 cp ../lib/Config.pm $(MACHINE)/lib
924 cd $(MACHINE)
925 rm -f perl-$(MACHINE).tar.gz
926 sh -c "tar cf perl-$(MACHINE).tar *.exe *.dll *.txt *.bat lib"
927 gzip -9 perl-$(MACHINE).tar
928 mv perl-$(MACHINE).tar.gz h:/freenet/new
929 cd ..
930
42165d27
VK
931install: all
932 -cemkdir "$(INSTALL_ROOT)"
933 -cemkdir "$(INSTALL_ROOT)\bin"
934 -cemkdir "$(INSTALL_ROOT)\lib"
935 $(CECOPY) "pc:$(MACHINE)/perl.exe" "ce:$(INSTALL_ROOT)/bin"
18f68570 936 $(CECOPY) "pc:$(MACHINE)/perl$(PV).dll" "ce:$(INSTALL_ROOT)/bin"
e2a02c1e 937 $(CECOPY) "pc:../xlib/$(CROSS_NAME)/Config.pm" "ce:$(INSTALL_ROOT)/lib"
42d1cefd
RGS
938
939$(UNIDATAFILES) : $(HPERL) $(CONFIGPM) ..\lib\unicore\mktables
940 cd ..\lib\unicore && \
941 $(HPERL) -I.. mktables
e4451f11 942
2e64bfdb 943dist: all
c96f74ce
JH
944 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME)
945
946zipdist: all
947 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME)
948 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) --zip
949
950zip:
951 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) --zip
2e64bfdb 952
18f68570
VK
953perl.ico:
954 $(HPERL) makeico.pl
e4451f11 955
18f68570 956hostminiperl: ..\miniperl.exe
e4451f11 957
18f68570
VK
958..\miniperl.exe:
959 cd ../win32
960 set PATH=$(CCHOME)\bin;$(PATH)
47bcb90d 961 $(MAKE) -f Makefile "CCHOME=$(MSVCDIR)" "CCINCDIR=$(CCHOME)\include" "CCLIBDIR=$(CCHOME)\lib" "INCLUDE=$(CCHOME)\include" "LIB=$(CCHOME)\lib" "LINK_FLAGS=" .\config.h ..\miniperl.exe
18f68570 962 cd ../wince
476a6acb 963
47bcb90d
VK
964host-install:
965 perl -MConfig -MExtUtils::Install -we "install({'../lib/CORE', qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)/CORE#},1)"
966 perl -MConfig -MExtUtils::Install -we "install({'../xlib/$(CROSS_NAME)', qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)#},1)"
967 perl -MConfig -MFile::Copy -we "copy qq#./$(MACHINE)/perl$(PV).lib#, qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)/CORE#"
968 perl -MConfig -MFile::Copy -we "copy qq#../lib/Cross.pm#, qq#$$Config{installprefixexp}/lib#"
74a9a7e5
VK
969 perl -MConfig -we "system qq#perl -pi.bak -we \"s{((arch^|priv)libexp)='.*'}{\$$1='# . \
970 quotemeta($$Config{installprefixexp}) . \
971 qq#/xlib/$(CROSS_NAME)'}\" $$Config{installprefixexp}/xlib/$(CROSS_NAME)/Config.pm#"