Added GNU Debugger stub for remote debugging.
[reactos.git] / reactos / Makefile
1 #
2 # Global makefile
3 #
4
5 PATH_TO_TOP = .
6
7 #
8 # Define to build WINE modules
9 #
10 ifeq ($(ROS_BUILD_WINE),)
11 ROS_BUILD_WINE = no
12 else
13 ROS_BUILD_WINE = yes
14 endif
15
16 include $(PATH_TO_TOP)/rules.mak
17
18 #
19 # Required to run the system
20 #
21 COMPONENTS = iface_native iface_additional hallib ntoskrnl
22 HALS = halx86
23 BUS = acpi isapnp pci
24 DLLS = ntdll kernel32 advapi32 crtdll msvcrt fmifs gdi32 msafd \
25 user32 secur32 ws2_32 version
26 SUBSYS = smss win32k csrss
27
28 #
29 # Select the server(s) you want to build
30 #
31 #SERVERS = posix linux os2
32 SERVERS = win32
33
34 #
35 # Select the loader(s) you want to build
36 #
37 #LOADERS = boot dos
38 LOADERS = dos
39
40 #
41 # Select the device drivers and filesystems you want
42 #
43 #DEVICE_DRIVERS = beep floppy mouse sound test parallel serial
44 DEVICE_DRIVERS = vidport vga blue ide null floppy
45
46 #INPUT_DRIVERS = keyboard
47 INPUT_DRIVERS = keyboard mouclass psaux
48
49 #FS_DRIVERS = vfat minix ext2 template
50 FS_DRIVERS = vfat ms np
51
52 #NET_DRIVERS = ndis tdi tcpip tditest wshtcpip afd
53 NET_DRIVERS = ndis tdi tcpip tditest wshtcpip afd
54
55 #NET_DEVICE_DRIVERS = ne2000
56 NET_DEVICE_DRIVERS = ne2000
57
58 #
59 # storage drivers (don't change the order)
60 #
61 STORAGE_DRIVERS = class2 scsiport atapi disk
62
63 #
64 # system applications (required for startup)
65 #
66 #SYS_APPS = lsass services shell winlogon
67 SYS_APPS = services shell winlogon
68
69 #readfile
70 APPS = args hello test cat bench apc shm lpc thread event file gditest \
71 pteb consume dump_shared_data vmtest regtest alive mstest nptest \
72 objdir atomtest winhello partinfo mutex stats
73
74
75 #lzexpand mapi32 (missing imports)
76 #dsound (missing winmm.dll)
77 WINE_DLLS = rpcrt4 ole32 oleaut32 oledlg olepro32 olecli olesvr \
78 shell32 shlwapi comctl32 shfolder shdocvw commdlg \
79 ddraw dinput dplay dplayx \
80 psapi richedit serialui winspool
81
82 WINE_PROGS = clock cmdlgtst control notepad osversioncheck \
83 progman uninstaller view wcmd winefile winemine \
84 winver
85
86 ifeq ($(ROS_BUILD_WINE),yes)
87 WINE_MODULES = $(WINE_DLLS) $(WINE_PROGS)
88 else
89 WINE_MODULES =
90 endif
91
92 KERNEL_SERVICES = $(DEVICE_DRIVERS) $(INPUT_DRIVERS) $(FS_DRIVERS) \
93 $(NET_DRIVERS) $(NET_DEVICE_DRIVERS) $(STORAGE_DRIVERS)
94
95 all: tools dk implib $(COMPONENTS) $(HALS) $(BUS) $(DLLS) $(SUBSYS) \
96 $(LOADERS) $(KERNEL_SERVICES) $(SYS_APPS) $(APPS) \
97 $(WINE_MODULES)
98
99 implib: $(COMPONENTS:%=%_implib) $(HALS:%=%_implib) $(BUS:%=%_implib) \
100 $(DLLS:%=%_implib) $(LOADERS:%=%_implib) \
101 $(KERNEL_SERVICES:%=%_implib) $(SUBSYS:%=%_implib) \
102 $(SYS_APPS:%=%_implib) $(APPS:%=%_implib) \
103 $(WINE_MODULES:%=%_implib)
104
105 clean: dk_clean $(HALS:%=%_clean) \
106 $(COMPONENTS:%=%_clean) $(BUS:%=%_clean) $(DLLS:%=%_clean) \
107 $(LOADERS:%=%_clean) $(KERNEL_SERVICES:%=%_clean) $(SUBSYS:%=%_clean) \
108 $(SYS_APPS:%=%_clean) $(APPS:%=%_clean) $(NET_APPS:%=%_clean) \
109 $(WINE_MODULES:%=%_clean) clean_after tools_clean
110
111 clean_after:
112 $(RM) $(PATH_TO_TOP)/include/roscfg.h
113
114 install: tools install_dirs install_before \
115 $(COMPONENTS:%=%_install) $(HALS:%=%_install) $(BUS:%=%_install) \
116 $(DLLS:%=%_install) $(LOADERS:%=%_install) \
117 $(KERNEL_SERVICES:%=%_install) $(SUBSYS:%=%_install) \
118 $(SYS_APPS:%=%_install) $(APPS:%=%_install) \
119 $(WINE_MODULES:%=%_install)
120
121 dist: $(TOOLS_PATH)/rcopy$(EXE_POSTFIX) dist_clean dist_dirs \
122 $(HALS:%=%_dist) $(COMPONENTS:%=%_dist) $(BUS:%=%_dist) $(DLLS:%=%_dist) \
123 $(LOADERS:%=%_dist) $(KERNEL_SERVICES:%=%_dist) $(SUBSYS:%=%_dist) \
124 $(SYS_APPS:%=%_dist) $(APPS:%=%_dist) $(NET_APPS:%=%_dist) \
125 $(WINE_MODULES:%=%_dist)
126
127 .PHONY: all implib clean clean_before install dist
128
129 #
130 # System Applications
131 #
132 $(SYS_APPS): %:
133 make -C apps/system/$*
134
135 $(SYS_APPS:%=%_implib): %_implib:
136 make -C apps/system/$* implib
137
138 $(SYS_APPS:%=%_clean): %_clean:
139 make -C apps/system/$* clean
140
141 $(SYS_APPS:%=%_dist): %_dist:
142 make -C apps/system/$* dist
143
144 $(SYS_APPS:%=%_install): %_install:
145 make -C apps/system/$* install
146
147 .PHONY: $(SYS_APPS) $(SYS_APPS:%=%_implib) $(SYS_APPS:%=%_clean) $(SYS_APPS:%=%_install) $(SYS_APPS:%=%_dist)
148
149 #
150 # Applications
151 #
152 $(APPS): %:
153 make -C apps/$*
154
155 $(APPS:%=%_implib): %_implib:
156 make -C apps/$* implib
157
158 $(APPS:%=%_clean): %_clean:
159 make -C apps/$* clean
160
161 $(APPS:%=%_dist): %_dist:
162 make -C apps/$* dist
163
164 $(APPS:%=%_install): %_install:
165 make -C apps/$* install
166
167 .PHONY: $(APPS) $(APPS:%=%_implib) $(APPS:%=%_clean) $(APPS:%=%_install) $(APPS:%=%_dist)
168
169 #
170 # Wine DLLs
171 #
172 $(WINE_DLLS): %:
173 make -f makefile.ros -C $(WINE_PATH)/dlls/$*
174
175 $(WINE_DLLS:%=%_implib): %_implib:
176 make -f makefile.ros -C $(WINE_PATH)/dlls/$* implib
177
178 $(WINE_DLLS:%=%_clean): %_clean:
179 make -f makefile.ros -C $(WINE_PATH)/dlls/$* clean
180
181 $(WINE_DLLS:%=%_dist): %_dist:
182 make -f makefile.ros -C $(WINE_PATH)/dlls/$* dist
183
184 $(WINE_DLLS:%=%_install): %_install:
185 make -f makefile.ros -C $(WINE_PATH)/dlls/$* install
186
187 .PHONY: $(WINE_DLLS) $(WINE_DLLS:%=%_implib) $(WINE_DLLS:%=%_clean) $(WINE_DLLS:%=%_install) $(WINE_DLLS:%=%_dist)
188
189
190 #
191 # Wine programs
192 #
193 $(WINE_PROGS): %:
194 make -f makefile.ros -C $(WINE_PATH)/programs/$*
195
196 $(WINE_PROGS:%=%_implib): %_implib:
197 make -f makefile.ros -C $(WINE_PATH)/programs/$* implib
198
199 $(WINE_PROGS:%=%_clean): %_clean:
200 make -f makefile.ros -C $(WINE_PATH)/programs/$* clean
201
202 $(WINE_PROGS:%=%_dist): %_dist:
203 make -f makefile.ros -C $(WINE_PATH)/programs/$* dist
204
205 $(WINE_PROGS:%=%_install): %_install:
206 make -f makefile.ros -C $(WINE_PATH)/programs/$* install
207
208 .PHONY: $(WINE_PROGS) $(WINE_PROGS:%=%_implib) $(WINE_PROGS:%=%_clean) $(WINE_PROGS:%=%_install) $(WINE_PROGS:%=%_dist)
209
210
211 #
212 # Tools
213 #
214 tools:
215 make -C tools
216
217 tools_implib:
218
219 tools_clean:
220 make -C tools clean
221
222 tools_install:
223
224 tools_dist:
225
226 .PHONY: tools tools_implib tools_clean tools_install tools_dist
227
228
229 #
230 # Developer Kits
231 #
232 dk:
233 $(RMKDIR) $(DK_PATH)
234 $(RMKDIR) $(DDK_PATH)
235 $(RMKDIR) $(DDK_PATH_LIB)
236 $(RMKDIR) $(DDK_PATH_INC)
237 $(RMKDIR) $(SDK_PATH)
238 $(RMKDIR) $(SDK_PATH_LIB)
239 $(RMKDIR) $(SDK_PATH_INC)
240 $(RMKDIR) $(XDK_PATH)
241 $(RMKDIR) $(XDK_PATH_LIB)
242 $(RMKDIR) $(XDK_PATH_INC)
243
244 dk_implib:
245
246 # WARNING! Be very sure that there are no important files
247 # in these directories before cleaning them!!!
248 dk_clean:
249 $(RM) $(DDK_PATH_LIB)/*.a
250 # $(RM) $(DDK_PATH_INC)/*.h
251 $(RMDIR) $(DDK_PATH_LIB)
252 # $(RMDIR) $(DDK_PATH_INC)
253 $(RM) $(SDK_PATH_LIB)/*.a
254 # $(RM) $(SDK_PATH_INC)/*.h
255 $(RMDIR) $(SDK_PATH_LIB)
256 # $(RMDIR) $(SDK_PATH_INC)
257 $(RM) $(XDK_PATH_LIB)/*.a
258 # $(RM) $(XDK_PATH_INC)/*.h
259 $(RMDIR) $(XDK_PATH_LIB)
260 # $(RMDIR) $(XDK_PATH_INC)
261
262 dk_install:
263
264 dk_dist:
265
266 .PHONY: dk dk_implib dk_clean dk_install dk_dist
267
268
269 #
270 # Interfaces
271 #
272 iface_native:
273 make -C iface/native
274
275 iface_native_implib:
276
277 iface_native_clean:
278 make -C iface/native clean
279
280 iface_native_install:
281
282 iface_native_dist:
283
284 iface_additional:
285 make -C iface/addsys
286
287 iface_additional_implib:
288
289 iface_additional_clean:
290 make -C iface/addsys clean
291
292 iface_additional_install:
293
294 iface_additional_dist:
295
296 .PHONY: iface_native iface_native_implib iface_native_clean iface_native_install \
297 iface_native_dist \
298 iface_additional iface_additional_implib iface_additional_clean \
299 iface_additional_install iface_additional_dist
300
301 #
302 # Bus driver rules
303 #
304 $(BUS): %:
305 make -C services/bus/$*
306
307 $(BUS:%=%_implib): %_implib:
308 make -C services/bus/$* implib
309
310 $(BUS:%=%_clean): %_clean:
311 make -C services/bus/$* clean
312
313 $(BUS:%=%_install): %_install:
314 make -C services/bus/$* install
315
316 $(BUS:%=%_dist): %_dist:
317 make -C services/bus/$* dist
318
319 .PHONY: $(BUS) $(BUS:%=%_implib) $(BUS:%=%_clean) \
320 $(BUS:%=%_install) $(BUS:%=%_dist)
321
322 #
323 # Device driver rules
324 #
325 $(DEVICE_DRIVERS): %:
326 make -C services/dd/$*
327
328 $(DEVICE_DRIVERS:%=%_implib): %_implib:
329 make -C services/dd/$* implib
330
331 $(DEVICE_DRIVERS:%=%_clean): %_clean:
332 make -C services/dd/$* clean
333
334 $(DEVICE_DRIVERS:%=%_install): %_install:
335 make -C services/dd/$* install
336
337 $(DEVICE_DRIVERS:%=%_dist): %_dist:
338 make -C services/dd/$* dist
339
340 .PHONY: $(DEVICE_DRIVERS) $(DEVICE_DRIVERS:%=%_implib) $(DEVICE_DRIVERS:%=%_clean) \
341 $(DEVICE_DRIVERS:%=%_install) $(DEVICE_DRIVERS:%=%_dist)
342
343 #
344 # Input driver rules
345 #
346 $(INPUT_DRIVERS): %:
347 make -C services/input/$*
348
349 $(INPUT_DRIVERS:%=%_implib): %_implib:
350 make -C services/input/$* implib
351
352 $(INPUT_DRIVERS:%=%_clean): %_clean:
353 make -C services/input/$* clean
354
355 $(INPUT_DRIVERS:%=%_install): %_install:
356 make -C services/input/$* install
357
358 $(INPUT_DRIVERS:%=%_dist): %_dist:
359 make -C services/input/$* dist
360
361 .PHONY: $(INPUT_DRIVERS) $(INPUT_DRIVERS:%=%_implib) $(INPUT_DRIVERS:%=%_clean)\
362 $(INPUT_DRIVERS:%=%_install) $(INPUT_DRIVERS:%=%_dist)
363
364 $(FS_DRIVERS): %:
365 make -C services/fs/$*
366
367 $(FS_DRIVERS:%=%_implib): %_implib:
368 make -C services/fs/$* implib
369
370 $(FS_DRIVERS:%=%_clean): %_clean:
371 make -C services/fs/$* clean
372
373 $(FS_DRIVERS:%=%_install): %_install:
374 make -C services/fs/$* install
375
376 $(FS_DRIVERS:%=%_dist): %_dist:
377 make -C services/fs/$* dist
378
379 .PHONY: $(FS_DRIVERS) $(FS_DRIVERS:%=%_implib) $(FS_DRIVERS:%=%_clean) \
380 $(FS_DRIVERS:%=%_install) $(FS_DRIVERS:%=%_dist)
381
382 #
383 # Network driver rules
384 #
385 $(NET_DRIVERS): %:
386 make -C services/net/$*
387
388 $(NET_DRIVERS:%=%_implib): %_implib:
389 make -C services/net/$* implib
390
391 $(NET_DRIVERS:%=%_clean): %_clean:
392 make -C services/net/$* clean
393
394 $(NET_DRIVERS:%=%_install): %_install:
395 make -C services/net/$* install
396
397 $(NET_DRIVERS:%=%_dist): %_dist:
398 make -C services/net/$* dist
399
400 .PHONY: $(NET_DRIVERS) $(NET_DRIVERS:%=%_implib) $(NET_DRIVERS:%=%_clean) \
401 $(NET_DRIVERS:%=%_install) $(NET_DRIVERS:%=%_dist)
402
403 $(NET_DEVICE_DRIVERS): %:
404 make -C services/net/dd/$*
405
406 $(NET_DEVICE_DRIVERS:%=%_implib): %_implib:
407 make -C services/net/dd/$* implib
408
409 $(NET_DEVICE_DRIVERS:%=%_clean): %_clean:
410 make -C services/net/dd/$* clean
411
412 $(NET_DEVICE_DRIVERS:%=%_install): %_install:
413 make -C services/net/dd/$* install
414
415 $(NET_DEVICE_DRIVERS:%=%_dist): %_dist:
416 make -C services/net/dd/$* dist
417
418 .PHONY: $(NET_DEVICE_DRIVERS) $(NET_DEVICE_DRIVERS:%=%_clean) $(NET_DEVICE_DRIVERS:%=%_implib) \
419 $(NET_DEVICE_DRIVERS:%=%_install) $(NET_DEVICE_DRIVERS:%=%_dist)
420
421 #
422 # storage driver rules
423 #
424 $(STORAGE_DRIVERS): %:
425 make -C services/storage/$*
426
427 $(STORAGE_DRIVERS:%=%_implib): %_implib:
428 make -C services/storage/$* implib
429
430 $(STORAGE_DRIVERS:%=%_clean): %_clean:
431 make -C services/storage/$* clean
432
433 $(STORAGE_DRIVERS:%=%_install): %_install:
434 make -C services/storage/$* install
435
436 $(STORAGE_DRIVERS:%=%_dist): %_dist:
437 make -C services/storage/$* dist
438
439 .PHONY: $(STORAGE_DRIVERS) $(STORAGE_DRIVERS:%=%_clean) \
440 $(STORAGE_DRIVERS:%=%_install) $(STORAGE_DRIVERS:%=%_dist)
441
442 #
443 # Kernel loaders
444 #
445
446 $(LOADERS): %:
447 make -C loaders/$*
448
449 $(LOADERS:%=%_implib): %_implib:
450
451 $(LOADERS:%=%_clean): %_clean:
452 make -C loaders/$* clean
453
454 $(LOADERS:%=%_install): %_install:
455 make -C loaders/$* install
456
457 $(LOADERS:%=%_dist): %_dist:
458 make -C loaders/$* dist
459
460 .PHONY: $(LOADERS) $(LOADERS:%=%_implib) $(LOADERS:%=%_clean) $(LOADERS:%=%_install) \
461 $(LOADERS:%=%_dist)
462
463 #
464 # Required system components
465 #
466
467 ntoskrnl:
468 make -C ntoskrnl
469
470 ntoskrnl_implib:
471 make -C ntoskrnl implib
472
473 ntoskrnl_clean:
474 make -C ntoskrnl clean
475
476 ntoskrnl_install:
477 make -C ntoskrnl install
478
479 ntoskrnl_dist:
480 make -C ntoskrnl dist
481
482 .PHONY: ntoskrnl ntoskrnl_implib ntoskrnl_clean ntoskrnl_install ntoskrnl_dist
483
484 #
485 # Hardware Abstraction Layer import library
486 #
487
488 hallib:
489 make -C hal/hal
490
491 hallib_implib:
492 make -C hal/hal implib
493
494 hallib_clean:
495 make -C hal/hal clean
496
497 hallib_install:
498 make -C hal/hal install
499
500 hallib_dist:
501 make -C hal/hal dist
502
503 .PHONY: hallib hallib_implib hallib_clean hallib_install hallib_dist
504
505 #
506 # Hardware Abstraction Layers
507 #
508
509 $(HALS): %:
510 make -C hal/$*
511
512 $(HALS:%=%_implib): %_implib:
513 make -C hal/$* implib
514
515 $(HALS:%=%_clean): %_clean:
516 make -C hal/$* clean
517
518 $(HALS:%=%_install): %_install:
519 make -C hal/$* install
520
521 $(HALS:%=%_dist): %_dist:
522 make -C hal/$* dist
523
524 .PHONY: $(HALS) $(HALS:%=%_implib) $(HALS:%=%_clean) $(HALS:%=%_install) $(HALS:%=%_dist)
525
526 #
527 # Required DLLs
528 #
529
530 $(DLLS): %:
531 make -C lib/$*
532
533 $(DLLS:%=%_implib): %_implib:
534 make -C lib/$* implib
535
536 $(DLLS:%=%_clean): %_clean:
537 make -C lib/$* clean
538
539 $(DLLS:%=%_install): %_install:
540 make -C lib/$* install
541
542 $(DLLS:%=%_dist): %_dist:
543 make -C lib/$* dist
544
545 .PHONY: $(DLLS) $(DLLS:%=%_implib) $(DLLS:%=%_clean) $(DLLS:%=%_install) $(DLLS:%=%_dist)
546
547 #
548 # Kernel Subsystems
549 #
550
551 $(SUBSYS): %:
552 make -C subsys/$*
553
554 $(SUBSYS:%=%_implib): %_implib:
555 make -C subsys/$* implib
556
557 $(SUBSYS:%=%_clean): %_clean:
558 make -C subsys/$* clean
559
560 $(SUBSYS:%=%_install): %_install:
561 make -C subsys/$* install
562
563 $(SUBSYS:%=%_dist): %_dist:
564 make -C subsys/$* dist
565
566 .PHONY: $(SUBSYS) $(SUBSYS:%=%_implib) $(SUBSYS:%=%_clean) $(SUBSYS:%=%_install) \
567 $(SUBSYS:%=%_dist)
568
569 #
570 # Create an installation
571 #
572
573 install_clean:
574 $(RM) $(INSTALL_DIR)/system32/drivers/*.*
575 $(RM) $(INSTALL_DIR)/system32/config/*.*
576 $(RM) $(INSTALL_DIR)/system32/*.*
577 $(RM) $(INSTALL_DIR)/symbols/*.*
578 $(RM) $(INSTALL_DIR)/media/fonts/*.*
579 $(RM) $(INSTALL_DIR)/media/*.*
580 $(RM) $(INSTALL_DIR)/bin/*.*
581 $(RM) $(INSTALL_DIR)/*.com
582 $(RM) $(INSTALL_DIR)/*.bat
583 $(RMDIR) $(INSTALL_DIR)/system32/drivers
584 $(RMDIR) $(INSTALL_DIR)/system32/config
585 $(RMDIR) $(INSTALL_DIR)/system32
586 $(RMDIR) $(INSTALL_DIR)/symbols
587 $(RMDIR) $(INSTALL_DIR)/media/fonts
588 $(RMDIR) $(INSTALL_DIR)/media
589 $(RMDIR) $(INSTALL_DIR)/bin
590 $(RMDIR) $(INSTALL_DIR)
591
592 install_dirs:
593 $(RMKDIR) $(INSTALL_DIR)
594 $(RMKDIR) $(INSTALL_DIR)/bin
595 $(RMKDIR) $(INSTALL_DIR)/media
596 $(RMKDIR) $(INSTALL_DIR)/media/fonts
597 $(RMKDIR) $(INSTALL_DIR)/symbols
598 $(RMKDIR) $(INSTALL_DIR)/system32
599 $(RMKDIR) $(INSTALL_DIR)/system32/config
600 $(RMKDIR) $(INSTALL_DIR)/system32/drivers
601
602 install_before:
603 $(CP) boot.bat $(INSTALL_DIR)/boot.bat
604 $(CP) aboot.bat $(INSTALL_DIR)/aboot.bat
605 $(CP) boot.hiv $(INSTALL_DIR)/system32/boot.hiv
606 $(CP) media/fonts/helb____.ttf $(INSTALL_DIR)/media/fonts/helb____.ttf
607 $(CP) media/fonts/timr____.ttf $(INSTALL_DIR)/media/fonts/timr____.ttf
608
609 .PHONY: install_clean install_dirs install_before
610
611
612 #
613 # Make a distribution saveset
614 #
615
616 dist_clean:
617 $(RM) $(DIST_DIR)/symbols/*.sym
618 $(RM) $(DIST_DIR)/drivers/*.sys
619 $(RM) $(DIST_DIR)/subsys/*.exe
620 $(RM) $(DIST_DIR)/dlls/*.dll
621 $(RM) $(DIST_DIR)/apps/*.exe
622 $(RM) $(DIST_DIR)/*.exe
623 $(RMDIR) $(DIST_DIR)/symbols
624 $(RMDIR) $(DIST_DIR)/subsys
625 $(RMDIR) $(DIST_DIR)/drivers
626 $(RMDIR) $(DIST_DIR)/dlls
627 $(RMDIR) $(DIST_DIR)/apps
628 $(RMDIR) $(DIST_DIR)
629
630 dist_dirs:
631 $(RMKDIR) $(DIST_DIR)
632 $(RMKDIR) $(DIST_DIR)/apps
633 $(RMKDIR) $(DIST_DIR)/dlls
634 $(RMKDIR) $(DIST_DIR)/drivers
635 $(RMKDIR) $(DIST_DIR)/subsys
636 $(RMKDIR) $(DIST_DIR)/symbols
637
638 .PHONY: dist_clean dist_dirs
639
640
641 etags:
642 find . -name "*.[ch]" -print | etags --language=c -
643
644 # EOF