added CHECKED to defines
[reactos.git] / reactos / rules.mak
1 #
2 # Important
3 #
4 .EXPORT_ALL_VARIABLES:
5
6
7 #
8 # Choose various options
9 #
10 ifeq ($(HOST),elf-linux)
11 NASM_FORMAT = elf
12 PREFIX =
13 KERNEL_BFD_TARGET = elf32-i386
14 EXE_POSTFIX =
15 CP = cp
16 endif
17
18 ifeq ($(HOST),djgpp-linux)
19 NASM_FORMAT = coff
20 PREFIX = dos-
21 KERNEL_BFD_TARGET = coff-i386
22 EXE_POSTFIX =
23 CP = cp
24 LIBGCC = ./libgcc.a
25 endif
26
27 ifeq ($(HOST),mingw32-linux)
28 NASM_FORMAT = win32
29 PREFIX = /opt/gnu/bin/i386-mingw32-
30 KERNEL_BFD_TARGET = pe-i386
31 EXE_POSTFIX =
32 CP = cp
33 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
34 LIBGCC = /opt/gnu/lib/gcc-lib/i386-mingw32/2.8.0/libgcc.a
35 endif
36
37 ifeq ($(HOST),djgpp-msdos)
38 NASM_FORMAT = coff
39 PREFIX =
40 KERNEL_BFD_TARGET = coff-go32
41 EXE_POSTFIX = .exe
42 CP = copy
43 LIBGCC = libgcc.a
44 endif
45
46 ifeq ($(HOST),mingw32-windows)
47 NASM_FORMAT = win32
48 PREFIX =
49 KERNEL_BFD_TARGET = pe-i386
50 EXE_POSTFIX = .exe
51 CP = copy
52 endif
53
54 #
55 # Create variables for all the compiler tools
56 #
57 ifeq ($(WITH_DEBUGGING),yes)
58 DEBUGGING_CFLAGS = -g
59 else
60 DEBUGGING_CFLAGS =
61 endif
62
63 DEFINES = -DDBG -DCHECKED
64
65 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
66 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
67 else
68 LEAN_AND_MEAN_DEFINE =
69 endif
70
71 CC = $(PREFIX)gcc
72 NATIVE_CC = gcc
73 CFLAGS = -O2 -I../../../include -I../../include -I../include -fno-builtin \
74 $(LEAN_AND_MEAN_DEFINE) $(DEFINES) -Wall -Wstrict-prototypes $(DEBUGGING_CFLAGS)
75 CXXFLAGS = $(CFLAGS)
76 NASM_CMD = nasmw
77 NFLAGS = -i../../include/ -i../include/ -pinternal/asm.inc -f$(NASM_FORMAT) -d$(NASM_FORMAT)
78 LD = $(PREFIX)ld
79 NM = $(PREFIX)nm
80 OBJCOPY = $(PREFIX)objcopy
81 STRIP = $(PREFIX)strip
82 AS = $(PREFIX)gcc -c -x assembler-with-cpp
83 CPP = $(PREFIX)cpp
84 AR = $(PREFIX)ar
85
86 %.o: %.cc
87 $(CC) $(CFLAGS) -c $< -o $@
88 %.o: %.asm
89 $(NASM_CMD) $(NFLAGS) $< -o $@
90
91
92 RULES_MAK_INCLUDED = 1