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