Added macro for passing RCFLAGS to resource compiler.
[reactos.git] / rosapps / rules.mak
1 #
2 # Select your host
3 #
4 #HOST = mingw32-linux
5 HOST = mingw32-windows
6
7
8 #
9 # Important
10 #
11 .EXPORT_ALL_VARIABLES:
12
13 ifeq ($(HOST),mingw32-linux)
14 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
15 endif
16
17 #
18 # Choose various options
19 #
20 ifeq ($(HOST),mingw32-linux)
21 PREFIX = i586-mingw32-
22 EXE_POSTFIX =
23 CP = cp
24 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
25 FLOPPY_DIR = A/
26 # DIST_DIR should be relative from the top of the tree
27 DIST_DIR = dist
28 endif
29
30
31 ifeq ($(HOST),mingw32-windows)
32 PREFIX =
33 EXE_POSTFIX = .exe
34 CP = copy
35 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
36 RM = del
37 DOSCLI = yes
38 FLOPPY_DIR = A:
39 # DIST_DIR should be relative from the top of the tree
40 DIST_DIR = dist
41 endif
42
43 #
44 # Create variables for all the compiler tools
45 #
46 ifeq ($(WITH_DEBUGGING),yes)
47 DEBUGGING_CFLAGS = -g
48 else
49 DEBUGGING_CFLAGS =
50 endif
51
52 ifeq ($(WARNINGS_ARE_ERRORS),yes)
53 EXTRA_CFLAGS = -Werror
54 endif
55
56 DEFINES = -DDBG
57
58 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
59 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
60 else
61 LEAN_AND_MEAN_DEFINE =
62 endif
63
64 CC = $(PREFIX)gcc
65 NATIVE_CC = gcc
66 CFLAGS = \
67 $(BASE_CFLAGS) \
68 -pipe \
69 -O2 \
70 -Wall \
71 -Wstrict-prototypes \
72 -fno-builtin \
73 $(LEAN_AND_MEAN_DEFINE) \
74 $(DEFINES) \
75 $(DEBUGGING_CFLAGS) \
76 $(EXTRA_CFLAGS)
77 CXXFLAGS = $(CFLAGS)
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 RC = $(PREFIX)windres
86 RCINC = --include-dir ../reactos/include --include-dir ../../reactos/include --include-dir ../../../reactos/include
87
88 %.o: %.cpp
89 $(CC) $(CFLAGS) -c $< -o $@
90 %.o: %.cc
91 $(CC) $(CFLAGS) -c $< -o $@
92 %.o: %.c
93 $(CC) $(CFLAGS) -c $< -o $@
94 %.o: %.asm
95 $(NASM_CMD) $(NFLAGS) $< -o $@
96 %.coff: %.rc
97 $(RC) $(RCFLAGS) $(RCINC) $< $@
98
99
100
101 RULES_MAK_INCLUDED = 1