2004-10-28 Casper S. Hornstrup <chorns@users.sourceforge.net>
[reactos.git] / reactos / tools / helper.mk
1 # $Id: helper.mk,v 1.93 2004/10/28 19:01:59 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 # test = ReactOS test
23 # $TARGET_APPTYPE = Application type (windows,native,console).
24 # Required only for TARGET_TYPEs program and proglib
25 # $TARGET_NAME = Base name of output file and .rc, .def, and .edf files
26 # $TARGET_OBJECTS = Object files that compose the module
27 # $TARGET_CPPAPP = C++ application (no,yes) (optional)
28 # $TARGET_HEADERS = Header files that the object files depend on (optional)
29 # $TARGET_DEFNAME = Base name of .def and .edf files (optional)
30 # $TARGET_BASENAME = Base name of output file (overrides $TARGET_NAME if it exists) (optional)
31 # $TARGET_EXTENSION = Extension of the output file (optional)
32 # $TARGET_DDKLIBS = DDK libraries that are to be imported by the module (optional)
33 # $TARGET_SDKLIBS = SDK libraries that are to be imported by the module (optional)
34 # $TARGET_LIBS = Other libraries that are to be imported by the module (optional)
35 # $TARGET_GCCLIBS = GCC libraries imported with -l (optional)
36 # $TARGET_LFLAGS = GCC flags when linking (optional)
37 # $TARGET_CFLAGS = GCC flags (optional)
38 # $TARGET_CPPFLAGS = G++ flags (optional)
39 # $TARGET_ASFLAGS = GCC assembler flags (optional)
40 # $TARGET_NFLAGS = NASM flags (optional)
41 # $TARGET_RCFLAGS = Windres flags (optional)
42 # $TARGET_CLEAN = Files that are part of the clean rule (optional)
43 # $TARGET_PATH = Relative path for *.def, *.edf, and *.rc (optional)
44 # $TARGET_BASE = Default base address (optional)
45 # $TARGET_ENTRY = Entry point (optional)
46 # $TARGET_NORC = Do not include standard resource file (no,yes) (optional)
47 # $TARGET_LIBPATH = Destination path for static libraries (optional)
48 # $TARGET_IMPLIBPATH = Destination path for import libraries (optional)
49 # $TARGET_INSTALLDIR = Destination path when installed (optional)
50 # $TARGET_PCH = Filename of header to use to generate a PCH if supported by the compiler (optional)
51 # $TARGET_BOOTSTRAP = Whether this file is needed to bootstrap the installation (no,yes) (optional)
52 # $TARGET_BOOTSTRAP_NAME = Name on the installation medium (optional)
53 # $TARGET_REGTESTS = This module has regression tests (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 := $(DDK_PATH_LIB)
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 ifeq ($(TARGET_TYPE),test)
357 TARGET_NORC := yes
358 MK_MODE := static
359 MK_EXETYPE :=
360 MK_DEFEXT := .a
361 MK_DEFENTRY :=
362 MK_DDKLIBS :=
363 MK_SDKLIBS :=
364 MK_CFLAGS := -I.
365 MK_CPPFLAGS := -I.
366 MK_IMPLIB := no
367 MK_IMPLIBONLY := no
368 MK_IMPLIBDEFPATH :=
369 MK_IMPLIB_EXT :=
370 MK_INSTALLDIR := # none
371 MK_BOOTCDDIR := system32
372 MK_DISTDIR := # none
373 MK_RES_BASE :=
374 TARGET_OBJECTS := _rtstub.o _regtests.o $(TARGET_OBJECTS)
375 endif
376
377
378 # can be overidden with $(CXX) for linkage of c++ executables
379 LD_CC = $(CC)
380
381 ifeq ($(RM_AT_FROM_SYMBOLS),no)
382 MK_KILLAT :=
383 else
384 MK_KILLAT := --kill-at
385 endif
386
387 ifeq ($(TARGET_TYPE),program)
388 ifeq ($(TARGET_APPTYPE),windows)
389 MK_DEFENTRY := _WinMainCRTStartup
390 MK_SDKLIBS := ntdll.a kernel32.a gdi32.a user32.a
391 TARGET_LFLAGS += -Wl,--subsystem,windows
392 endif
393
394 ifeq ($(TARGET_APPTYPE),native)
395 MK_DEFENTRY := _NtProcessStartup@4
396 MK_SDKLIBS := ntdll.a
397 TARGET_LFLAGS += -Wl,--subsystem,native -nostartfiles
398 endif
399
400 ifeq ($(TARGET_APPTYPE),console)
401 MK_DEFENTRY := _mainCRTStartup
402 MK_SDKLIBS :=
403 TARGET_LFLAGS += -Wl,--subsystem,console
404 endif
405 endif
406
407 ifeq ($(TARGET_TYPE),proglib)
408 ifeq ($(TARGET_APPTYPE),windows)
409 MK_DEFENTRY := _WinMainCRTStartup
410 MK_SDKLIBS := ntdll.a kernel32.a gdi32.a user32.a
411 TARGET_LFLAGS += -Wl,--subsystem,windows
412 endif
413
414 ifeq ($(TARGET_APPTYPE),native)
415 MK_DEFENTRY := _NtProcessStartup@4
416 MK_SDKLIBS := ntdll.a
417 TARGET_LFLAGS += -Wl,--subsystem,native -nostartfiles
418 endif
419
420 ifeq ($(TARGET_APPTYPE),console)
421 MK_DEFENTRY := _mainCRTStartup
422 MK_SDKLIBS :=
423 TARGET_LFLAGS += -Wl,--subsystem,console
424 endif
425 endif
426
427 ifeq ($(TARGET_TYPE),subsystem)
428 MK_MODE := kernel
429 MK_EXETYPE := dll
430 MK_DEFEXT := .sys
431 MK_DEFENTRY := _DriverEntry@8
432 MK_DDKLIBS := ntoskrnl.a hal.a
433 MK_SDKLIBS :=
434 MK_CFLAGS := -D__NTDRIVER__ -I.
435 MK_CPPFLAGS := -D__NTDRIVER__ -I.
436 MK_IMPLIB := yes
437 MK_IMPLIBONLY := no
438 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
439 MK_IMPLIB_EXT := .a
440 MK_INSTALLDIR := system32
441 MK_DISTDIR := drivers
442 MK_RES_BASE := $(TARGET_NAME)
443 endif
444
445 ifeq ($(TARGET_TYPE),kmdll)
446 MK_MODE := kernel
447 MK_EXETYPE := dll
448 MK_DEFEXT := .dll
449 MK_DEFENTRY := 0x0
450 MK_DDKLIBS := ntoskrnl.a hal.a
451 MK_SDKLIBS :=
452 MK_CFLAGS := -D__NTDRIVER__ -I.
453 MK_CPPFLAGS := -D__NTDRIVER__ -I.
454 MK_IMPLIB := yes
455 MK_IMPLIBONLY := no
456 MK_IMPLIBDEFPATH := $(DDK_PATH_LIB)
457 MK_IMPLIB_EXT := .a
458 MK_INSTALLDIR := system32
459 MK_DISTDIR := drivers
460 MK_RES_BASE := $(TARGET_NAME)
461 endif
462
463 ifeq ($(TARGET_TYPE),winedll)
464 -include Makefile.ros
465 MK_GENERATED_MAKEFILE = Makefile.ros
466 MK_MODE := user
467 MK_EXETYPE := dll
468 MK_DEFEXT := .dll
469 MK_DEFENTRY := _DllMain@12
470 MK_DDKLIBS :=
471 MK_SDKLIBS :=
472 MK_CFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D_STDDEF_H -I$(PATH_TO_TOP)/include/wine
473 MK_CPPFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D__need_offsetof -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/include/wine
474 MK_RCFLAGS := --define __USE_W32API --include-dir $(PATH_TO_TOP)/include/wine
475 MK_IMPLIB := yes
476 MK_IMPLIBONLY := no
477 MK_IMPLIBDEFPATH := $(SDK_PATH_LIB)
478 MK_IMPLIB_EXT := .a
479 MK_INSTALLDIR := system32
480 MK_BOOTCDDIR := system32
481 MK_DISTDIR := dlls
482 MK_RES_BASE := $(TARGET_NAME)
483 ifeq ($(TARGET_DEFNAME),)
484 MK_DEFBASENAME := $(TARGET_NAME).spec
485 MK_SPECDEF := $(MK_DEFBASENAME).def
486 else
487 MK_DEFBASENAME := $(TARGET_DEFNAME)
488 endif
489 MK_RC_BINARIES = $(TARGET_RC_BINARIES)
490 endif
491
492 ifeq ($(TARGET_TYPE),winedrv)
493 -include Makefile.ros
494 MK_GENERATED_MAKEFILE = Makefile.ros
495 MK_MODE := user
496 MK_EXETYPE := drv
497 MK_DEFEXT := .drv
498 # does this need changing?:
499 MK_DEFENTRY := _DllMain@12
500 MK_DDKLIBS :=
501 MK_SDKLIBS :=
502 MK_CFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D__need_offsetof -I$(PATH_TO_TOP)/include/wine
503 MK_CPPFLAGS := -D__USE_W32API -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x501 -DWINVER=0x501 -D__need_offsetof -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/include/wine
504 MK_RCFLAGS := --define __USE_W32API --include-dir $(PATH_TO_TOP)/include/wine
505 MK_IMPLIB := yes
506 MK_IMPLIBONLY := no
507 MK_IMPLIBDEFPATH := $(SDK_PATH_LIB)
508 MK_IMPLIB_EXT := .a
509 MK_INSTALLDIR := system32
510 MK_BOOTCDDIR := system32
511 MK_DISTDIR := dlls
512 MK_RES_BASE := $(TARGET_NAME)
513 ifeq ($(TARGET_DEFNAME),)
514 MK_DEFBASENAME := $(TARGET_NAME).spec
515 MK_SPECDEF := $(MK_DEFBASENAME).def
516 else
517 MK_DEFBASENAME := $(TARGET_DEFNAME)
518 endif
519 MK_RC_BINARIES = $(TARGET_RC_BINARIES)
520 endif
521
522 ifeq ($(TARGET_RC_SRCS),)
523 MK_RES_SRC := $(TARGET_PATH)/$(MK_RES_BASE).rc
524 MK_RESOURCE := $(TARGET_PATH)/$(MK_RES_BASE).coff
525 else
526 MK_RES_SRC := $(TARGET_RC_SRCS)
527 MK_RESOURCE := $(TARGET_RC_SRCS:.rc=.coff)
528 endif
529
530 ifneq ($(TARGET_INSTALLDIR),)
531 MK_INSTALLDIR := $(TARGET_INSTALLDIR)
532 endif
533
534
535 ifneq ($(BOOTCD_INSTALL),)
536 MK_INSTALLDIR := .
537 endif
538
539
540 ifeq ($(TARGET_LIBPATH),)
541 MK_LIBPATH := $(SDK_PATH_LIB)
542 else
543 MK_LIBPATH := $(TARGET_LIBPATH)
544 endif
545
546 ifeq ($(TARGET_IMPLIBPATH),)
547 MK_IMPLIBPATH := $(MK_IMPLIBDEFPATH)
548 else
549 MK_IMPLIBPATH := $(TARGET_IMPLIBPATH)
550 endif
551
552
553 ifeq ($(TARGET_BASENAME),)
554 MK_BASENAME := $(TARGET_NAME)
555 else
556 MK_BASENAME := $(TARGET_BASENAME)
557 endif
558
559
560 ifeq ($(TARGET_EXTENSION),)
561 MK_EXT := $(MK_DEFEXT)
562 else
563 MK_EXT := $(TARGET_EXTENSION)
564 endif
565
566
567 ifeq ($(TARGET_NORC),yes)
568 MK_FULLRES :=
569 else
570 MK_FULLRES := $(MK_RESOURCE)
571 endif
572
573 ifneq ($(TARGET_TYPE),winedll)
574 ifeq ($(TARGET_DEFNAME),)
575 MK_DEFBASENAME := $(TARGET_NAME)
576 else
577 MK_DEFBASENAME := $(TARGET_DEFNAME)
578 endif
579 endif
580
581 MK_DEFNAME := $(TARGET_PATH)/$(MK_DEFBASENAME).def
582
583 ifeq ($(MK_MODE),user)
584 ifeq ($(MK_EXETYPE),dll)
585 MK_DEFBASE := 0x10000000
586 else
587 MK_DEFBASE := 0x400000
588 endif
589 ifneq ($(TARGET_SDKLIBS),)
590 MK_LIBS := $(addprefix $(SDK_PATH_LIB)/, $(TARGET_SDKLIBS))
591 else
592 MK_LIBS := $(addprefix $(SDK_PATH_LIB)/, $(MK_SDKLIBS))
593 endif
594 endif
595
596
597 ifeq ($(MK_MODE),kernel)
598 MK_DEFBASE := 0x10000
599 MK_LIBS := $(addprefix $(DDK_PATH_LIB)/, $(TARGET_DDKLIBS) $(MK_DDKLIBS))
600 MK_CFLAGS += -D_SEH_NO_NATIVE_NLG
601 MK_CPPFLAGS += -D_SEH_NO_NATIVE_NLG
602 MK_LFLAGS += -nostartfiles
603 ifneq ($(TARGET_TYPE),kernel)
604 MK_LFLAGS += -nostdlib
605 endif
606 endif
607
608
609 ifneq ($(TARGET_LIBS),)
610 MK_LIBS := $(TARGET_LIBS) $(MK_LIBS)
611 endif
612
613
614 ifeq ($(TARGET_BASE),)
615 TARGET_BASE := $(MK_DEFBASE)
616 endif
617
618
619 ifeq ($(TARGET_ENTRY),)
620 TARGET_ENTRY := $(MK_DEFENTRY)
621 endif
622
623 #
624 # Include details of the OS configuration
625 #
626 include $(PATH_TO_TOP)/config
627
628
629 TARGET_CFLAGS += $(MK_CFLAGS) $(STD_CFLAGS)
630 ifeq ($(DBG),1)
631 TARGET_ASFLAGS += -g
632 TARGET_CFLAGS += -g
633 TARGET_LFLAGS += -g
634 endif
635
636 TARGET_CPPFLAGS += $(MK_CPPFLAGS) $(STD_CPPFLAGS)
637
638 TARGET_RCFLAGS += $(MK_RCFLAGS) $(STD_RCFLAGS)
639
640 TARGET_ASFLAGS += $(MK_ASFLAGS) $(STD_ASFLAGS)
641
642 TARGET_NFLAGS += $(MK_NFLAGS) $(STD_NFLAGS)
643
644 TARGET_LFLAGS += $(MK_LFLAGS) $(STD_LFLAGS)
645
646
647 MK_GCCLIBS := $(addprefix -l, $(TARGET_GCCLIBS))
648
649 ifeq ($(MK_MODE),static)
650 MK_FULLNAME := $(MK_LIBPATH)/$(MK_BASENAME)$(MK_EXT)
651 else
652 MK_FULLNAME := $(MK_BASENAME)$(MK_EXT)
653 endif
654
655 ifeq ($(TARGET_TYPE), kmlibrary)
656 MK_FULLNAME := $(DDK_PATH_LIB)/$(MK_BASENAME)$(MK_EXT)
657 endif
658
659 MK_IMPLIB_FULLNAME := $(MK_BASENAME)$(MK_IMPLIB_EXT)
660
661 MK_NOSTRIPNAME := $(MK_BASENAME).nostrip$(MK_EXT)
662
663 MK_EXTRADEP := $(filter %.h,$(TARGET_OBJECTS))
664
665 ifeq ($(TARGET_TYPE),test)
666 MK_EXTRADEP += _stubs.o _hooks.o
667 endif
668
669 # We don't want to link header files
670 MK_OBJECTS := $(filter-out %.h,$(TARGET_OBJECTS))
671
672 # There is problems with C++ applications and ld -r. Ld can cause errors like:
673 # reloc refers to symbol `.text$_ZN9CCABCodecC2Ev' which is not being output
674 ifeq ($(TARGET_CPPAPP),yes)
675 MK_STRIPPED_OBJECT := $(MK_OBJECTS)
676 else
677 MK_STRIPPED_OBJECT := $(MK_BASENAME).stripped.o
678 endif
679
680 ifeq ($(TARGET_REGTESTS),yes)
681 REGTEST_TARGETS := tests/_hooks.c tests/_regtests.c tests/_stubs.S tests/Makefile.tests tests/_rtstub.c
682 MK_REGTESTS_CLEAN := clean_regtests
683 else
684 REGTEST_TARGETS :=
685 MK_REGTESTS_CLEAN :=
686 endif
687
688 ifeq ($(MK_IMPLIBONLY),yes)
689
690 TARGET_CLEAN += $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME)
691
692 all: $(REGTEST_TARGETS) $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME)
693
694 $(MK_IMPLIBPATH)/$(MK_IMPLIB_FULLNAME): $(MK_OBJECTS) $(MK_DEFNAME)
695 $(DLLTOOL) \
696 --dllname $(MK_FULLNAME) \
697 --def $(MK_DEFNAME) \
698 --output-lib $(MK_IMPLIBPATH)/$(MK_BASENAME).a \
699 $(MK_KILLAT)
700
701 else # MK_IMPLIBONLY
702
703 all: $(REGTEST_TARGETS) $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(SUBDIRS:%=%_all)
704
705
706 ifeq ($(MK_IMPLIB),yes)
707 MK_EXTRACMD := --def $(MK_DEFNAME)
708 else
709 MK_EXTRACMD :=
710 endif
711
712
713 # User mode targets
714 ifeq ($(MK_MODE),user)
715
716 ifeq ($(MK_EXETYPE),dll)
717 TARGET_LFLAGS += -mdll -Wl,--image-base,$(TARGET_BASE)
718 MK_EXTRADEP += $(MK_DEFNAME)
719 MK_EXTRACMD2 := -Wl,temp.exp
720 else
721 MK_EXTRACMD2 :=
722 endif
723
724 $(MK_BASENAME).a: $(MK_OBJECTS)
725 $(AR) -rc $(MK_BASENAME).a $(MK_OBJECTS)
726
727 $(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
728 ifeq ($(MK_EXETYPE),dll)
729 $(LD_CC) -Wl,--base-file,base.tmp \
730 -Wl,--entry,$(TARGET_ENTRY) \
731 $(TARGET_LFLAGS) \
732 -o junk.tmp \
733 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
734 - $(RM) junk.tmp
735 $(DLLTOOL) --dllname $(MK_FULLNAME) \
736 --base-file base.tmp \
737 --output-exp temp.exp $(MK_EXTRACMD)
738 - $(RM) base.tmp
739 $(LD_CC) -Wl,--base-file,base.tmp \
740 -Wl,--entry,$(TARGET_ENTRY) \
741 $(TARGET_LFLAGS) \
742 temp.exp \
743 -o junk.tmp \
744 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
745 - $(RM) junk.tmp
746 $(DLLTOOL) --dllname $(MK_FULLNAME) \
747 --base-file base.tmp \
748 --output-exp temp.exp $(MK_KILLAT) $(MK_EXTRACMD)
749 - $(RM) base.tmp
750 endif
751 $(LD_CC) $(TARGET_LFLAGS) \
752 -Wl,--entry,$(TARGET_ENTRY) $(MK_EXTRACMD2) \
753 -o $(MK_NOSTRIPNAME) \
754 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
755 - $(RM) temp.exp
756 - $(RSYM) $(MK_NOSTRIPNAME) $(MK_BASENAME).sym
757 ifeq ($(FULL_MAP),yes)
758 $(OBJDUMP) -d -S $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
759 else
760 $(NM) --numeric-sort $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
761 endif
762
763 $(MK_FULLNAME): $(MK_NOSTRIPNAME) $(MK_EXTRADEP)
764 -
765 ifneq ($(TARGET_CPPAPP),yes)
766 $(LD) --strip-debug -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
767 endif
768 ifeq ($(MK_EXETYPE),dll)
769 $(LD_CC) -Wl,--base-file,base.tmp \
770 -Wl,--entry,$(TARGET_ENTRY) \
771 -Wl,--strip-debug \
772 $(TARGET_LFLAGS) \
773 -o junk.tmp \
774 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
775 - $(RM) junk.tmp
776 $(DLLTOOL) --dllname $(MK_FULLNAME) \
777 --base-file base.tmp \
778 --output-exp temp.exp $(MK_EXTRACMD)
779 - $(RM) base.tmp
780 $(LD_CC) -Wl,--base-file,base.tmp \
781 -Wl,--entry,$(TARGET_ENTRY) \
782 -Wl,--strip-debug \
783 $(TARGET_LFLAGS) \
784 temp.exp \
785 -o junk.tmp \
786 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
787 - $(RM) junk.tmp
788 $(DLLTOOL) --dllname $(MK_FULLNAME) \
789 --base-file base.tmp \
790 --output-exp temp.exp $(MK_KILLAT) $(MK_EXTRACMD)
791 - $(RM) base.tmp
792 endif
793 $(LD_CC) $(TARGET_LFLAGS) \
794 -Wl,--entry,$(TARGET_ENTRY) \
795 -Wl,--strip-debug \
796 $(MK_EXTRACMD2) \
797 -o $(MK_FULLNAME) \
798 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
799 ifneq ($(TARGET_CPPAPP),yes)
800 - $(RM) temp.exp $(MK_STRIPPED_OBJECT)
801 else
802 - $(RM) temp.exp
803 endif
804 @echo $(MK_FULLNAME) was successfully built.
805
806 endif # KM_MODE
807
808 # Kernel mode targets
809 ifeq ($(MK_MODE),kernel)
810
811 ifeq ($(MK_IMPLIB),yes)
812 MK_EXTRACMD := --def $(MK_DEFNAME)
813 else
814 MK_EXTRACMD :=
815 endif
816
817 $(MK_BASENAME).a: $(MK_OBJECTS)
818 $(AR) -rc $(MK_BASENAME).a $(MK_OBJECTS)
819
820 $(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
821 $(LD_CC) -Wl,--base-file,base.tmp \
822 -Wl,--entry,$(TARGET_ENTRY) \
823 $(TARGET_LFLAGS) \
824 -o junk.tmp \
825 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
826 - $(RM) junk.tmp
827 $(DLLTOOL) --dllname $(MK_FULLNAME) \
828 --base-file base.tmp \
829 --output-exp temp.exp $(MK_EXTRACMD) $(MK_KILLAT)
830 - $(RM) base.tmp
831 $(LD_CC) $(TARGET_LFLAGS) \
832 -Wl,--subsystem,native \
833 -Wl,--image-base,$(TARGET_BASE) \
834 -Wl,--file-alignment,0x1000 \
835 -Wl,--section-alignment,0x1000 \
836 -Wl,--entry,$(TARGET_ENTRY) \
837 -Wl,temp.exp -mdll \
838 -o $(MK_NOSTRIPNAME) \
839 $(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
840 - $(RM) temp.exp
841 $(RSYM) $(MK_NOSTRIPNAME) $(MK_BASENAME).sym
842 ifeq ($(FULL_MAP),yes)
843 $(OBJDUMP) -d -S $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
844 else
845 $(NM) --numeric-sort $(MK_NOSTRIPNAME) > $(MK_BASENAME).map
846 endif
847
848 $(MK_FULLNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS) $(MK_NOSTRIPNAME)
849 -
850 ifneq ($(TARGET_CPPAPP),yes)
851 $(LD) --strip-debug -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
852 endif
853 $(LD_CC) -Wl,--base-file,base.tmp \
854 -Wl,--entry,$(TARGET_ENTRY) \
855 $(TARGET_LFLAGS) \
856 -o junk.tmp \
857 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
858 - $(RM) junk.tmp
859 $(DLLTOOL) --dllname $(MK_FULLNAME) \
860 --base-file base.tmp \
861 --output-exp temp.exp $(MK_EXTRACMD) $(MK_KILLAT)
862 - $(RM) base.tmp
863 $(LD_CC) $(TARGET_LFLAGS) \
864 -Wl,--subsystem,native \
865 -Wl,--image-base,$(TARGET_BASE) \
866 -Wl,--file-alignment,0x1000 \
867 -Wl,--section-alignment,0x1000 \
868 -Wl,--entry,$(TARGET_ENTRY) \
869 -Wl,temp.exp -mdll \
870 -o $(MK_FULLNAME) \
871 $(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
872 ifneq ($(TARGET_CPPAPP),yes)
873 - $(RM) temp.exp $(MK_STRIPPED_OBJECT)
874 else
875 - $(RM) temp.exp
876 endif
877 @echo $(MK_FULLNAME) was successfully built.
878
879 endif # MK_MODE
880
881 # Static library target
882 ifeq ($(MK_MODE),static)
883
884 $(MK_FULLNAME): $(MK_EXTRADEP) $(MK_OBJECTS)
885 $(AR) -rc $(MK_FULLNAME) $(MK_OBJECTS)
886 ifneq ($(TARGET_TYPE),test)
887 @echo $(MK_FULLNAME) was successfully built.
888 endif
889
890 # Static libraries dont have a nostrip version
891 $(MK_NOSTRIPNAME):
892 -
893
894 .PHONY: $(MK_NOSTRIPNAME)
895
896 endif # MK_MODE
897
898 endif # MK_IMPLIBONLY
899
900
901 $(MK_FULLRES): $(PATH_TO_TOP)/include/reactos/buildno.h $(MK_RES_SRC)
902
903 ifeq ($(MK_DEPENDS),yes)
904 depends:
905 else
906 depends:
907 endif
908
909 ifeq ($(MK_IMPLIB),yes)
910 $(MK_IMPLIBPATH)/$(MK_BASENAME).a: $(MK_DEFNAME)
911 $(DLLTOOL) --dllname $(MK_FULLNAME) \
912 --def $(MK_DEFNAME) \
913 --output-lib $(MK_IMPLIBPATH)/$(MK_BASENAME).a \
914 $(MK_KILLAT)
915
916 implib: $(MK_IMPLIBPATH)/$(MK_BASENAME).a
917 else
918 implib: $(SUBDIRS:%=%_implib)
919 endif
920
921 # Precompiled header support
922 # When using PCHs, use dependency tracking to keep the .gch files up-to-date.
923
924 MK_PCHNAME =
925 ifeq ($(ROS_USE_PCH),yes)
926 ifneq ($(TARGET_PCH),)
927 MK_PCHNAME = $(TARGET_PCH).gch
928
929 ifeq ($(TARGET_CPPAPP),yes)
930 PCH_CC := $(CXX)
931 else
932 PCH_CC := $(CC)
933 endif
934
935
936 endif # TARGET_PCH
937 else #
938 MK_PCHNAME =
939 endif # ROS_USE_PCH
940
941 # Be carefull not to clean non-object files
942 MK_CLEANFILES := $(filter %.o,$(MK_OBJECTS))
943 MK_CLEANFILTERED := $(MK_OBJECTS:.o=.d) $(TARGET_PCH:.h=.d)
944 MK_CLEANDEPS := $(join $(dir $(MK_CLEANFILTERED)), $(addprefix ., $(notdir $(MK_CLEANFILTERED))))
945
946 clean: $(MK_REGTESTS_CLEAN) $(SUBDIRS:%=%_clean)
947 - $(RM) *.o $(MK_PCHNAME) $(MK_BASENAME).sym $(MK_BASENAME).a $(MK_RESOURCE) \
948 $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) $(MK_CLEANDEPS) $(MK_BASENAME).map \
949 junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_GENERATED_MAKEFILE) \
950 $(TARGET_CLEAN)
951
952 ifneq ($(TARGET_HEADERS),)
953 $(TARGET_OBJECTS): $(TARGET_HEADERS)
954 endif
955
956 # install and bootcd rules
957
958 ifeq ($(MK_IMPLIBONLY),yes)
959
960 # Don't install import libraries
961
962 install:
963
964 bootcd:
965
966 else # MK_IMPLIBONLY
967
968
969 # Don't install static libraries
970 ifeq ($(MK_MODE),static)
971
972 install:
973
974 bootcd:
975
976 else # MK_MODE
977
978 ifeq ($(INSTALL_SYMBOLS),yes)
979
980 install: $(SUBDIRS:%=%_install) $(MK_FULLNAME) $(MK_BASENAME).sym
981 -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME)
982 -$(CP) $(MK_BASENAME).sym $(INSTALL_DIR)/symbols/$(MK_BASENAME).sym
983 @echo $(MK_FULLNAME) was successfully installed.
984
985 else # INSTALL_SYMBOLS
986
987 install: $(SUBDIRS:%=%_install) $(MK_FULLNAME)
988 -$(CP) $(MK_FULLNAME) $(INSTALL_DIR)/$(MK_INSTALLDIR)/$(MK_FULLNAME)
989
990 endif # INSTALL_SYMBOLS
991
992
993 # Bootstrap files for the bootable CD
994 ifeq ($(TARGET_BOOTSTRAP),yes)
995
996 ifneq ($(TARGET_BOOTSTRAP_NAME),)
997 MK_BOOTSTRAP_NAME := $(TARGET_BOOTSTRAP_NAME)
998 else # TARGET_BOOTSTRAP_NAME
999 MK_BOOTSTRAP_NAME := $(MK_FULLNAME)
1000 endif # TARGET_BOOTSTRAP_NAME
1001
1002 bootcd: $(SUBDIRS:%=%_bootcd)
1003 - $(CP) $(MK_FULLNAME) $(BOOTCD_DIR)/reactos/$(MK_BOOTCDDIR)/$(MK_BOOTSTRAP_NAME)
1004
1005 else # TARGET_BOOTSTRAP
1006
1007 bootcd:
1008
1009 endif # TARGET_BOOTSTRAP
1010
1011 endif # MK_MODE
1012
1013 endif # MK_IMPLIBONLY
1014
1015 ifeq ($(TARGET_TYPE),winedll)
1016 Makefile.ros: Makefile.in Makefile.ros-template
1017 $(WINE2ROS) Makefile.in Makefile.ros-template Makefile.ros
1018
1019 $(MK_RC_BINARIES): $(TARGET_RC_BINSRC)
1020 $(BIN2RES) -f -o $@ $(TARGET_RC_BINSRC)
1021
1022 $(MK_RESOURCE): $(MK_RC_BINARIES)
1023 endif
1024
1025 REGTEST_TESTS = $(wildcard tests/tests/*.c)
1026
1027 $(REGTEST_TARGETS): $(REGTEST_TESTS) ./tests/stubs.tst
1028 $(REGTESTS) ./tests/tests ./tests/_regtests.c ./tests/Makefile.tests -e ./tests/_rtstub.c
1029 $(REGTESTS) -s ./tests/stubs.tst ./tests/_stubs.S ./tests/_hooks.c
1030
1031 clean_regtests:
1032 - $(MAKE) -C tests TARGET_REGTESTS=no clean
1033 - $(RM) ./tests/_rtstub.c ./tests/_hooks.c ./tests/_regtests.c ./tests/_stubs.S ./tests/Makefile.tests
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 test: all
1066 $(MAKE) -C tests run
1067 else
1068 test:
1069 -
1070 endif
1071
1072 ifeq ($(TARGET_TYPE),test)
1073 run: all
1074 @$(CC) -nostdlib -o _runtest.exe regtests.a $(TARGET_LIBS) _stubs.o \
1075 $(SDK_PATH_LIB)/rtshared.a $(SDK_PATH_LIB)/regtests.a _hooks.o -lgcc -lmsvcrt -lntdll
1076 @$(CP) $(REGTESTS_PATH)/regtests/regtests.dll regtests.dll
1077 @_runtest.exe
1078 @$(RM) regtests.dll
1079 @$(RM) _runtest.exe
1080 endif
1081
1082
1083 %.o: %.c $(MK_PCHNAME)
1084 $(CC) $(TARGET_CFLAGS) -c $< -o $@
1085 %.o: %.cc $(MK_PCHNAME)
1086 $(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
1087 %.o: %.cxx $(MK_PCHNAME)
1088 $(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
1089 %.o: %.cpp $(MK_PCHNANE)
1090 $(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
1091 %.o: %.S
1092 $(AS) $(TARGET_ASFLAGS) -c $< -o $@
1093 %.o: %.s
1094 $(AS) $(TARGET_ASFLAGS) -c $< -o $@
1095 %.o: %.asm
1096 $(NASM_CMD) $(TARGET_NFLAGS) $< -o $@
1097 %.coff: %.rc
1098 $(RC) $(TARGET_RCFLAGS) $< -o $@
1099 %.spec.def: %.spec
1100 $(WINEBUILD) $(DEFS) -o $@ --def $<
1101 %.drv.spec.def: %.spec
1102 $(WINEBUILD) $(DEFS) -o $@ --def $<
1103 %.i: %.c
1104 $(CC) $(TARGET_CFLAGS) -E $< > $@
1105 %.h.gch: %.h
1106 $(PCH_CC) $(CFLAGS) $<
1107 # rule for msvc conversion
1108 %.c: %_msvc.c
1109 $(subst /,$(SEP),$(MS2PS)) -try try -except except -finally finally < $< > $@
1110
1111 # Kill implicit rule
1112 .o:;
1113
1114 # Compatibility
1115 CFLAGS := $(TARGET_CFLAGS)
1116 NFLAGS := $(TARGET_NFLAGS)