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