Merge 13159:13510 from trunk
[reactos.git] / reactos / rules.mak
1 # Default to half-verbose mode
2 ifeq ($(VERBOSE),no)
3 Q = @
4 HALFVERBOSEECHO = @:
5 # Do not print "Entering directory ..."
6 export MAKEFLAGS += --no-print-directory
7 # Be silent
8 export MAKEFLAGS += --silent
9 else
10 ifeq ($(VERBOSE),yes)
11 Q =
12 HALFVERBOSEECHO = @:
13 else
14 Q = @
15 # the following is a hack to get the target name for wine dlls
16 # it's disabled because it produces warnings about overriden rules for author.c
17 #ifeq ($(TARGET_TYPE),winedll)
18 # export TOOLS_PATH = $(PATH_TO_TOP)/tools
19 # -include Makefile.ros
20 #endif
21 ifeq ($(TARGET_NAME),)
22 HALFVERBOSEECHO = @echo
23 else
24 HALFVERBOSEECHO = @echo $(TARGET_NAME):
25 endif
26 # Do not print "Entering directory ..."
27 export MAKEFLAGS += --no-print-directory
28 # Be silent
29 export MAKEFLAGS += --silent
30 endif
31 endif
32
33 export MAKE := @$(MAKE)
34
35 ifeq ($(VERBOSE),no)
36 endif
37
38 # Windows is default host environment
39 ifeq ($(HOST),)
40 export HOST = mingw32-windows
41 endif
42
43 # Default to building map files which includes source and asm code
44 # Other options are: yes
45 ifeq ($(BUILD_MAP),)
46 export BUILD_MAP = full
47 endif
48
49 # Default to dumping .sym files out of .nostrip files
50 ifeq ($(BUILD_SYM),)
51 export BUILD_SYM = yes
52 endif
53
54 # Default to minimal dependencies, making components not
55 # depend on all import libraries
56 ifeq ($(MINIMALDEPENDENCIES),)
57 export MINIMALDEPENDENCIES = yes
58 endif
59
60 # Default to no PCH support
61 ifeq ($(ROS_USE_PCH),)
62 export ROS_USE_PCH = no
63 endif
64
65 # uncomment if you use bochs and it displays only 30 rows
66 # BOCHS_30ROWS = yes
67
68 #
69 # Choose various options
70 #
71 ifeq ($(HOST),mingw32-linux)
72 export NASM_FORMAT = win32
73 export PREFIX = mingw32-
74 export EXE_POSTFIX :=
75 export EXE_PREFIX := ./
76 export DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
77 #
78 # Do not change NASM_CMD to NASM because older versions of
79 # nasm doesn't like an environment variable NASM
80 #
81 export NASM_CMD = nasm
82 export DOSCLI =
83 export FLOPPY_DIR = /mnt/floppy
84 export SEP := /
85 export PIPE :=
86 endif
87
88 ifeq ($(HOST),mingw32-windows)
89 export NASM_FORMAT = win32
90 export PREFIX =
91 export EXE_PREFIX :=
92 export EXE_POSTFIX := .exe
93 export DLLTOOL = $(Q)$(PREFIX)dlltool --as=$(PREFIX)as
94 #
95 # Do not change NASM_CMD to NASM because older versions of
96 # nasm doesn't like an environment variable NASM
97 #
98 export NASM_CMD = $(Q)nasmw
99 export DOSCLI = yes
100 export FLOPPY_DIR = A:
101 export SEP := \$(EMPTY_VAR)
102 export PIPE := -pipe
103 endif
104
105 # TOPDIR is used by make bootcd but not defined anywhere. Usurp pointed out
106 # that it has the same meaning as PATH_TO_TOP.
107 export TOPDIR = $(PATH_TO_TOP)
108
109 # Directory to build a bootable CD image in
110 export BOOTCD_DIR=$(TOPDIR)/../bootcd/disk
111 export LIVECD_DIR=$(TOPDIR)/../livecd/disk
112
113 ifeq ($(LIVECD_INSTALL),yes)
114 export INSTALL_DIR=$(LIVECD_DIR)/reactos
115 else
116 # Use environment var ROS_INSTALL to override default install dir
117 ifeq ($(ROS_INSTALL),)
118 ifeq ($(HOST),mingw32-windows)
119 export INSTALL_DIR = C:/reactos
120 else
121 export INSTALL_DIR = $(PATH_TO_TOP)/reactos
122 endif
123 else
124 export INSTALL_DIR = $(ROS_INSTALL)
125 endif
126 endif
127
128
129 export CC = $(Q)$(PREFIX)gcc
130 export CXX = $(Q)$(PREFIX)g++
131 export HOST_CC = $(Q)gcc
132 export HOST_CXX = $(Q)g++
133 export HOST_AR = $(Q)ar
134 export HOST_NM = $(Q)nm
135 export LD = $(Q)$(PREFIX)ld
136 export NM = $(Q)$(PREFIX)nm
137 export OBJCOPY = $(Q)$(PREFIX)objcopy
138 export STRIP = $(Q)$(PREFIX)strip
139 export AS = $(Q)$(PREFIX)gcc -c -x assembler-with-cpp
140 export CPP = $(Q)$(PREFIX)cpp
141 export AR = $(Q)$(PREFIX)ar
142 export RC = $(Q)$(PREFIX)windres
143 export WRC = $(Q)$(WINE_TOP)/tools/wrc/wrc
144 export OBJCOPY = $(Q)$(PREFIX)objcopy
145 export OBJDUMP =$(Q)$(PREFIX)objdump
146 export TOOLS_PATH = $(PATH_TO_TOP)/tools
147 export W32API_PATH = $(PATH_TO_TOP)/w32api
148 export CP = $(Q)$(TOOLS_PATH)/rcopy
149 export RM = $(Q)$(TOOLS_PATH)/rdel
150 export RLINE = $(Q)$(TOOLS_PATH)/rline
151 export RMDIR = $(Q)$(TOOLS_PATH)/rrmdir
152 export RMKDIR = $(Q)$(TOOLS_PATH)/rmkdir
153 export RSYM = $(Q)$(TOOLS_PATH)/rsym
154 export RTOUCH = $(Q)$(TOOLS_PATH)/rtouch
155 export REGTESTS = $(Q)$(TOOLS_PATH)/regtests
156 export MC = $(Q)$(TOOLS_PATH)/wmc/wmc
157 export CABMAN = $(Q)$(TOOLS_PATH)/cabman/cabman
158 export WINEBUILD = $(Q)$(TOOLS_PATH)/winebuild/winebuild
159 export WINE2ROS = $(Q)$(TOOLS_PATH)/wine2ros/wine2ros
160 export MKHIVE = $(Q)$(TOOLS_PATH)/mkhive/mkhive
161 export CDMAKE = $(Q)$(TOOLS_PATH)/cdmake/cdmake
162 export BIN2RES = $(Q)$(TOOLS_PATH)/bin2res/bin2res
163 export XSLTPROC = $(Q)xsltproc
164 export MS2PS = $(Q)$(TOOLS_PATH)/ms2ps/ms2ps
165
166 export STD_CFLAGS = -I$(PATH_TO_TOP)/include -I$(W32API_PATH)/include -pipe -march=$(OARCH) -D_M_IX86
167 export STD_CPPFLAGS = $(STD_CFLAGS)
168 # Check for 3GB
169 ifeq ($(3GB), 1)
170 export STD_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(W32API_PATH)/include -D__ASM__ -D_M_IX86 -D__3GB__
171 else
172 export STD_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(W32API_PATH)/include -D__ASM__ -D_M_IX86
173 endif
174 export STD_RCFLAGS = --include-dir $(PATH_TO_TOP)/include --include-dir $(W32API_PATH)/include
175 export STD_NFLAGS = -f win32
176
177 # Developer Kits
178 export DK_PATH=$(PATH_TO_TOP)/dk
179 # Native and kernel mode
180 export DDK_PATH=$(DK_PATH)/nkm
181 export DDK_PATH_LIB=$(DDK_PATH)/lib
182 export DDK_PATH_INC=$(PATH_TO_TOP)/include
183 # Win32
184 export SDK_PATH=$(DK_PATH)/w32
185 export SDK_PATH_LIB=$(SDK_PATH)/lib
186 export SDK_PATH_INC=$(PATH_TO_TOP)/include
187 # POSIX+
188 export XDK_PATH=$(DK_PATH)/psx
189 export XDK_PATH_LIB=$(XDK_PATH)/lib
190 export XDK_PATH_INC=$(XDK_PATH)/include
191
192 # Wine Integration
193 export WINE_PATH=$(PATH_TO_TOP)/../wine
194 export WINE_PATH_LIB=$(WINE_PATH)/lib
195 export WINE_PATH_INC=$(WINE_PATH)/include
196
197 # Posix+ Integration
198 export POSIX_PATH=$(PATH_TO_TOP)/../posix
199 export POSIX_PATH_LIB=$(POSIX_PATH)/lib
200 export POSIX_PATH_INC=$(POSIX_PATH)/include
201
202 # OS/2 Integration
203 export OS2_PATH=$(PATH_TO_TOP)/../os2
204 export OS2_PATH_LIB=$(OS2_PATH)/lib
205 export OS2_PATH_INC=$(OS2_PATH)/include
206
207 # Other systems integration
208 export REGTESTS_PATH=$(PATH_TO_TOP)/regtests
209 export REGTESTS_PATH_INC=$(PATH_TO_TOP)/regtests/shared