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