Don't try to build modules that won't build.
[reactos.git] / rosapps / rules.mak
1 #
2 # Important
3 #
4 .EXPORT_ALL_VARIABLES:
5
6 #
7 # Select your host
8 #HOST = mingw32-windows
9 #HOST = mingw32-linux
10 #
11
12 # Windows is default host environment
13 ifeq ($(HOST),)
14 HOST = mingw32-windows
15 endif
16
17
18 ifeq ($(HOST),mingw32-linux)
19 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
20 endif
21
22 #
23 # Choose various options
24 #
25 ifeq ($(HOST),mingw32-linux)
26 PREFIX = mingw32-
27 EXE_POSTFIX =
28 CP = cp
29 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
30 RM = rm
31 DOSCLI = no
32 FLOPPY_DIR = /mnt/floppy
33 # DIST_DIR should be relative from the top of the tree
34 DIST_DIR = dist
35 SEP = /
36 endif
37
38
39 ifeq ($(HOST),mingw32-windows)
40 PREFIX =
41 EXE_POSTFIX = .exe
42 CP = copy
43 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
44 RM = del
45 DOSCLI = yes
46 FLOPPY_DIR = A:
47 # DIST_DIR should be relative from the top of the tree
48 DIST_DIR = dist
49 SEP = \$($EMPTY_VAR)
50 endif
51
52 #
53 # Create variables for all the compiler tools
54 #
55 ifeq ($(WITH_DEBUGGING),yes)
56 DEBUGGING_CFLAGS = -g
57 else
58 DEBUGGING_CFLAGS =
59 endif
60
61 ifeq ($(WARNINGS_ARE_ERRORS),yes)
62 EXTRA_CFLAGS = -Werror
63 endif
64
65 DEFINES = -DDBG
66
67 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
68 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
69 else
70 LEAN_AND_MEAN_DEFINE =
71 endif
72
73 CPP = $(PREFIX)g++
74 CC = $(PREFIX)gcc
75 NATIVE_CC = gcc
76 CFLAGS = \
77 $(BASE_CFLAGS) \
78 -pipe \
79 -O2 \
80 -Wall \
81 -Wstrict-prototypes \
82 -fno-builtin \
83 $(LEAN_AND_MEAN_DEFINE) \
84 $(DEFINES) \
85 $(DEBUGGING_CFLAGS) \
86 $(EXTRA_CFLAGS)
87 CXXFLAGS = $(CFLAGS)
88 LD = $(PREFIX)ld
89 NM = $(PREFIX)nm
90 OBJCOPY = $(PREFIX)objcopy
91 STRIP = $(PREFIX)strip
92 AS = $(PREFIX)gcc -c -x assembler-with-cpp
93 AR = $(PREFIX)ar
94 RC = $(PREFIX)windres
95 RCINC = --include-dir $(PATH_TO_TOP)/../reactos/include
96 TOOLS_PATH = $(PATH_TO_TOP)/../reactos/tools
97 RSYM = $(TOOLS_PATH)/rsym
98
99 %.o: %.cpp
100 $(CPP) $(CFLAGS) -c $< -o $@
101 %.o: %.cc
102 $(CPP) $(CFLAGS) -c $< -o $@
103 %.o: %.c
104 $(CC) $(CFLAGS) -c $< -o $@
105 %.o: %.asm
106 $(NASM_CMD) $(NFLAGS) $< -o $@
107 %.coff: %.rc
108 $(RC) $(RCFLAGS) $(RCINC) $< $@
109
110
111
112 RULES_MAK_INCLUDED = 1