*** empty log message ***
[reactos.git] / reactos / rules.mak
1 #
2 # Important
3 #
4 .EXPORT_ALL_VARIABLES:
5
6 ifeq ($(HOST),mingw32-linux)
7 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
8 endif
9
10 #
11 # Choose various options
12 #
13 ifeq ($(HOST),mingw32-linux)
14 NASM_FORMAT = win32
15 PREFIX = i586-mingw32-
16 EXE_POSTFIX =
17 CP = cp
18 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
19 NASM_CMD = nasm
20 KM_SPECS = $(TOPDIR)/specs
21 FLOPPY_DIR = /a
22 # DIST_DIR should be relative from the top of the tree
23 DIST_DIR = dist
24 endif
25
26 ifeq ($(HOST),mingw32-windows)
27 NASM_FORMAT = win32
28 PREFIX =
29 EXE_POSTFIX = .exe
30 CP = copy
31 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
32 NASM_CMD = nasm
33 RM = del
34 KM_SPECS = specs
35 DOSCLI = yes
36 FLOPPY_DIR = A:
37 # DIST_DIR should be relative from the top of the tree
38 DIST_DIR = dist
39 endif
40
41 #
42 # Create variables for all the compiler tools
43 #
44 ifeq ($(WITH_DEBUGGING),yes)
45 DEBUGGING_CFLAGS = -g
46 else
47 DEBUGGING_CFLAGS =
48 endif
49
50 ifeq ($(WARNINGS_ARE_ERRORS),yes)
51 EXTRA_CFLAGS = -Werror
52 endif
53
54 DEFINES = -DDBG
55
56 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
57 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
58 else
59 LEAN_AND_MEAN_DEFINE =
60 endif
61
62 CC = $(PREFIX)gcc
63 NATIVE_CC = gcc
64 CFLAGS = $(BASE_CFLAGS) \
65 -pipe \
66 -O2 \
67 -Iinclude \
68 -fno-builtin $(LEAN_AND_MEAN_DEFINE) \
69 $(DEFINES) -Wall \
70 -Wstrict-prototypes $(DEBUGGING_CFLAGS) \
71 $(EXTRA_CFLAGS)
72 CXXFLAGS = $(CFLAGS)
73 NFLAGS = -i../../include/ -i../include/ -pinternal/asm.inc -f$(NASM_FORMAT) -d$(NASM_FORMAT)
74 LD = $(PREFIX)ld
75 NM = $(PREFIX)nm
76 OBJCOPY = $(PREFIX)objcopy
77 STRIP = $(PREFIX)strip
78 AS = $(PREFIX)gcc -c -x assembler-with-cpp
79 CPP = $(PREFIX)cpp
80 AR = $(PREFIX)ar
81 RC = $(PREFIX)windres
82
83 %.o: %.cc
84 $(CC) $(CFLAGS) -c $< -o $@
85 %.o: %.c
86 $(CC) $(CFLAGS) -c $< -o $@
87 %.o: %.asm
88 $(NASM_CMD) $(NFLAGS) $< -o $@
89 %.coff: %.rc
90 $(RC) $< $@
91
92
93 RULES_MAK_INCLUDED = 1