2004-10-18 Casper S. Hornstrup <chorns@users.sourceforge.net>
[reactos.git] / reactos / tools / helper.mk
1 # $Id: helper.mk,v 1.87 2004/10/18 19:11:09 chorns Exp $
2 #
3 # Helper makefile for ReactOS modules
4 # Variables this makefile accepts:
5 # $TARGET_TYPE = Type of target:
6 # program = User mode program
7 # proglib = Executable program that have exported functions
8 # dynlink = Dynamic Link Library (DLL)
9 # library = Library that will be linked with other code
10 # driver = Kernel mode driver
11 # export_driver = Kernel mode driver that have exported functions
12 # driver_library = Import library for a driver
13 # kmlibrary = Static kernel-mode library
14 # hal = Hardware Abstraction Layer
15 # bootpgm = Boot program
16 # miniport = Kernel mode driver that does not link with ntoskrnl.exe or hal.dll
17 # gdi_driver = Kernel mode graphics driver that link with win32k.sys
18 # subsystem = Kernel subsystem
19 # kmdll = Kernel mode DLL
20 # winedll = DLL imported from wine
21 # kernel = ReactOS kernel
22 # $TARGET_APPTYPE = Application type (windows,native,console).
23 # Required only for TARGET_TYPEs program and proglib
24 # $TARGET_NAME = Base name of output file and .rc, .def, and .edf files
25 # $TARGET_OBJECTS = Object files that compose the module
26 # $TARGET_CPPAPP = C++ application (no,yes) (optional)
27 # $TARGET_HEADERS = Header files that the object files depend on (optional)
28 # $TARGET_DEFNAME = Base name of .def and .edf files (optional)
29 # $TARGET_BASENAME = Base name of output file (overrides $TARGET_NAME if it exists) (optional)
30 # $TARGET_EXTENSION = Extension of the output file (optional)
31 # $TARGET_DDKLIBS = DDK libraries that are to be imported by the module (optional)
32 # $TARGET_SDKLIBS = SDK libraries that are to be imported by the module (optional)
33 # $TARGET_LIBS = Other libraries that are to be imported by the module (optional)
34 # $TARGET_GCCLIBS = GCC libraries imported with -l (optional)
35 # $TARGET_LFLAGS = GCC flags when linking (optional)
36 # $TARGET_CFLAGS = GCC flags (optional)
37 # $TARGET_CPPFLAGS = G++ flags (optional)
38 # $TARGET_ASFLAGS = GCC assembler flags (optional)
39 # $TARGET_NFLAGS = NASM flags (optional)
40 # $TARGET_RCFLAGS = Windres flags (optional)
41 # $TARGET_CLEAN = Files that are part of the clean rule (optional)
42 # $TARGET_PATH = Relative path for *.def, *.edf, and *.rc (optional)
43 # $TARGET_BASE = Default base address (optional)
44 # $TARGET_ENTRY = Entry point (optional)
45 # $TARGET_NORC = Do not include standard resource file (no,yes) (optional)
46 # $TARGET_LIBPATH = Destination path for static libraries (optional)
47 # $TARGET_IMPLIBPATH = Destination path for import libraries (optional)
48 # $TARGET_INSTALLDIR = Destination path when installed (optional)
49 # $TARGET_PCH = Filename of header to use to generate a PCH if supported by the compiler (optional)
50 # $TARGET_BOOTSTRAP = Whether this file is needed to bootstrap the installation (no,yes) (optional)
51 # $TARGET_BOOTSTRAP_NAME = Name on the installation medium (optional)
52 # $TARGET_REGTESTS = This module has regression tests (no,yes) (optional)
53 # $TARGET_BUILDENV_TEST = Build this test to be run in the build environment (no,yes) (optional)
54 # $SUBDIRS = Subdirs in which to run make (optional)
55
56 include $(PATH_TO_TOP)/config
57 include $(PATH_TO_TOP)/baseaddress.cfg
58
59 ifeq ($(TARGET_PATH),)
60 TARGET_PATH := .
61 endif
62
63 ifeq ($(ARCH),i386)
64 MK_ARCH_ID := _M_IX86
65 endif
66
67 ifeq ($(ARCH),alpha)
68 MK_ARCH_ID := _M_ALPHA
69 endif
70
71 ifeq ($(ARCH),mips)
72 MK_ARCH_ID := _M_MIPS
73 endif
74
75 ifeq ($(ARCH),powerpc)
76 MK_ARCH_ID := _M_PPC
77 endif
78
79 # unknown architecture
80 ifeq ($(MK_ARCH_ID),)
81 MK_ARCH_ID := _M_UNKNOWN
82 endif
83
84 #
85 # VARIABLES IN USE BY VARIOUS TARGETS
86 #
87 # MK_BOOTCDDIR = Directory on the ReactOS ISO CD in which to place the file (subdir of reactos/)
88 # MK_CFLAGS = C compiler command-line flags for this target
89 # MK_CPPFLAGS = C++ compiler command-line flags for this target
90 # MK_DDKLIBS = Import libraries from the ReactOS DDK to link with
91 # MK_DEFENTRY = Module entry point:
92 # _WinMain@16 for windows EXE files that are export libraries
93 # _DriverEntry@8 for .SYS files
94 # _DllMain@12 for .DLL files
95 # _DrvEnableDriver@12 for GDI drivers
96 # _WinMainCRTStartup for Win32 EXE files
97 # _NtProcessStartup@4 for Native EXE files
98 # _mainCRTStartup for Console EXE files
99 # MK_DEFEXT = Extension to give compiled modules (.EXE, .DLL, .SYS, .a)
100 # MK_DISTDIR = (unused?)
101 # MK_EXETYPE = Compiler option packages based on type of PE file (exe, dll)
102 # MK_IMPLIB = Whether or not to generate a DLL import stub library (yes, no)
103 # MK_IMPLIB_EXT = Extension to give import libraries (.a always)
104 # MK_IMPLIBDEFPATH = Default place to put the import stub library when built
105 # MK_IMPLIBONLY = Whether the target is only an import library (yes, no; used only by generic hal)
106 # MK_INSTALLDIR = Where "make install" should put the target, relative to reactos/
107 # MK_MODE = Mode the target's code is intended to run in
108 # user - User-mode compiler settings
109 # kernel - Kernel-mode compiler settings
110 # static - Static library compiler settings
111 # MK_RCFLAGS = Flags to add to resource compiler command line
112 # MK_RES_BASE = Base name of resource files
113 # MK_SDKLIBS = Default SDK libriaries to link with
114 #
115
116 ifeq ($(TARGET_TYPE),program)
117 MK_MODE := user
118 MK_EXETYPE := exe
119 MK_DEFEXT := .exe
120 MK_DEFENTRY := _DEFINE_TARGET_APPTYPE
121 MK_DDKLIBS :=
122 MK_SDKLIBS :=
123 MK_CFLAGS := -I.
124 MK_CPPFLAGS := -I.
125 MK_IMPLIB := no
126 MK_IMPLIBONLY := no
127 MK_IMPLIBDEFPATH :=
128 MK_IMPLIB_EXT := .a
129 MK_INSTALLDIR := bin
130 MK_BOOTCDDIR := system32
131 MK_DISTDIR := apps
132 MK_RES_BASE := $(TARGET_NAME)
133 endif
134
135 ifeq ($(TARGET_TYPE),proglib)
136 MK_MODE := user
137 MK_EXETYPE := dll
138 MK_DEFEXT := .exe
139 MK_DEFENTRY := _WinMain@16
140 MK_DDKLIBS :=
141 MK_SDKLIBS :=
142 MK_CFLAGS := -I.
143 MK_CPPFLAGS := -I.
144 MK_IMPLIB := yes
145 MK_IMPLIBONLY := no
146 MK_IMPLIBDEFPATH := $(SDK_PATH_LIB)
147 MK_IMPLIB_EXT := .a
148 MK_INSTALLDIR := bin
149 MK_BOOTCDDIR := system32
150 MK_DISTDIR := apps
151 MK_RES_BASE := $(TARGET_NAME)
152 endif
153
154 ifeq ($(TARGET_TYPE),dynlink)
155 MK_MODE := user
156 MK_EXETYPE := dll
157 MK_DEFEXT := .dll
158 MK_DEFENTRY := _DllMain@12
159 MK_DDKLIBS :=
160 MK_SDKLIBS :=
161 MK_CFLAGS := -I.
162 MK_CPPFLAGS := -I.
163 MK_IMPLIB := yes
164 MK_IMPLIBONLY := no
165 MK_IMPLIBDEFPATH := $(SDK_PATH_LIB)
166 MK_IMPLIB_EXT := .a
167 MK_INSTALLDIR := system32
168 MK_BOOTCDDIR := system32
169 MK_DISTDIR := dlls
170 MK_RES_BASE := $(TARGET_NAME)
171 endif
172
173 ifeq ($(TARGET_TYPE),library)
174 TARGET_NORC := yes
175 MK_MODE := static
176 MK_EXETYPE :=
177 MK_DEFEXT := .a
178 MK_DEFENTRY :=
179 MK_DDKLIBS :=
180 MK_SDKLIBS :=
181 MK_CFLAGS := -I.
182 MK_CPPFLAGS := -I.
183 MK_IMPLIB := no
184 MK_IMPLIBONLY := no
185 MK_IMPLIBDEFPATH :=
186 MK_IMPLIB_EXT :=
187 MK_INSTALLDIR := # none
188 MK_BOOTCDDIR := system32
189 MK_DISTDIR := # none
190 MK_RES_BASE :=
191 endif
192
193 ifeq ($(TARGET_TYPE),kmlibrary)
194 TARGET_NORC := yes
195 MK_MODE := static
196 MK_DEFEXT := .a
197 MK_CFLAGS := -I.
198 MK_CPPFLAGS := -I.
199 MK_IMPLIB := no
200 MK_IMPLIBONLY := no
201 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
202 #MK_IMPLIB_EXT :=
203 endif
204
205 ifeq ($(TARGET_TYPE),driver_library)
206 MK_MODE := kernel
207 MK_EXETYPE := dll
208 MK_DEFEXT := .dll
209 MK_DEFENTRY :=
210 MK_DDKLIBS :=
211 MK_SDKLIBS :=
212 MK_CFLAGS := -I.
213 MK_CPPFLAGS := -I.
214 MK_IMPLIB := no
215 MK_IMPLIBONLY := yes
216 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
217 MK_IMPLIB_EXT := .a
218 MK_INSTALLDIR := $(DDK_PATH_INC)
219 MK_BOOTCDDIR := .
220 MK_DISTDIR := # FIXME
221 MK_RES_BASE :=
222 endif
223
224 ifeq ($(TARGET_TYPE),driver)
225 MK_MODE := kernel
226 MK_EXETYPE := dll
227 MK_DEFEXT := .sys
228 MK_DEFENTRY := _DriverEntry@8
229 MK_DDKLIBS := ntoskrnl.a hal.a
230 MK_SDKLIBS :=
231 MK_CFLAGS := -D__NTDRIVER__ -I.
232 MK_CPPFLAGS := -D__NTDRIVER__ -I.
233 MK_IMPLIB := no
234 MK_IMPLIBONLY := no
235 MK_IMPLIBDEFPATH :=
236 MK_IMPLIB_EXT := .a
237 MK_INSTALLDIR := system32/drivers
238 MK_BOOTCDDIR := .
239 MK_DISTDIR := drivers
240 MK_RES_BASE := $(TARGET_NAME)
241 endif
242
243 ifeq ($(TARGET_TYPE),export_driver)
244 MK_MODE := kernel
245 MK_EXETYPE := dll
246 MK_DEFEXT := .sys
247 MK_DEFENTRY := _DriverEntry@8
248 MK_DDKLIBS := ntoskrnl.a hal.a
249 MK_SDKLIBS :=
250 MK_CFLAGS := -D__NTDRIVER__ -I.
251 MK_CPPFLAGS := -D__NTDRIVER__ -I.
252 MK_IMPLIB := yes
253 MK_IMPLIBONLY := no
254 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
255 MK_IMPLIB_EXT := .a
256 MK_INSTALLDIR := system32/drivers
257 MK_BOOTCDDIR := .
258 MK_DISTDIR := drivers
259 MK_RES_BASE := $(TARGET_NAME)
260 endif
261
262 ifeq ($(TARGET_TYPE),hal)
263 MK_MODE := kernel
264 MK_EXETYPE := dll
265 MK_DEFEXT := .dll
266 MK_DEFENTRY := _DriverEntry@8
267 MK_DDKLIBS := ntoskrnl.a
268 MK_SDKLIBS :=
269 MK_CFLAGS := -D__NTHAL__ -I.
270 MK_CPPFLAGS := -D__NTHAL__ -I.
271 MK_IMPLIB := yes
272 MK_IMPLIBONLY := no
273 MK_IMPLIBDEFPATH :=
274 MK_IMPLIB_EXT := .a
275 MK_INSTALLDIR := system32
276 MK_BOOTCDDIR := .
277 MK_DISTDIR := dlls
278 MK_RES_BASE := $(TARGET_NAME)
279 endif
280
281 ifeq ($(TARGET_TYPE),bootpgm)
282 MK_MODE := kernel
283 MK_EXETYPE := exe
284 MK_DEFEXT := .exe
285 MK_DEFENTRY := _DriverEntry@8
286 MK_DDKLIBS :=
287 MK_SDKLIBS :=
288 MK_CFLAGS := -D__NTDRIVER__ -I.
289 MK_CPPFLAGS := -D__NTDRIVER__ -I.
290 MK_IMPLIB := no
291 MK_IMPLIBONLY := no
292 MK_IMPLIBDEFPATH :=
293 MK_IMPLIB_EXT := .a
294 MK_INSTALLDIR := system32
295 MK_BOOTCDDIR := system32
296 MK_DISTDIR := # FIXME
297 MK_RES_BASE := $(TARGET_NAME)
298 endif
299
300 ifeq ($(TARGET_TYPE),miniport)
301 MK_MODE := kernel
302 MK_EXETYPE := dll
303 MK_DEFEXT := .sys
304 MK_DEFENTRY := _DriverEntry@8
305 MK_DDKLIBS :=
306 MK_SDKLIBS :=
307 MK_CFLAGS := -D__NTDRIVER__ -I.
308 MK_CPPFLAGS := -D__NTDRIVER__ -I.
309 MK_IMPLIB := no
310 MK_IMPLIBONLY := no
311 MK_IMPLIBDEFPATH :=
312 MK_IMPLIB_EXT := .a
313 MK_INSTALLDIR := system32/drivers
314 MK_BOOTCDDIR := .
315 MK_DISTDIR := drivers
316 MK_RES_BASE := $(TARGET_NAME)
317 endif
318
319 ifeq ($(TARGET_TYPE),gdi_driver)
320 MK_MODE := kernel
321 MK_EXETYPE := dll
322 MK_DEFEXT := .dll
323 MK_DEFENTRY := _DrvEnableDriver@12
324 MK_DDKLIBS := ntoskrnl.a hal.a win32k.a
325 MK_SDKLIBS :=
326 MK_CFLAGS := -D__NTDRIVER__ -I.
327 MK_CPPFLAGS := -D__NTDRIVER__ -I.
328 MK_IMPLIB := yes
329 MK_IMPLIBONLY := no
330 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
331 MK_IMPLIB_EXT := .a
332 MK_INSTALLDIR := system32
333 MK_BOOTCDDIR := .
334 MK_DISTDIR := dlls
335 MK_RES_BASE := $(TARGET_NAME)
336 endif
337
338 ifeq ($(TARGET_TYPE),kernel)
339 MK_MODE := kernel
340 MK_EXETYPE := dll
341 MK_DEFEXT := .exe
342 MK_DEFENTRY := _NtProcessStartup
343 MK_DDKLIBS := hal.a
344 MK_SDKLIBS :=
345 MK_CFLAGS := -D__NTOSKRNL__ -I.
346 MK_CPPFLAGS := -D__NTOSKRNL__ -I.
347 MK_IMPLIB := yes
348 MK_IMPLIBONLY := no
349 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
350 MK_IMPLIB_EXT := .a
351 MK_INSTALLDIR := system32
352 MK_BOOTCDDIR := .
353 MK_RES_BASE := $(TARGET_NAME)
354 endif
355
356
357 # can be overidden with $(CXX) for linkage of c++ executables
358 LD_CC = $(CC)
359
360 ifeq ($(RM_AT_FROM_SYMBOLS),no)
361 MK_KILLAT :=
362 else
363 MK_KILLAT := --kill-at
364 endif
365
366 ifeq ($(TARGET_TYPE),program)
367 ifeq ($(TARGET_APPTYPE),windows)
368 MK_DEFENTRY := _WinMainCRTStartup
369 MK_SDKLIBS := ntdll.a kernel32.a gdi32.a user32.a
370 TARGET_LFLAGS += -Wl,--subsystem,windows
371 endif
372
373 ifeq ($(TARGET_APPTYPE),native)
374 MK_DEFENTRY := _NtProcessStartup@4
375 MK_SDKLIBS := ntdll.a
376 TARGET_LFLAGS += -Wl,--subsystem,native -nostartfiles
377 endif
378
379 ifeq ($(TARGET_APPTYPE),console)
380 MK_DEFENTRY := _mainCRTStartup
381 MK_SDKLIBS :=
382 TARGET_LFLAGS += -Wl,--subsystem,console
383 endif
384 endif
385
386 ifeq ($(TARGET_TYPE),proglib)
387 ifeq ($(TARGET_APPTYPE),windows)
388 MK_DEFENTRY := _WinMainCRTStartup
389 MK_SDKLIBS := ntdll.a kernel32.a gdi32.a user32.a
390 TARGET_LFLAGS += -Wl,--subsystem,windows
391 endif
392
393 ifeq ($(TARGET_APPTYPE),native)
394 MK_DEFENTRY := _NtProcessStartup@4
395 MK_SDKLIBS := ntdll.a
396 TARGET_LFLAGS += -Wl,--subsystem,native -nostartfiles
397 endif
398
399 ifeq ($(TARGET_APPTYPE),console)
400 MK_DEFENTRY := _mainCRTStartup
401 MK_SDKLIBS :=
402 TARGET_LFLAGS += -Wl,--subsystem,console
403 endif
404 endif
405
406 ifeq ($(TARGET_TYPE),subsystem)
407 MK_MODE := kernel
408 MK_EXETYPE := dll
409 MK_DEFEXT := .sys
410 MK_DEFENTRY := _DriverEntry@8
411 MK_DDKLIBS := ntoskrnl.a hal.a
412 MK_SDKLIBS :=
413 MK_CFLAGS := -D__NTDRIVER__ -I.
414 MK_CPPFLAGS := -D__NTDRIVER__ -I.
415 MK_IMPLIB := yes
416 MK_IMPLIBONLY := no
417 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
418 MK_IMPLIB_EXT := .a
419 MK_INSTALLDIR := system32
420 MK_DISTDIR := drivers
421 MK_RES_BASE := $(TARGET_NAME)
422 endif
423
424 ifeq ($(TARGET_TYPE),kmdll)
425 MK_MODE := kernel
426 MK_EXETYPE := dll
427 MK_DEFEXT := .dll
428 MK_DEFENTRY := 0x0
429 MK_DDKLIBS := ntoskrnl.a hal.a
430 MK_SDKLIBS :=
431 MK_CFLAGS := -D__NTDRIVER__ -I.
432 MK_CPPFLAGS := -D__NTDRIVER__ -I.
433 MK_IMPLIB := yes
434 MK_IMPLIBONLY := no
435 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
436 MK_IMPLIB_EXT := .a
437 MK_INSTALLDIR := system32
438 MK_DISTDIR := drivers
439 MK_RES_BASE := $(TARGET_NAME)
440 endif
441
442 ifeq ($(TARGET_TYPE),winedll)
443 -include Makefile.ros
444 MK_GENERATED_MAKEFILE = Makefile.ros
445 MK_MODE := user
446 MK_EXETYPE := dll
447 MK_DEFEXT := .dll
448 MK_DEFENTRY := _DllMain@12
449 MK_DDKLIBS :=
450 MK_SDKLIBS :=
451 MK_CFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D_STDDEF_H -DCOBJMACROS -I$(PATH_TO_TOP)/include/wine
452 MK_CPPFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D__need_offsetof -DCOBJMACROS -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/include/wine
453 MK_RCFLAGS := --define __USE_W32API --include-dir $(PATH_TO_TOP)/include/wine
454 MK_IMPLIB := yes
455 MK_IMPLIBONLY := no
456 MK_IMPLIBDEFPATH := $(SDK_PATH_LIB)
457 MK_IMPLIB_EXT := .a
458 MK_INSTALLDIR := system32
459 MK_BOOTCDDIR := system32
460 MK_DISTDIR := dlls
461 MK_RES_BASE := $(TARGET_NAME)
462 ifeq ($(TARGET_DEFNAME),)
463 MK_DEFBASENAME := $(TARGET_NAME).spec
464 MK_SPECDEF := $(MK_DEFBASENAME).def
465 else
466 MK_DEFBASENAME := $(TARGET_DEFNAME)
467 endif
468 MK_RC_BINARIES = $(TARGET_RC_BINARIES)
469 endif
470
471 ifeq ($(TARGET_TYPE),winedrv)
472 -include Makefile.ros
473 MK_GENERATED_MAKEFILE = Makefile.ros
474 MK_MODE := user
475 MK_EXETYPE := drv
476 MK_DEFEXT := .drv
477 # does this need changing?:
478 MK_DEFENTRY := _DllMain@12
479 MK_DDKLIBS :=
480 MK_SDKLIBS :=
481 MK_CFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D__need_offsetof -DCOBJMACROS -I$(PATH_TO_TOP)/include/wine
482 MK_CPPFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D__need_offsetof -DCOBJMACROS -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/include/wine
483 MK_RCFLAGS := --define __USE_W32API --include-dir $(PATH_TO_TOP)/include/wine
484 MK_IMPLIB := yes
485 MK_IMPLIBONLY := no
486 MK_IMPLIBDEFPATH := $(SDK_PATH_LIB)
487 MK_IMPLIB_EXT := .a
488 MK_INSTALLDIR := system32
489 MK_BOOTCDDIR := system32
490 MK_DISTDIR := dlls
491 MK_RES_BASE := $(TARGET_NAME)
492 ifeq ($(TARGET_DEFNAME),)
493 MK_DEFBASENAME := $(TARGET_NAME).spec
494 MK_SPECDEF := $(MK_DEFBASENAME).def
495 else
496 MK_DEFBASENAME := $(TARGET_DEFNAME)
497 endif
498 MK_RC_BINARIES = $(TARGET_RC_BINARIES)
499 endif
500
501 ifeq ($(TARGET_RC_SRCS),)
502 MK_RES_SRC := $(TARGET_PATH)/$(MK_RES_BASE).rc
503 MK_RESOURCE := $(TARGET_PATH)/$(MK_RES_BASE).coff
504 else
505 MK_RES_SRC := $(TARGET_RC_SRCS)
506 MK_RESOURCE := $(TARGET_RC_SRCS:.rc=.coff)
507 endif
508
509 ifneq ($(TARGET_INSTALLDIR),)
510 MK_INSTALLDIR := $(TARGET_INSTALLDIR)
511 endif
512
513
514 ifneq ($(BOOTCD_INSTALL),)
515 MK_INSTALLDIR := .
516 endif
517
518
519 ifeq ($(TARGET_LIBPATH),)
520 MK_LIBPATH := $(SDK_PATH_LIB)
521 else
522 MK_LIBPATH := $(TARGET_LIBPATH)
523 endif
524
525 ifeq ($(TARGET_IMPLIBPATH),)
526 MK_IMPLIBPATH := $(MK_IMPLIBDEFPATH)
527 else
528 MK_IMPLIBPATH := $(TARGET_IMPLIBPATH)
529 endif
530
531
532 ifeq ($(TARGET_BASENAME),)
533 MK_BASENAME := $(TARGET_NAME)
534 else
535 MK_BASENAME := $(TARGET_BASENAME)
536 endif
537
538
539 ifeq ($(TARGET_EXTENSION),)
540 MK_EXT := $(MK_DEFEXT)
541 else
542 MK_EXT := $(TARGET_EXTENSION)
543 endif
544
545
546 ifeq ($(TARGET_NORC),yes)
547 MK_FULLRES :=
548 else
549 MK_FULLRES := $(MK_RESOURCE)
550 endif
551
552 ifneq ($(TARGET_TYPE),winedll)
553 ifeq ($(TARGET_DEFNAME),)
554 MK_DEFBASENAME := $(TARGET_NAME)
555 else
556 MK_DEFBASENAME := $(TARGET_DEFNAME)
557 endif
558 endif
559
560 MK_DEFNAME := $(TARGET_PATH)/$(MK_DEFBASENAME).def
561
562 ifeq ($(MK_MODE),user)
563 ifeq ($(MK_EXETYPE),dll)
564 MK_DEFBASE := 0x10000000
565 else
566 MK_DEFBASE := 0x400000
567 endif
568 ifneq ($(TARGET_SDKLIBS),)
569 MK_LIBS := $(addprefix $(SDK_PATH_LIB)/, $(TARGET_SDKLIBS))
570 else
571 MK_LIBS := $(addprefix $(SDK_PATH_LIB)/, $(MK_SDKLIBS))
572 endif
573 endif
574
575
576 ifeq ($(MK_MODE),kernel)
577 MK_DEFBASE := 0x10000
578 MK_LIBS := $(addprefix $(DDK_PATH_LIB)/, $(TARGET_DDKLIBS) $(MK_DDKLIBS))
579 MK_CFLAGS += -D_SEH_NO_NATIVE_NLG
580 MK_CPPFLAGS += -D_SEH_NO_NATIVE_NLG
581 MK_LFLAGS += -nostartfiles
582 ifneq ($(TARGET_TYPE),kernel)
583 MK_LFLAGS += -nostdlib
584 endif
585 endif
586
587
588 ifneq ($(TARGET_LIBS),)
589 MK_LIBS := $(TARGET_LIBS) $(MK_LIBS)
590 endif
591
592
593 ifeq ($(TARGET_BASE),)
594 TARGET_BASE := $(MK_DEFBASE)
595 endif
596
597
598 ifeq ($(TARGET_ENTRY),)
599 TARGET_ENTRY := $(MK_DEFENTRY)
600 endif
601
602 #
603 # Include details of the OS configuration
604 #
605 include $(PATH_TO_TOP)/config
606
607
608 TARGET_CFLAGS += $(MK_CFLAGS) $(STD_CFLAGS)
609 ifeq ($(DBG),1)
610 TARGET_ASFLAGS += -g
611 TARGET_CFLAGS += -g
612 TARGET_LFLAGS += -g
613 endif
614
615 TARGET_CPPFLAGS += $(MK_CPPFLAGS) $(STD_CPPFLAGS)
616
617 TARGET_RCFLAGS += $(MK_RCFLAGS) $(STD_RCFLAGS)
618
619 TARGET_ASFLAGS += $(MK_ASFLAGS) $(STD_ASFLAGS)
620
621 TARGET_NFLAGS += $(MK_NFLAGS) $(STD_NFLAGS)
622
623 TARGET_LFLAGS += $(MK_LFLAGS) $(STD_LFLAGS)
624
625
626 MK_GCCLIBS := $(addprefix -l, $(TARGET_GCCLIBS))
627
628 ifeq ($(MK_MODE),static)
629 MK_FULLNAME := $(MK_LIBPATH)/$(MK_BASENAME)$(MK_EXT)
630 else
631 MK_FULLNAME := $(MK_BASENAME)$(MK_EXT)
632 endif
633
634 ifeq ($(TARGET_TYPE), kmlibrary)
635 MK_FULLNAME := $(DDK_PATH_LIB)/$(MK_BASENAME)$(MK_EXT)
636 endif
637
638 MK_IMPLIB_FULLNAME := $(MK_BASENAME)$(MK_IMPLIB_EXT)
639
640 MK_NOSTRIPNAME := $(MK_BASENAME).nostrip$(MK_EXT)
641
642 MK_EXTRADEP := $(filter %.h,$(TARGET_OBJECTS))
643
644 # We don't want to link header files
645 MK_OBJECTS := $(filter-out %.h,$(TARGET_OBJECTS))
646
647 # There is problems with C++ applications and ld -r. Ld can cause errors like:
648 # reloc refers to symbol `.text$_ZN9CCABCodecC2Ev' which is not being output
649 ifeq ($(TARGET_CPPAPP),yes)
650 MK_STRIPPED_OBJECT := $(MK_OBJECTS)
651 else
652 MK_STRIPPED_OBJECT := $(MK_BASENAME).stripped.o
653 endif
654
655 ifeq ($(TARGET_REGTESTS),yes)
656 ifeq ($(TARGET_BUILDENV_TEST),yes)
657 REGTEST_TARGETS := tests/_hooks.c tests/_regtests.c tests/_stubs.S tests/Makefile.tests tests/_rtstub.c
658 MK_REGTESTS_CLEAN := clean_regtests
659 else
660 REGTEST_TARGETS := tests/_regtests.c tests/Makefile.tests tests/_rtstub.c
661 ifeq ($(MK_MODE),user)
662 MK_LIBS := $(SDK_PATH_LIB)/rtshared.a $(MK_LIBS)
663 endif
664 MK_REGTESTS_CLEAN := clean_regtests
665 MK_OBJECTS += tests/_rtstub.o tests/regtests.a
666 TARGET_CFLAGS += -I$(REGTESTS_PATH_INC)
667 endif
668 else
669 REGTEST_TARGETS :=
670 MK_REGTESTS_CLEAN :=
671 endif
672
673 ifeq ($(MK_IMPLIBONLY),yes)
674
675 TARGET_CLEAN += $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME)
676
677 all: $(REGTEST_TARGETS) $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME)
678
679 $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME): $(MK_OBJECTS) $(MK_DEFNAME)
680 $(DLLTOOL) \
681 --dllname $(MK_FULLNAME) \
682 --def $(MK_DEFNAME) \
683 --output-lib $(MK_IMPLIBPATH)/$(MK_BASENAME).a \
684 $(MK_KILLAT)
685
686 else # MK_IMPLIBONLY
687
688 all: $(REGTEST_TARGETS) $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(SUBDIRS:%=%_all)
689
690
691 ifeq ($(MK_IMPLIB),yes)
692 MK_EXTRACMD := --def $(MK_DEFNAME)
693 else
694 MK_EXTRACMD :=
695 endif
696
697
698 # User mode targets
699 ifeq ($(MK_MODE),user)
700
701 ifeq ($(MK_EXETYPE),dll)
702 TARGET_LFLAGS += -mdll -Wl,--image-base,$(TARGET_BASE)
703 MK_EXTRADEP += $(MK_DEFNAME)
704 MK_EXTRACMD2 := -Wl,temp.exp
705 else
706 MK_EXTRACMD2 :=
707 endif
708
709 $(MK_BASENAME).a: $(MK_OBJECTS)
710 $(AR) -r $(MK_BASENAME).a $(MK_OBJECTS)
711
712 $(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
713 ifeq ($(MK_EXETYPE),dll)
714 $(LD_CC) -Wl,--base-file,base.tmp \
715 -Wl,--entry,$(TARGET_ENTRY) \
716 $(TARGET_LFLAGS) \
717 -o junk.tmp \
718 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
719 - $(RM) junk.tmp
720 $(DLLTOOL) --dllname $(MK_FULLNAME) \
721 --base-file base.tmp \
722 --output-exp temp.exp $(MK_EXTRACMD)
723 - $(RM) base.tmp
724 $(LD_CC) -Wl,--base-file,base.tmp \
725 -Wl,--entry,$(TARGET_ENTRY) \
726 $(TARGET_LFLAGS) \
727 temp.exp \
728 -o junk.tmp \
729 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
730 - $(RM) junk.tmp
731 $(DLLTOOL) --dllname $(MK_FULLNAME) \
732 --base-file base.tmp \
733 --output-exp temp.exp $(MK_KILLAT) $(MK_EXTRACMD)
734 - $(RM) base.tmp
735 endif
736 $(LD_CC) $(TARGET_LFLAGS) \
737 -Wl,--entry,$(TARGET_ENTRY) $(MK_EXTRACMD2) \
738 -o $(MK_NOSTRIPNAME) \
739 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
740 - $(RM) temp.exp
741 - $(RSYM) $(MK_NOSTRIPNAME) $(MK_BASENAME).sym
742 ifeq ($(FULL_MAP),yes)
743 $(OBJDUMP) -d -S $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
744 else
745 $(NM) --numeric-sort $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
746 endif
747
748 $(MK_FULLNAME): $(MK_NOSTRIPNAME) $(MK_EXTRADEP)
749 -
750 ifneq ($(TARGET_CPPAPP),yes)
751 $(LD) --strip-debug -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
752 endif
753 ifeq ($(MK_EXETYPE),dll)
754 $(LD_CC) -Wl,--base-file,base.tmp \
755 -Wl,--entry,$(TARGET_ENTRY) \
756 -Wl,--strip-debug \
757 $(TARGET_LFLAGS) \
758 -o junk.tmp \
759 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
760 - $(RM) junk.tmp
761 $(DLLTOOL) --dllname $(MK_FULLNAME) \
762 --base-file base.tmp \
763 --output-exp temp.exp $(MK_EXTRACMD)
764 - $(RM) base.tmp
765 $(LD_CC) -Wl,--base-file,base.tmp \
766 -Wl,--entry,$(TARGET_ENTRY) \
767 -Wl,--strip-debug \
768 $(TARGET_LFLAGS) \
769 temp.exp \
770 -o junk.tmp \
771 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
772 - $(RM) junk.tmp
773 $(DLLTOOL) --dllname $(MK_FULLNAME) \
774 --base-file base.tmp \
775 --output-exp temp.exp $(MK_KILLAT) $(MK_EXTRACMD)
776 - $(RM) base.tmp
777 endif
778 $(LD_CC) $(TARGET_LFLAGS) \
779 -Wl,--entry,$(TARGET_ENTRY) \
780 -Wl,--strip-debug \
781 $(MK_EXTRACMD2) \
782 -o $(MK_FULLNAME) \
783 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
784 ifneq ($(TARGET_CPPAPP),yes)
785 - $(RM) temp.exp $(MK_STRIPPED_OBJECT)
786 else
787 - $(RM) temp.exp
788 endif
789 @echo $(MK_FULLNAME) was successfully built.
790
791 endif # KM_MODE
792
793 # Kernel mode targets
794 ifeq ($(MK_MODE),kernel)
795
796 ifeq ($(MK_IMPLIB),yes)
797 MK_EXTRACMD := --def $(MK_DEFNAME)
798 else
799 MK_EXTRACMD :=
800 endif
801
802 $(MK_BASENAME).a: $(MK_OBJECTS)
803 $(AR) -r $(MK_BASENAME).a $(MK_OBJECTS)
804
805 $(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
806 $(LD_CC) -Wl,--base-file,base.tmp \
807 -Wl,--entry,$(TARGET_ENTRY) \
808 $(TARGET_LFLAGS) \
809 -o junk.tmp \
810 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
811 - $(RM) junk.tmp
812 $(DLLTOOL) --dllname $(MK_FULLNAME) \
813 --base-file base.tmp \
814 --output-exp temp.exp $(MK_EXTRACMD) $(MK_KILLAT)
815 - $(RM) base.tmp
816 $(LD_CC) $(TARGET_LFLAGS) \
817 -Wl,--subsystem,native \
818 -Wl,--image-base,$(TARGET_BASE) \
819 -Wl,--file-alignment,0x1000 \
820 -Wl,--section-alignment,0x1000 \
821 -Wl,--entry,$(TARGET_ENTRY) \
822 -Wl,temp.exp -mdll \
823 -o $(MK_NOSTRIPNAME) \
824 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
825 - $(RM) temp.exp
826 $(RSYM) $(MK_NOSTRIPNAME) $(MK_BASENAME).sym
827 ifeq ($(FULL_MAP),yes)
828 $(OBJDUMP) -d -S $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
829 else
830 $(NM) --numeric-sort $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
831 endif
832
833 $(MK_FULLNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS) $(MK_NOSTRIPNAME)
834 -
835 ifneq ($(TARGET_CPPAPP),yes)
836 $(LD) --strip-debug -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
837 endif
838 $(LD_CC) -Wl,--base-file,base.tmp \
839 -Wl,--entry,$(TARGET_ENTRY) \
840 $(TARGET_LFLAGS) \
841 -o junk.tmp \
842 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
843 - $(RM) junk.tmp
844 $(DLLTOOL) --dllname $(MK_FULLNAME) \
845 --base-file base.tmp \
846 --output-exp temp.exp $(MK_EXTRACMD) $(MK_KILLAT)
847 - $(RM) base.tmp
848 $(LD_CC) $(TARGET_LFLAGS) \
849 -Wl,--subsystem,native \
850 -Wl,--image-base,$(TARGET_BASE) \
851 -Wl,--file-alignment,0x1000 \
852 -Wl,--section-alignment,0x1000 \
853 -Wl,--entry,$(TARGET_ENTRY) \
854 -Wl,temp.exp -mdll \
855 -o $(MK_FULLNAME) \
856 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
857 ifneq ($(TARGET_CPPAPP),yes)
858 - $(RM) temp.exp $(MK_STRIPPED_OBJECT)
859 else
860 - $(RM) temp.exp
861 endif
862 @echo $(MK_FULLNAME) was successfully built.
863
864 endif # MK_MODE
865
866 # Static library target
867 ifeq ($(MK_MODE),static)
868
869 $(MK_FULLNAME): $(TARGET_OBJECTS)
870 $(AR) -r $(MK_FULLNAME) $(TARGET_OBJECTS)
871 @echo $(MK_BASENAME)$(MK_EXT) was successfully built.
872
873 # Static libraries dont have a nostrip version
874 $(MK_NOSTRIPNAME):
875 -
876
877 .PHONY: $(MK_NOSTRIPNAME)
878
879 endif # MK_MODE
880
881 endif # MK_IMPLIBONLY
882
883
884 $(MK_FULLRES): $(PATH_TO_TOP)/include/reactos/buildno.h $(MK_RES_SRC)
885
886 ifeq ($(MK_DEPENDS),yes)
887 depends:
888 else
889 depends:
890 endif
891
892 ifeq ($(MK_IMPLIB),yes)
893 $(MK_IMPLIBPATH)/$(MK_BASENAME).a: $(MK_DEFNAME)
894 $(DLLTOOL) --dllname $(MK_FULLNAME) \
895 --def $(MK_DEFNAME) \
896 --output-lib $(MK_IMPLIBPATH)/$(MK_BASENAME).a \
897 $(MK_KILLAT)
898
899 implib: $(MK_IMPLIBPATH)/$(MK_BASENAME).a
900 else
901 implib: $(SUBDIRS:%=%_implib)
902 endif
903
904 # Precompiled header support
905 # When using PCHs, use dependency tracking to keep the .gch files up-to-date.
906
907 MK_PCHNAME =
908 ifeq ($(ROS_USE_PCH),yes)
909 ifneq ($(TARGET_PCH),)
910 MK_PCHNAME = $(TARGET_PCH).gch
911
912 ifeq ($(TARGET_CPPAPP),yes)
913 PCH_CC := $(CXX)
914 else
915 PCH_CC := $(CC)
916 endif
917
918
919 endif # TARGET_PCH
920 else #
921 MK_PCHNAME =
922 endif # ROS_USE_PCH
923
924 # Be carefull not to clean non-object files
925 MK_CLEANFILES := $(filter %.o,$(MK_OBJECTS))
926 MK_CLEANFILTERED := $(MK_OBJECTS:.o=.d) $(TARGET_PCH:.h=.d)
927 MK_CLEANDEPS := $(join $(dir $(MK_CLEANFILTERED)), $(addprefix ., $(notdir $(MK_CLEANFILTERED))))
928
929 clean: $(MK_REGTESTS_CLEAN) $(SUBDIRS:%=%_clean)
930 - $(RM) *.o $(MK_PCHNAME) $(MK_BASENAME).sym $(MK_BASENAME).a $(MK_RESOURCE) \
931 $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) $(MK_CLEANDEPS) $(MK_BASENAME).map \
932 junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_GENERATED_MAKEFILE) \
933 $(TARGET_CLEAN)
934
935 ifneq ($(TARGET_HEADERS),)
936 $(TARGET_OBJECTS): $(TARGET_HEADERS)
937 endif
938
939 # install and bootcd rules
940
941 ifeq ($(MK_IMPLIBONLY),yes)
942
943 # Don't install import libraries
944
945 install:
946
947 bootcd:
948
949 else # MK_IMPLIBONLY
950
951
952 # Don't install static libraries
953 ifeq ($(MK_MODE),static)
954
955 install:
956
957 bootcd:
958
959 else # MK_MODE
960
961 ifeq ($(INSTALL_SYMBOLS),yes)
962
963 install: $(SUBDIRS:%=%_install) $(MK_FULLNAME) $(MK_BASENAME).sym
964 -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME)
965 -$(CP) $(MK_BASENAME).sym $(INSTALL_DIR)/symbols/$(MK_BASENAME).sym
966 @echo $(MK_FULLNAME) was successfully installed.
967
968 else # INSTALL_SYMBOLS
969
970 install: $(SUBDIRS:%=%_install) $(MK_FULLNAME)
971 -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME)
972
973 endif # INSTALL_SYMBOLS
974
975
976 # Bootstrap files for the bootable CD
977 ifeq ($(TARGET_BOOTSTRAP),yes)
978
979 ifneq ($(TARGET_BOOTSTRAP_NAME),)
980 MK_BOOTSTRAP_NAME := $(TARGET_BOOTSTRAP_NAME)
981 else # TARGET_BOOTSTRAP_NAME
982 MK_BOOTSTRAP_NAME := $(MK_FULLNAME)
983 endif # TARGET_BOOTSTRAP_NAME
984
985 bootcd: $(SUBDIRS:%=%_bootcd)
986 - $(CP) $(MK_FULLNAME) $(BOOTCD_DIR)/reactos/$(MK_BOOTCDDIR)/$(MK_BOOTSTRAP_NAME)
987
988 else # TARGET_BOOTSTRAP
989
990 bootcd:
991
992 endif # TARGET_BOOTSTRAP
993
994 endif # MK_MODE
995
996 endif # MK_IMPLIBONLY
997
998 ifeq ($(TARGET_TYPE),winedll)
999 Makefile.ros: Makefile.in Makefile.ros-template
1000 $(WINE2ROS) Makefile.in Makefile.ros-template Makefile.ros
1001
1002 $(MK_RC_BINARIES): $(TARGET_RC_BINSRC)
1003 $(BIN2RES) -f -o $@ $(TARGET_RC_BINSRC)
1004
1005 $(MK_RESOURCE): $(MK_RC_BINARIES)
1006 endif
1007
1008 REGTEST_TESTS = $(wildcard tests/tests/*.c)
1009
1010 $(REGTEST_TARGETS): $(REGTEST_TESTS)
1011 ifeq ($(TARGET_BUILDENV_TEST),yes)
1012 $(REGTESTS) ./tests/tests ./tests/_regtests.c ./tests/Makefile.tests -e ./tests/_rtstub.c
1013 $(REGTESTS) -s ./tests/stubs.tst ./tests/_stubs.S ./tests/_hooks.c
1014 else
1015 ifeq ($(MK_MODE),user)
1016 $(REGTESTS) ./tests/tests ./tests/_regtests.c ./tests/Makefile.tests -u ./tests/_rtstub.c
1017 $(MAKE) -C tests TARGET_REGTESTS=no all
1018 else
1019 ifeq ($(MK_MODE),kernel)
1020 $(REGTESTS) ./tests/tests ./tests/_regtests.c ./tests/Makefile.tests -k ./tests/_rtstub.c
1021 $(MAKE) -C tests TARGET_REGTESTS=no all
1022 endif
1023 endif
1024 endif
1025
1026 clean_regtests:
1027 ifeq ($(TARGET_BUILDENV_TEST),yes)
1028 - $(MAKE) -C tests TARGET_REGTESTS=no clean
1029 - $(RM) ./tests/_rtstub.c ./tests/_hooks.c ./tests/_regtests.c ./tests/_stubs.S ./tests/Makefile.tests
1030 else
1031 $(MAKE) -C tests TARGET_REGTESTS=no clean
1032 $(RM) ./tests/_rtstub.c ./tests/_regtests.c ./tests/_hooks.c ./tests/_stubs.S ./tests/Makefile.tests
1033 endif
1034
1035 .PHONY: all depends implib clean install dist bootcd depends gen_regtests clean_regtests
1036
1037 ifneq ($(SUBDIRS),)
1038 $(SUBDIRS:%=%_all): %_all:
1039 $(MAKE) -C $* SUBDIRS= all
1040
1041 $(SUBDIRS:%=%_implib): %_implib:
1042 $(MAKE) -C $* SUBDIRS= implib
1043
1044 $(SUBDIRS:%=%_test): %_test:
1045 $(MAKE) -C $* SUBDIRS= test
1046
1047 $(SUBDIRS:%=%_clean): %_clean:
1048 $(MAKE) -C $* SUBDIRS= clean
1049
1050 $(SUBDIRS:%=%_install): %_install:
1051 $(MAKE) -C $* SUBDIRS= install
1052
1053 $(SUBDIRS:%=%_dist): %_dist:
1054 $(MAKE) -C $* SUBDIRS= dist
1055
1056 $(SUBDIRS:%=%_bootcd): %_bootcd:
1057 $(MAKE) -C $* SUBDIRS= bootcd
1058
1059 .PHONY: $(SUBDIRS:%=%_all) $(SUBDIRS:%=%_implib) $(SUBDIRS:%=%_test) \
1060 $(SUBDIRS:%=%_clean) $(SUBDIRS:%=%_install) $(SUBDIRS:%=%_dist) \
1061 $(SUBDIRS:%=%_bootcd)
1062 endif
1063
1064 ifeq ($(TARGET_REGTESTS),yes)
1065 ifeq ($(TARGET_BUILDENV_TEST),yes)
1066 test: all
1067 $(MAKE) -C tests run
1068 else
1069 test:
1070 -
1071 endif
1072 else
1073 test:
1074 -
1075 endif
1076
1077
1078 %.o: %.c $(MK_PCHNAME)
1079 $(CC) $(TARGET_CFLAGS) -c $< -o $@
1080 %.o: %.cc $(MK_PCHNAME)
1081 $(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
1082 %.o: %.cxx $(MK_PCHNAME)
1083 $(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
1084 %.o: %.cpp $(MK_PCHNANE)
1085 $(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
1086 %.o: %.S
1087 $(AS) $(TARGET_ASFLAGS) -c $< -o $@
1088 %.o: %.s
1089 $(AS) $(TARGET_ASFLAGS) -c $< -o $@
1090 %.o: %.asm
1091 $(NASM_CMD) $(TARGET_NFLAGS) $< -o $@
1092 %.coff: %.rc
1093 $(RC) $(TARGET_RCFLAGS) $< -o $@
1094 %.spec.def: %.spec
1095 $(WINEBUILD) $(DEFS) -o $@ --def $<
1096 %.drv.spec.def: %.spec
1097 $(WINEBUILD) $(DEFS) -o $@ --def $<
1098 %.i: %.c
1099 $(CC) $(TARGET_CFLAGS) -E $< > $@
1100 %.h.gch: %.h
1101 $(PCH_CC) $(CFLAGS) $<
1102 # rule for msvc conversion
1103 %.c: %_msvc.c
1104 $(subst /,$(SEP),$(MS2PS)) -try try -except except -finally finally < $< > $@
1105
1106 # Kill implicit rule
1107 .o:;
1108
1109 # Compatibility
1110 CFLAGS := $(TARGET_CFLAGS)
1111 NFLAGS := $(TARGET_NFLAGS)