This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
for pod/perlfaq2.pod against latest snapshot for Alpaca
[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
HS
6PV = 59
7INST_VER = 5.9.0
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
292LDLIBPATH = -libpath:$(CELIBPATH)
293STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
294 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
295!endif
296
297!if "$(MACHINE)" == "wince-sh3-pocket-wce300"
298CC = shcl.exe
299ARCH = SH3
300CPU = SH3
301TARGETCPU = SH3
302CEVersion = 300
303OSVERSION = WCE300
304PLATFORM = MS Pocket PC
305MCFLAGS = -D _MT -D _DLL -DSH3 -D_SH3_ -DSHx -DPROCESSOR_SH3 \
306 -DPALM_SIZE -DPOCKET_SIZE \
307 -I $(CELIBDLLDIR)\inc
2e64bfdb 308MACH = -machine:sh3
e4451f11
JH
309SUBSYS = -subsystem:windowsce,3.00
310CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
311LDLIBPATH = -libpath:$(CELIBPATH)
312STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
313 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
314!endif
315
316!if "$(MACHINE)" == "wince-arm-pocket-wce300"
317CC = clarm.exe
318ARCH = ARM
319CPU = ARM
320TARGETCPU = ARM
321CEVersion = 300
322OSVERSION = WCE300
323PLATFORM = MS Pocket PC
324MCFLAGS = -D ARM -D arm -D _ARM_ -D _arm_ -DPROCESSOR_ARM \
325 -D _MT -D _DLL -DPALM_SIZE -DPOCKET_SIZE \
326 -I $(CELIBDLLDIR)\inc
327MACH = -machine:arm
328SUBSYS = -subsystem:windowsce,3.00
329CELIBPATH = $(CELIBDLLDIR)\$(MACHINE)-release
330LDLIBPATH = -libpath:$(CELIBPATH)
331STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
332 $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
333!endif
334
335######################################################################
336# common section
337
338CEDEFS = -D_WINDOWS -D_WIN32_WCE=$(CEVersion) -DUNDER_CE=$(CEVersion) \
ca6c63e1
JH
339 $(MCFLAGS) -D PERL
340
e4451f11
JH
341#CEDEFS = $(CEDEFS) -DDEBUGGING_OPS
342
343CECFLAGS = $(CEDEFS)
344
345!if "$(CFG)" == "DEBUG"
346CECFLAGS = $(CECFLAGS) -Zi -Od
347!endif
348
349!if "$(CFG)" == "RELEASE"
350# -O2 and -Ot give internal compiler error in perl.c and lexer.
351# Also the dll cannot be loaded by perl.exe...
c96f74ce
JH
352!if "$(CPU)" == "SH3"
353!else
2e64bfdb 354CECFLAGS = $(CECFLAGS) -O2 -Ot
e4451f11
JH
355!endif
356
c96f74ce
JH
357!endif
358
e4451f11
JH
359RCDEFS = /l 0x407 /r /d "UNICODE" /d UNDER_CE=$(CEVersion) \
360 /d _WIN32_WCE=$(CEVersion)
361
362PATH=$(CEPATH);$(PATH)
363
364INCLUDE=$(WCEROOT)\$(OSVERSION)\$(PLATFORM)\include
365LIB=$(WCEROOT)\$(OSVERSION)\$(PLATFORM)\lib\$(ARCH)
366
367######################################################################
368
369!message
370!message Compiling for $(MACHINE)
371!message LIB=$(LIB)
372!message INCLUDE=$(INCLUDE)
373!message PATH=$(CEPATH)
374!message
375
376######################################################################
377#
378# Additional compiler flags can be specified here.
379#
380
381BUILDOPT = $(BUILDOPT) $(CECFLAGS)
382
e4451f11
JH
383
384!IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
385D_CRYPT = undef
386!ELSE
387D_CRYPT = define
388CRYPT_FLAG = -DHAVE_DES_FCRYPT
389!ENDIF
390
e4451f11
JH
391!IF "$(PERL_MALLOC)" == ""
392PERL_MALLOC = undef
393!ENDIF
394
e4451f11
JH
395!IF "$(USE_MULTI)" == ""
396USE_MULTI = undef
397!ENDIF
398
e4451f11
JH
399!IF "$(USE_ITHREADS)" == ""
400USE_ITHREADS = undef
401!ENDIF
402
403!IF "$(USE_IMP_SYS)" == ""
404USE_IMP_SYS = undef
405!ENDIF
406
18f68570
VK
407!IF "$(USE_PERLIO)" == ""
408USE_PERLIO = undef
409!ENDIF
410
e4451f11
JH
411!IF "$(USE_PERLCRT)" == ""
412USE_PERLCRT = undef
413!ENDIF
414
3db8f154 415!IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef"
e4451f11
JH
416USE_MULTI = define
417!ENDIF
418
acfe0abc 419!IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
e4451f11 420USE_MULTI = define
e4451f11
JH
421!ENDIF
422
3db8f154 423!IF "$(USE_MULTI)" != "undef"
e4451f11
JH
424BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
425!ENDIF
426
427!IF "$(USE_IMP_SYS)" != "undef"
428BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_SYS
429!ENDIF
430
18f68570
VK
431!IF "$(USE_PERLIO)" == "define"
432BUILDOPT = $(BUILDOPT) -DUSE_PERLIO
433!ENDIF
434
47bcb90d 435!IF "$(CROSS_NAME)" == ""
2e64bfdb 436CROSS_NAME = $(MACHINE)
47bcb90d
VK
437!ENDIF
438
e4451f11
JH
439# new option - automatically defined in perl.h...
440#BUILDOPT = $(BUILDOPT) -DUSE_ENVIRON_ARRAY
441
442PROCESSOR_ARCHITECTURE = $(TARGETCPU)
443ARCHNAME = $(PLATFORM)-$(OSVERSION)-$(PROCESSOR_ARCHITECTURE)
e4451f11
JH
444ARCHDIR = ..\lib\$(ARCHNAME)
445COREDIR = ..\lib\CORE
e2a02c1e 446XCOREDIR = ..\xlib\$(CROSS_NAME)\CORE
e4451f11
JH
447AUTODIR = ..\lib\auto
448LIBDIR = ..\lib
449EXTDIR = ..\ext
450PODDIR = ..\pod
451EXTUTILSDIR = $(LIBDIR)\ExtUtils
452
453LINK32 = link
454LIB32 = $(LINK32) -lib
455RSC = rc
456
457INCLUDES = -I.\include -I. -I..
458DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG) $(CECFLAGS)
459LOCDEFS = -DPERLDLL -DPERL_CORE
460CXX_FLAG = -TP -GX
461
462PERLEXE_RES = perl.res
463PERLDLL_RES =
464
e4451f11
JH
465!if "$(CFG)" == "RELEASE"
466CELIB = celib.lib
467!endif
468
469!if "$(CFG)" == "DEBUG"
470CELIB = celib.lib
471!endif
472
473CELIBS = -nodefaultlib \
474 winsock.lib $(CELIB) coredll.lib
475
476!if $(CEVersion) > 200
477CELIBS = $(CELIBS) corelibc.lib
478!else
479CELIBS = $(CELIBS) msvcrt.lib
480!endif
481
482LIBBASEFILES = $(CRYPT_LIB) $(CELIBS)
483
484LIBFILES = $(LIBBASEFILES) $(LIBC)
485
486CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
487 $(PCHFLAGS) $(OPTIMIZE)
488
489LINK_FLAGS = -nologo -machine:$(PROCESSOR_ARCHITECTURE)
490
491!if "$(CFG)" == "DEBUG"
492LINK_FLAGS = $(LINK_FLAGS) -debug:full -pdb:none
2e64bfdb
JH
493!else
494LINK_FLAGS = $(LINK_FLAGS) -release
e4451f11
JH
495!endif
496
497OBJOUT_FLAG = -Fo
498EXEOUT_FLAG = -Fe
499
500CFLAGS_O = $(CFLAGS) $(BUILDOPT)
501
502o = .obj
503
504#
505# Rules
506#
507
508.SUFFIXES : .c $(o) .dll .lib .exe .rc .res
509
510.c$(o):
511 $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
512
513.y.c:
514 $(NOOP)
515
516$(o).dll:
517 $(LINK32) -dll $(SUBSYS) $(LDLIBPATH) \
518 -implib:$(*B).lib -def:$(*B).def \
519 -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
520
521.rc.res:
522 $(RSC) -i.. $<
523
524# This must be relative to ../lib/CORE, else the ext dll build fails...
e2a02c1e 525PERLIMPLIB_EXP = ..\..\..\xlib\$(CROSS_NAME)\CORE\perl$(PV).lib
e4451f11
JH
526PERLIMPLIB = $(PERLCEDIR)\$(MACHINE)\perl$(PV).lib
527PERLDLL = $(MACHINE)\perl$(PV).dll
528
529DLLDIR = $(MACHINE)\dll
530PERLEXE = $(MACHINE)\perl.exe
531
e2a02c1e 532CONFIGPM = ..\xlib\$(CROSS_NAME)\Config.pm
e4451f11
JH
533MINIMOD = ..\lib\ExtUtils\Miniperl.pm
534
fefd7080
VK
535# Nominate a target which causes extensions to be re-built
536# This used to be $(PERLEXE), but at worst it is the .dll that they depend
537# on and really only the interface - i.e. the .def file used to export symbols
538# from the .dll
539PERLDEP = perldll.def
540
e4451f11
JH
541MAKE = nmake -nologo
542
543CFGSH_TMPL = config.ce
544CFGH_TMPL = config_H.ce
545
546#
547# filenames given to xsubpp must have forward slashes (since it puts
548# full pathnames in #line strings)
fefd7080 549XSUBPP = $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) ..\$(EXTUTILSDIR)\xsubpp \
e4451f11
JH
550 -C++ -prototypes
551
552MICROCORE_SRC = \
553 ..\av.c \
554 ..\deb.c \
555 ..\doio.c \
556 ..\doop.c \
557 ..\dump.c \
558 ..\globals.c \
559 ..\gv.c \
560 ..\hv.c \
561 ..\mg.c \
562 ..\op.c \
b475b3e6 563 ..\pad.c \
e4451f11
JH
564 ..\perl.c \
565 ..\perlapi.c \
566 ..\perly.c \
567 ..\pp.c \
568 ..\pp_ctl.c \
569 ..\pp_hot.c \
84d4ea48
JH
570 ..\pp_pack.c \
571 ..\pp_sort.c \
e4451f11 572 ..\pp_sys.c \
10bc17b6 573 ..\reentr.c \
e4451f11
JH
574 ..\regcomp.c \
575 ..\regexec.c \
576 ..\run.c \
577 ..\scope.c \
578 ..\sv.c \
579 ..\taint.c \
580 ..\toke.c \
581 ..\universal.c \
582 ..\utf8.c \
583 ..\util.c \
584 ..\xsutils.c
585
586EXTRACORE_SRC = $(EXTRACORE_SRC) perllib.c
587
588!IF "$(PERL_MALLOC)" == "define"
589EXTRACORE_SRC = $(EXTRACORE_SRC) ..\malloc.c
590!ENDIF
591
42165d27 592EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c .\win32io.c
e4451f11
JH
593
594WIN32_SRC = \
595 .\wince.c \
596 .\wincesck.c \
597 .\win32thread.c
598
599!IF "$(CRYPT_SRC)" != ""
600WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC)
601!ENDIF
602
603DLL_SRC = $(DYNALOADER).c
604
605CORE_NOCFG_H = \
606 ..\av.h \
607 ..\cop.h \
608 ..\cv.h \
609 ..\dosish.h \
610 ..\embed.h \
611 ..\form.h \
612 ..\gv.h \
613 ..\handy.h \
614 ..\hv.h \
615 ..\iperlsys.h \
616 ..\mg.h \
617 ..\nostdio.h \
618 ..\op.h \
619 ..\opcode.h \
620 ..\perl.h \
621 ..\perlapi.h \
622 ..\perlsdio.h \
623 ..\perlsfio.h \
624 ..\perly.h \
625 ..\pp.h \
626 ..\proto.h \
627 ..\regexp.h \
628 ..\scope.h \
629 ..\sv.h \
630 ..\thread.h \
631 ..\unixish.h \
632 ..\utf8.h \
633 ..\util.h \
634 ..\warnings.h \
635 ..\XSUB.h \
636 ..\EXTERN.h \
637 ..\perlvars.h \
638 ..\intrpvar.h \
639 ..\thrdvar.h \
640 .\include\dirent.h \
641 .\include\netdb.h \
642 .\include\sys\socket.h \
643 .\win32.h
644
2e64bfdb
JH
645CORE_H = $(CORE_NOCFG_H) .\config.h
646
647MICROCORE_OBJ = $(MICROCORE_SRC:.c=.obj)
648CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj)
649WIN32_OBJ = $(WIN32_SRC:.c=.obj)
650#WIN32_OBJ = $(WIN32_OBJ:.\=.\$(DLLDIR)\)
651MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\$(DLLDIR)\) \
652 $(MINIDIR)\miniperlmain$(o) \
653 $(MINIDIR)\perlio$(o)
654MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\$(DLLDIR)\)
655MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
656DLL_OBJ = $(DLL_SRC:.c=.obj)
657X2P_OBJ = $(X2P_SRC:.c=.obj)
658
659PERLDLL_OBJ = $(CORE_OBJ)
660PERLEXE_OBJ = perlmain$(o)
661
662PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
663#PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
664
e4451f11
JH
665!IF "$(USE_SETARGV)" != ""
666SETARGV_OBJ = setargv$(o)
667!ENDIF
668
669DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
670 Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
671 Sys/Hostname
672
673STATIC_EXT = DynaLoader
e4451f11
JH
674
675DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
e4451f11
JH
676
677ERRNO_PM = $(LIBDIR)\Errno.pm
678
e4451f11
JH
679
680EXTENSION_PM = \
681 $(ERRNO_PM)
682
683POD2HTML = $(PODDIR)\pod2html
684POD2MAN = $(PODDIR)\pod2man
685POD2LATEX = $(PODDIR)\pod2latex
686POD2TEXT = $(PODDIR)\pod2text
687
688CFG_VARS = \
689 "INST_DRV=$(INST_DRV)" \
690 "INST_TOP=$(INST_TOP)" \
691 "INST_VER=$(INST_VER)" \
692 "INST_ARCH=$(INST_ARCH)" \
693 "archname=$(ARCHNAME)" \
74d57dc4 694 "CC=$(CC)" \
e4451f11
JH
695 "ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT)" \
696 "cf_by=Rainer Keuchel" \
2e64bfdb 697 "cf_email=$(EMAIL)" \
e4451f11
JH
698 "d_crypt=$(D_CRYPT)" \
699 "d_mymalloc=$(PERL_MALLOC)" \
700 "libs=$(LIBFILES)" \
701 "incpath=$(CCINCDIR)" \
702 "libperl=$(PERLIMPLIB_EXP)" \
703 "libpth=$(LIBPATH)" \
704 "libc=$(LIBC)" \
705 "make=nmake" \
706 "static_ext=$(STATIC_EXT)" \
707 "dynamic_ext=$(DYNAMIC_EXT)" \
e4451f11 708 "useithreads=$(USE_ITHREADS)" \
e4451f11 709 "usemultiplicity=$(USE_MULTI)" \
18f68570 710 "useperlio=$(USE_PERLIO)" \
e4451f11
JH
711 "LINK_FLAGS=$(LDLIBPATH) $(LINK_FLAGS) $(SUBSYS)" \
712 "optimize=$(OPTIMIZE)"
713
714#
715# Top targets
716#
717
74a9a7e5 718all: hostminiperl $(MINIMOD) $(CONFIGPM) $(PERLEXE) Extensions
e4451f11
JH
719
720$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
721
e2a02c1e 722$(CONFIGPM): .\config.h ..\config.sh ..\minimod.pl
fefd7080 723 cd .. && $(HPERL) configpm --cross=$(CROSS_NAME) --no-glossary
e2a02c1e
VK
724 -mkdir $(XCOREDIR)
725 $(XCOPY) ..\*.h $(XCOREDIR)\*.*
726 $(XCOPY) *.h $(XCOREDIR)\*.*
e4451f11 727 $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
e2a02c1e 728 $(RCOPY) include $(XCOREDIR)\*.*
fefd7080
VK
729 -$(HPERL) -I..\lib -MCross=$(CROSS_NAME) config_h.PL "INST_VER=$(INST_VER)" "CORE_DIR=$(XCOREDIR)"
730 if errorlevel 1 $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
e4451f11 731
e2a02c1e
VK
732.\config.h:
733 -del /f config.h
734 copy config_H.ce config.h
735
736..\config.sh: config.ce config_sh.PL
fefd7080 737 $(HPERL) -I..\lib -I..\win32 config_sh.PL $(CFG_VARS) config.ce > ..\config.sh
e4451f11
JH
738
739$(MINIMOD) : ..\minimod.pl
18f68570 740 cd .. && $(HPERL) minimod.pl > lib\ExtUtils\Miniperl.pm
e4451f11
JH
741
742perlmain.c : runperl.c
743 $(COPY) runperl.c perlmain.c
744
745$(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
746 if not exist $(AUTODIR) mkdir $(AUTODIR)
747 cd $(EXTDIR)\$(*B)
3f2394f2
VK
748 $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) $(*B)_pm.PL
749 $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) XSLoader_pm.PL
e4451f11
JH
750 cd ..\..\wince
751 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
752 $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
753 cd $(EXTDIR)\$(*B)
754 $(XSUBPP) dl_win32.xs > $(*B).c
755 cd ..\..\wince
756
757$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
758 $(COPY) dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
759
fefd7080
VK
760#----------------------------------------------------------------------------------
761Extensions: ..\win32\buildext.pl $(PERLDEP) $(CONFIGPM)
762 $(HPERL) -I..\lib -I..\win32 -MCross=$(CROSS_NAME) ..\win32\buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) \
c96f74ce 763 !POSIX !Time/HiRes !XS/Typemap
fefd7080
VK
764
765Extensions_clean:
766 -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
767
768#----------------------------------------------------------------------------------
769
476a6acb 770$(PERLEXE_RES): perl.rc perl.ico
e4451f11
JH
771 rc $(RCDEFS) perl.rc
772
773clean:
774 -rm -f $(MACHINE)/dll/*
775 -rm -f $(MACHINE)/*.obj
776 -rm -f $(MACHINE)/*.exe
777 -rm -f $(MACHINE)/*.dll
778 -rm -f $(MACHINE)/*.lib
779 -rm -f ../config.sh ../lib/Config.pm
780 -rm -f config.h perl.res
781
e4451f11
JH
782XDLLOBJS = \
783$(DLLDIR)\av.obj \
784$(DLLDIR)\deb.obj \
785$(DLLDIR)\doio.obj \
786$(DLLDIR)\doop.obj \
787$(DLLDIR)\dump.obj \
788$(DLLDIR)\globals.obj \
789$(DLLDIR)\gv.obj \
790$(DLLDIR)\hv.obj \
791$(DLLDIR)\locale.obj \
792$(DLLDIR)\mg.obj \
793$(DLLDIR)\numeric.obj \
794$(DLLDIR)\op.obj \
b475b3e6 795$(DLLDIR)\pad.obj \
e4451f11
JH
796$(DLLDIR)\perl.obj \
797$(DLLDIR)\perlapi.obj \
798$(DLLDIR)\perlio.obj \
799$(DLLDIR)\perly.obj \
800$(DLLDIR)\pp.obj \
801$(DLLDIR)\pp_ctl.obj \
802$(DLLDIR)\pp_hot.obj \
803$(DLLDIR)\pp_pack.obj \
84d4ea48 804$(DLLDIR)\pp_sort.obj \
e4451f11 805$(DLLDIR)\pp_sys.obj \
10bc17b6 806$(DLLDIR)\reentr.obj \
e4451f11
JH
807$(DLLDIR)\regcomp.obj \
808$(DLLDIR)\regexec.obj \
809$(DLLDIR)\run.obj \
810$(DLLDIR)\scope.obj \
811$(DLLDIR)\sv.obj \
812$(DLLDIR)\taint.obj \
813$(DLLDIR)\toke.obj \
814$(DLLDIR)\universal.obj \
815$(DLLDIR)\utf8.obj \
816$(DLLDIR)\util.obj \
817$(DLLDIR)\win32thread.obj \
818$(DLLDIR)\wince.obj \
42165d27 819$(DLLDIR)\win32io.obj \
e4451f11
JH
820$(DLLDIR)\wincesck.obj \
821$(DLLDIR)\xsutils.obj \
822$(DLLDIR)\perllib.obj \
823$(DLLDIR)\DynaLoader.obj
2e64bfdb
JH
824!IF "$(PERL_MALLOC)" == "define"
825XDLLOBJS = $(XDLLOBJS) $(DLLDIR)\malloc.obj
826!ENDIF
81003058
VK
827!IF "$(CRYPT_SRC)" != ""
828XDLLOBJS = $(XDLLOBJS) $(DLLDIR)\fcrypt.obj
829!ENDIF
e4451f11
JH
830
831{$(SRCDIR)}.c{$(DLLDIR)}.obj:
832 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ $<
833
834{$(SRCDIR)/wince}.c{$(DLLDIR)}.obj:
835 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ $<
836
47bcb90d 837perldll.def : $(HPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
18f68570
VK
838 $(HPERL) -w ..\makedef.pl PLATFORM=wince $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
839 CCTYPE=$(CCTYPE) -DPERL_DLL=$(PERLDLL) > perldll.def
840
e4451f11
JH
841$(PERLDLL) : $(DLLDIR) perldll.def $(XDLLOBJS) $(PERLDLL_RES)
842 $(LINK32) -dll -def:perldll.def -out:$@ \
843 $(SUBSYS) $(LDLIBPATH) \
844 $(LINK_FLAGS) $(LIBFILES) \
845 $(XDLLOBJS) $(PERLDLL_RES)
846
847$(DLLDIR) :
848 if not exist "$(DLLDIR)" mkdir "$(DLLDIR)"
849
850$(DLLDIR)\DynaLoader.obj: $(EXTDIR)\DynaLoader\DynaLoader.c
851 $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB -Fo$(DLLDIR)\ \
852 $(EXTDIR)\DynaLoader\DynaLoader.c
853
854XPERLEXEOBJS = \
855$(MACHINE)\perlmain.obj
856
857$(PERLEXE) : $(PERLDLL) $(CONFIGPM) $(XPERLEXEOBJS) $(PERLEXE_RES) $(STARTOBJS)
e2a02c1e 858 $(XCOPY) $(MACHINE)\*.lib $(XCOREDIR)
2e64bfdb 859 $(LINK32) $(SUBSYS) $(LDLIBPATH) \
e4451f11
JH
860 -entry:wWinMainCRTStartup \
861 -out:$(MACHINE)\perl.exe \
862 -stack:0x100000 $(LINK_FLAGS) $(STARTOBJS) $(XPERLEXEOBJS) \
863 $(PERLIMPLIB) $(PERLEXE_RES) $(LIBFILES)
864
865$(MACHINE)\perlmain.obj : perlmain.c
866 $(CC) $(CFLAGS_O) -UPERLDLL -Fo$(MACHINE)\ -c perlmain.c
867
868iodll: $(IO_DLL)
869socketdll: $(SOCKET_DLL)
870dumperdll: $(DUMPER_DLL)
871
872dlls: socketdll iodll dumperdll
873 -xmkdir -p $(MACHINE)/lib/auto/IO
874 cp ../lib/auto/IO/IO.bs $(MACHINE)/lib/auto/IO
875 cp ../lib/auto/IO/IO.dll $(MACHINE)/lib/auto/IO
876 -xmkdir $(MACHINE)/lib/auto/Socket
877 cp ../lib/auto/Socket/Socket.bs $(MACHINE)/lib/auto/Socket
878 cp ../lib/auto/Socket/Socket.dll $(MACHINE)/lib/auto/Socket
879 -xmkdir -p $(MACHINE)/lib/auto/Data/Dumper
880 cp ../lib/auto/Data/Dumper/Dumper.bs $(MACHINE)/lib/auto/Data/Dumper
881 cp ../lib/auto/Data/Dumper/Dumper.dll $(MACHINE)/lib/auto/Data/Dumper
882
883makedist: all dlls
884 $(COPY) $(CELIBPATH)\celib.dll $(MACHINE)
885 cp perl.txt $(MACHINE)
886 cp registry.bat $(MACHINE)
887 cp ../lib/Config.pm $(MACHINE)/lib
888 cd $(MACHINE)
889 rm -f perl-$(MACHINE).tar.gz
890 sh -c "tar cf perl-$(MACHINE).tar *.exe *.dll *.txt *.bat lib"
891 gzip -9 perl-$(MACHINE).tar
892 mv perl-$(MACHINE).tar.gz h:/freenet/new
893 cd ..
894
895!if "$(MACHINE)" == "wince-arm-hpc-wce300"
896install: all
18f68570
VK
897 $(CECOPY) pc:$(MACHINE)/perl.exe ce:$(INSTALL_ROOT)/bin
898 $(CECOPY) pc:$(MACHINE)/perl$(PV).dll ce:$(INSTALL_ROOT)/bin
e4451f11 899install_dlls: dlls
18f68570 900 $(CECOPY) pc:../lib/auto/IO/io.dll ce:$(INSTALL_ROOT)/lib/auto/IO/io.dll
42165d27
VK
901!else
902install: all
903 -cemkdir "$(INSTALL_ROOT)"
904 -cemkdir "$(INSTALL_ROOT)\bin"
905 -cemkdir "$(INSTALL_ROOT)\lib"
906 $(CECOPY) "pc:$(MACHINE)/perl.exe" "ce:$(INSTALL_ROOT)/bin"
18f68570 907 $(CECOPY) "pc:$(MACHINE)/perl$(PV).dll" "ce:$(INSTALL_ROOT)/bin"
e2a02c1e 908 $(CECOPY) "pc:../xlib/$(CROSS_NAME)/Config.pm" "ce:$(INSTALL_ROOT)/lib"
e4451f11
JH
909!endif
910
2e64bfdb 911dist: all
c96f74ce
JH
912 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME)
913
914zipdist: all
915 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME)
916 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) --zip
917
918zip:
919 $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) --zip
2e64bfdb 920
18f68570
VK
921perl.ico:
922 $(HPERL) makeico.pl
e4451f11 923
18f68570 924hostminiperl: ..\miniperl.exe
e4451f11 925
18f68570
VK
926..\miniperl.exe:
927 cd ../win32
928 set PATH=$(CCHOME)\bin;$(PATH)
47bcb90d 929 $(MAKE) -f Makefile "CCHOME=$(MSVCDIR)" "CCINCDIR=$(CCHOME)\include" "CCLIBDIR=$(CCHOME)\lib" "INCLUDE=$(CCHOME)\include" "LIB=$(CCHOME)\lib" "LINK_FLAGS=" .\config.h ..\miniperl.exe
18f68570 930 cd ../wince
476a6acb 931
47bcb90d
VK
932host-install:
933 perl -MConfig -MExtUtils::Install -we "install({'../lib/CORE', qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)/CORE#},1)"
934 perl -MConfig -MExtUtils::Install -we "install({'../xlib/$(CROSS_NAME)', qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)#},1)"
935 perl -MConfig -MFile::Copy -we "copy qq#./$(MACHINE)/perl$(PV).lib#, qq#$$Config{installprefixexp}/xlib/$(CROSS_NAME)/CORE#"
936 perl -MConfig -MFile::Copy -we "copy qq#../lib/Cross.pm#, qq#$$Config{installprefixexp}/lib#"
74a9a7e5
VK
937 perl -MConfig -we "system qq#perl -pi.bak -we \"s{((arch^|priv)libexp)='.*'}{\$$1='# . \
938 quotemeta($$Config{installprefixexp}) . \
939 qq#/xlib/$(CROSS_NAME)'}\" $$Config{installprefixexp}/xlib/$(CROSS_NAME)/Config.pm#"