Full memory management support (memory.c & memory.h & mem.S)
[reactos.git] / reactos / Makefile
1 #
2 # Global makefile
3 #
4
5 #
6 # Select your host
7 #
8 #HOST = mingw32-linux
9 #HOST = mingw32-windows
10
11 PATH_TO_TOP = .
12
13 include rules.mak
14
15 #
16 # Required to run the system
17 #
18 COMPONENTS = iface_native iface_additional ntoskrnl
19 BUS = acpi isapnp
20 DLLS = ntdll kernel32 crtdll advapi32 fmifs gdi32 secur32 user32 ws2_32 \
21 msafd msvcrt shell32
22 SUBSYS = smss win32k csrss
23
24 #
25 # Select the server(s) you want to build
26 #
27 #SERVERS = posix linux os2
28 SERVERS = win32
29
30 #
31 # Select the loader(s) you want to build
32 #
33 #LOADERS = boot dos
34 LOADERS = dos
35
36 #
37 # Select the device drivers and filesystems you want
38 #
39 #DEVICE_DRIVERS = beep event floppy ide_test mouse sound test test1 parallel serial
40 DEVICE_DRIVERS = vidport vga blue ide null floppy
41
42 #INPUT_DRIVERS = keyboard
43 INPUT_DRIVERS = keyboard mouclass psaux
44
45 #FS_DRIVERS = vfat minix ext2 template
46 FS_DRIVERS = vfat ms np
47
48 #NET_DRIVERS = ndis tdi tcpip tditest wshtcpip afd
49 NET_DRIVERS = ndis tcpip tditest wshtcpip afd
50
51 #NET_DEVICE_DRIVERS = ne2000
52 NET_DEVICE_DRIVERS = ne2000
53
54 #
55 # system applications (required for startup)
56 #
57 #SYS_APPS = shell winlogon services
58 SYS_APPS = shell winlogon services
59
60 APPS = args hello test cat bench apc shm lpc thread event file gditest \
61 pteb consume dump_shared_data vmtest regtest alive mstest nptest \
62 objdir atomtest
63
64 #NET_APPS = ping roshttpd telnet
65 NET_APPS = ping
66
67
68 KERNEL_SERVICES = $(DEVICE_DRIVERS) $(INPUT_DRIVERS) $(FS_DRIVERS) $(NET_DRIVERS) $(NET_DEVICE_DRIVERS)
69
70 all: buildno $(COMPONENTS) $(BUS) $(DLLS) $(SUBSYS) $(LOADERS) $(KERNEL_SERVICES) $(SYS_APPS) $(APPS) $(NET_APPS)
71
72 .PHONY: all
73
74 clean: buildno_clean $(COMPONENTS:%=%_clean) $(BUS:%=%_clean) $(DLLS:%=%_clean) \
75 $(LOADERS:%=%_clean) $(KERNEL_SERVICES:%=%_clean) $(SUBSYS:%=%_clean) \
76 $(SYS_APPS:%=%_clean) $(APPS:%=%_clean) $(NET_APPS:%=%_clean)
77
78 .PHONY: clean
79
80 ifeq ($(HOST),mingw32-linux)
81 rcopy$(EXE_POSTFIX): rcopy.c
82 $(HOST_CC) -g -DUNIX_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
83 endif
84 ifeq ($(HOST),mingw32-windows)
85 rcopy$(EXE_POSTFIX): rcopy.c
86 $(HOST_CC) -g -DDOS_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
87 endif
88
89 ifeq ($(HOST),mingw32-linux)
90 rmkdir$(EXE_POSTFIX): rmkdir.c
91 $(HOST_CC) -g -DUNIX_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
92 endif
93 ifeq ($(HOST),mingw32-windows)
94 rmkdir$(EXE_POSTFIX): rmkdir.c
95 $(HOST_CC) -g -DDOS_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
96 endif
97
98
99 install: rcopy$(EXE_POSTFIX) rmkdir$(EXE_POSTFIX) make_install_dirs autoexec_install \
100 $(COMPONENTS:%=%_install) $(BUS:%=%_install) \
101 $(DLLS:%=%_install) $(LOADERS:%=%_install) \
102 $(KERNEL_SERVICES:%=%_install) $(SUBSYS:%=%_install) \
103 $(SYS_APPS:%=%_install) $(APPS:%=%_install)
104
105 dist: rcopy$(EXE_POSTFIX) clean_dist_dir make_dist_dirs $(COMPONENTS:%=%_dist) \
106 $(BUS:%=%_dist) $(DLLS:%=%_dist) \
107 $(LOADERS:%=%_dist) $(KERNEL_SERVICES:%=%_dist) $(SUBSYS:%=%_dist) \
108 $(SYS_APPS:%=%_dist) $(APPS:%=%_dist) $(NET_APPS:%=%_dist)
109
110 #
111 # Build number generator
112 #
113 buildno: include/reactos/version.h
114 make -C apps/buildno
115
116 buildno_clean:
117 make -C apps/buildno clean
118
119 buildno_dist:
120
121 buildno_install:
122
123 .PHONY: buildno buildno_clean buildno_dist buildno_install
124
125 #
126 # System Applications
127 #
128 $(SYS_APPS): %:
129 make -C apps/system/$*
130
131 $(SYS_APPS:%=%_clean): %_clean:
132 make -C apps/system/$* clean
133
134 $(SYS_APPS:%=%_dist): %_dist:
135 make -C apps/system/$* dist
136
137 $(SYS_APPS:%=%_install): %_install:
138 make -C apps/system/$* install
139
140 .PHONY: $(SYS_APPS) $(SYS_APPS:%=%_clean) $(SYS_APPS:%=%_install) $(SYS_APPS:%=%_dist)
141
142 #
143 # Applications
144 #
145 $(APPS): %:
146 make -C apps/$*
147
148 $(APPS:%=%_clean): %_clean:
149 make -C apps/$* clean
150
151 $(APPS:%=%_dist): %_dist:
152 make -C apps/$* dist
153
154 $(APPS:%=%_install): %_install:
155 make -C apps/$* install
156
157 .PHONY: $(APPS) $(APPS:%=%_clean) $(APPS:%=%_install) $(APPS:%=%_dist)
158
159 #
160 # Network applications
161 #
162 $(NET_APPS): %:
163 make -C apps/net/$*
164
165 $(NET_APPS:%=%_clean): %_clean:
166 make -C apps/net/$* clean
167
168 $(NET_APPS:%=%_dist): %_dist:
169 make -C apps/net/$* dist
170
171 $(NET_APPS:%=%_install): %_install:
172 make -C apps/net/$* install
173
174 .PHONY: $(NET_APPS) $(NET_APPS:%=%_clean) $(NET_APPS:%=%_install) $(NET_APPS:%=%_dist)
175
176 #
177 # Interfaces
178 #
179 iface_native:
180 make -C iface/native
181
182 iface_native_clean:
183 make -C iface/native clean
184
185 iface_native_install:
186
187 iface_native_dist:
188
189 iface_additional:
190 make -C iface/addsys
191
192 iface_additional_clean:
193 make -C iface/addsys clean
194
195 iface_additional_install:
196
197 iface_additional_dist:
198
199 .PHONY: iface_native iface_native_clean iface_native_install \
200 iface_native_dist \
201 iface_additional iface_additional_clean iface_additional_install \
202 iface_additional_dist
203
204 #
205 # Bus driver rules
206 #
207 $(BUS): %:
208 make -C services/bus/$*
209
210 $(BUS:%=%_clean): %_clean:
211 make -C services/bus/$* clean
212
213 $(BUS:%=%_install): %_install:
214 make -C services/bus/$* install
215
216 $(BUS:%=%_dist): %_dist:
217 make -C services/bus/$* dist
218
219 .PHONY: $(BUS) $(BUS:%=%_clean) \
220 $(BUS:%=%_install) $(BUS:%=%_dist)
221
222 #
223 # Device driver rules
224 #
225 $(DEVICE_DRIVERS): %:
226 make -C services/dd/$*
227
228 $(DEVICE_DRIVERS:%=%_clean): %_clean:
229 make -C services/dd/$* clean
230
231 $(DEVICE_DRIVERS:%=%_install): %_install:
232 make -C services/dd/$* install
233
234 $(DEVICE_DRIVERS:%=%_dist): %_dist:
235 make -C services/dd/$* dist
236
237 .PHONY: $(DEVICE_DRIVERS) $(DEVICE_DRIVERS:%=%_clean) \
238 $(DEVICE_DRIVERS:%=%_install) $(DEVICE_DRIVERS:%=%_dist)
239
240 #
241 # Input driver rules
242 #
243 $(INPUT_DRIVERS): %:
244 make -C services/input/$*
245
246 $(INPUT_DRIVERS:%=%_clean): %_clean:
247 make -C services/input/$* clean
248
249 $(INPUT_DRIVERS:%=%_install): %_install:
250 make -C services/input/$* install
251
252 $(INPUT_DRIVERS:%=%_dist): %_dist:
253 make -C services/input/$* dist
254
255 .PHONY: $(INPUT_DRIVERS) $(INPUT_DRIVERS:%=%_clean) \
256 $(INPUT_DRIVERS:%=%_install) $(INPUT_DRIVERS:%=%_dist)
257
258 $(FS_DRIVERS): %:
259 make -C services/fs/$*
260
261 $(FS_DRIVERS:%=%_clean): %_clean:
262 make -C services/fs/$* clean
263
264 $(FS_DRIVERS:%=%_install): %_install:
265 make -C services/fs/$* install
266
267 $(FS_DRIVERS:%=%_dist): %_dist:
268 make -C services/fs/$* dist
269
270 .PHONY: $(FS_DRIVERS) $(FS_DRIVERS:%=%_clean) $(FS_DRIVERS:%=%_install) \
271 $(FS_DRIVERS:%=%_dist)
272
273 #
274 # Network driver rules
275 #
276 $(NET_DRIVERS): %:
277 make -C services/net/$*
278
279 $(NET_DRIVERS:%=%_clean): %_clean:
280 make -C services/net/$* clean
281
282 $(NET_DRIVERS:%=%_install): %_install:
283 make -C services/net/$* install
284
285 $(NET_DRIVERS:%=%_dist): %_dist:
286 make -C services/net/$* dist
287
288 .PHONY: $(NET_DRIVERS) $(NET_DRIVERS:%=%_clean) $(NET_DRIVERS:%=%_install) \
289 $(NET_DRIVERS:%=%_dist)
290
291 $(NET_DEVICE_DRIVERS): %:
292 make -C services/net/dd/$*
293
294 $(NET_DEVICE_DRIVERS:%=%_clean): %_clean:
295 make -C services/net/dd/$* clean
296
297 $(NET_DEVICE_DRIVERS:%=%_install): %_install:
298 make -C services/net/dd/$* install
299
300 $(NET_DEVICE_DRIVERS:%=%_dist): %_dist:
301 make -C services/net/dd/$* dist
302
303 .PHONY: $(NET_DEVICE_DRIVERS) $(NET_DEVICE_DRIVERS:%=%_clean) \
304 $(NET_DEVICE_DRIVERS:%=%_install) $(NET_DEVICE_DRIVERS:%=%_dist)
305
306 #
307 # Kernel loaders
308 #
309
310 $(LOADERS): %:
311 make -C loaders/$*
312
313 $(LOADERS:%=%_clean): %_clean:
314 make -C loaders/$* clean
315
316 $(LOADERS:%=%_install): %_install:
317 make -C loaders/$* install
318
319 $(LOADERS:%=%_dist): %_dist:
320 make -C loaders/$* dist
321
322 .PHONY: $(LOADERS) $(LOADERS:%=%_clean) $(LOADERS:%=%_install) \
323 $(LOADERS:%=%_dist)
324
325 #
326 # Required system components
327 #
328
329 ntoskrnl:
330 make -C ntoskrnl
331
332 ntoskrnl_clean:
333 make -C ntoskrnl clean
334
335 ntoskrnl_install:
336 make -C ntoskrnl install
337
338 ntoskrnl_dist:
339 make -C ntoskrnl dist
340
341 .PHONY: ntoskrnl ntoskrnl_clean ntoskrnl_install ntoskrnl_dist
342
343 #
344 # Required DLLs
345 #
346
347 $(DLLS): %:
348 make -C lib/$*
349
350 $(DLLS:%=%_clean): %_clean:
351 make -C lib/$* clean
352
353 $(DLLS:%=%_install): %_install:
354 make -C lib/$* install
355
356 $(DLLS:%=%_dist): %_dist:
357 make -C lib/$* dist
358
359 .PHONY: $(DLLS) $(DLLS:%=%_clean) $(DLLS:%=%_install) $(DLLS:%=%_dist)
360
361 #
362 # Kernel Subsystems
363 #
364
365 $(SUBSYS): %:
366 make -C subsys/$*
367
368 $(SUBSYS:%=%_clean): %_clean:
369 make -C subsys/$* clean
370
371 $(SUBSYS:%=%_install): %_install:
372 make -C subsys/$* install
373
374 $(SUBSYS:%=%_dist): %_dist:
375 make -C subsys/$* dist
376
377 .PHONY: $(SUBSYS) $(SUBSYS:%=%_clean) $(SUBSYS:%=%_install) \
378 $(SUBSYS:%=%_dist)
379
380 #
381 # Make an install floppy
382 #
383 make_install_dirs:
384 ./rmkdir $(FLOPPY_DIR)/dlls
385 ./rmkdir $(FLOPPY_DIR)/apps
386 ./rmkdir $(FLOPPY_DIR)/drivers
387 ./rmkdir $(FLOPPY_DIR)/subsys
388
389
390 .PHONY: make_install_dirs
391
392 autoexec_install: $(FLOPPY_DIR)/autoexec.bat
393
394 $(FLOPPY_DIR)/autoexec.bat: bootflop.bat
395 $(CP) bootflop.bat $(FLOPPY_DIR)/autoexec.bat
396
397 #
398 # Make a distribution saveset
399 #
400
401 clean_dist_dir:
402 ifeq ($(DOSCLI),yes)
403 - $(RM) $(DIST_DIR)\dlls\*.dll
404 - $(RM) $(DIST_DIR)\apps\*.exe
405 - $(RM) $(DIST_DIR)\drivers\*.sys
406 - $(RM) $(DIST_DIR)\subsys\*.exe
407 - $(RMDIR) $(DIST_DIR)\dlls
408 - $(RMDIR) $(DIST_DIR)\apps
409 - $(RMDIR) $(DIST_DIR)\drivers
410 - $(RMDIR) $(DIST_DIR)\subsys
411 - $(RMDIR) $(DIST_DIR)
412 else
413 $(RM) -r $(DIST_DIR)
414 endif
415
416 make_dist_dirs: ./rmkdir
417 ./rmkdir $(DIST_DIR)
418 ./rmkdir $(DIST_DIR)/dlls
419 ./rmkdir $(DIST_DIR)/apps
420 ./rmkdir $(DIST_DIR)/drivers
421 ./rmkdir $(DIST_DIR)/dlls
422 ./rmkdir $(DIST_DIR)/subsys
423
424 .PHONY: clean_dist_dir make_dist_dirs
425
426 #
427 #
428 #
429 etags:
430 find . -name "*.[ch]" -print | etags --language=c -
431
432 # EOF