1 # Accepted environment variables:
4 # This variable specifies the prefix of the MinGW installation. On Windows
5 # a prefix is usually not needed, but on linux it is usually "mingw32". If
6 # not present and no executable named "gcc" can be found, then the prefix is
7 # assumed to be "mingw32". If your gcc is named i386-mingw32-gcc then set
8 # ROS_PREFIX to i386-mingw32. Don't include the dash (-) before gcc.
11 # This variable controls where to put intermediate files. Intermediate
12 # files are generated files that are needed to generate the final
13 # output files. Examples of intermediate files include *.o, *.a, and
14 # *.coff. N.B. Don't put a path separator at the end. The variable
15 # defaults to .\obj-i386.
18 # This variable controls where to put output files. Output files are
19 # generated files that makes up the result of the build process.
20 # Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't
21 # put a path separator at the end. The variable defaults to .\output-i386.
24 # This variable controls where to put temporary files. Temporary files
25 # are (usually small) generated files that are needed to generate the
26 # intermediate or final output files. Examples of temporary files include
27 # *.rci (preprocessed .rc files for wrc), *.tmp, and *.exp. N.B. Don't put
28 # a path separator at the end. The variable defaults to the current
32 # This variable controls where to install output files to when using
33 # 'make install'. N.B. Don't put a path separator at the end. The variable
34 # defaults to .\reactos.
37 # This variable controls if map files are to be generated for executable
38 # output files. Map files have the extension .map. The value can be either
39 # full (to build map files with assembly code), yes (to build map files
40 # without source code) or no (to not build any map files). The variable
44 # This variable controls if non-symbol-stripped versions are to be built
45 # of executable output files. Non-symbol-stripped executable output files
46 # have .nostrip added to the filename just before the extension. The value
47 # can be either yes (to build non-symbol-stripped versions of executable
48 # output files) or no (to not build non-symbol-stripped versions of
49 # executable output files). The variable defaults to no.
52 # Pass parameters to rbuild.
54 # -c Clean as you go. Delete generated files as soon as they are not needed anymore.
55 # -dd Disable automatic dependencies.
56 # -dm{module} Check only automatic dependencies for this module.
57 # -mi Let make handle creation of install directories. Rbuild will not generate the directories.
58 # -ps Generate proxy makefiles in source tree instead of the output tree.
68 ifeq ($(word 1,$(shell gcc
-dumpmachine
)),mingw32
)
75 # Default to half-verbose mode
81 ifeq ($(VERBOSE
),full
)
91 ifeq ($(HOST
),mingw32-linux
)
96 ifeq ($(HALFVERBOSEECHO),yes)
97 ECHO_CP =@echo $(QUOTE)[COPY] $@$(QUOTE)
98 ECHO_MKDIR =@echo $(QUOTE)[MKDIR] $@$(QUOTE)
99 ECHO_BUILDNO =@echo $(QUOTE)[BUILDNO] $@$(QUOTE)
100 ECHO_INVOKE =@echo $(QUOTE)[INVOKE] $<$(QUOTE)
101 ECHO_PCH =@echo $(QUOTE)[PCH] $@$(QUOTE)
102 ECHO_CC =@echo $(QUOTE)[CC] $<$(QUOTE)
103 ECHO_GAS =@echo $(QUOTE)[GAS] $<$(QUOTE)
104 ECHO_NASM =@echo $(QUOTE)[NASM] $<$(QUOTE)
105 ECHO_AR =@echo $(QUOTE)[AR] $@$(QUOTE)
106 ECHO_WINEBLD =@echo $(QUOTE)[WINEBLD] $@$(QUOTE)
107 ECHO_WRC =@echo $(QUOTE)[WRC] $@$(QUOTE)
108 ECHO_WIDL =@echo $(QUOTE)[WIDL] $@$(QUOTE)
109 ECHO_BIN2RES =@echo $(QUOTE)[BIN2RES] $<$(QUOTE)
110 ECHO_DLLTOOL =@echo $(QUOTE)[DLLTOOL] $@$(QUOTE)
111 ECHO_LD =@echo $(QUOTE)[LD] $@$(QUOTE)
112 ECHO_NM =@echo $(QUOTE)[NM] $@$(QUOTE)
113 ECHO_OBJDUMP =@echo $(QUOTE)[OBJDUMP] $@$(QUOTE)
114 ECHO_RBUILD =@echo $(QUOTE)[RBUILD] $@$(QUOTE)
115 ECHO_RSYM =@echo $(QUOTE)[RSYM] $@$(QUOTE)
116 ECHO_WMC =@echo $(QUOTE)[WMC] $@$(QUOTE)
117 ECHO_NCI =@echo $(QUOTE)[NCI] $@$(QUOTE)
118 ECHO_CABMAN =@echo $(QUOTE)[CABMAN] $<$(QUOTE)
119 ECHO_CDMAKE =@echo $(QUOTE)[CDMAKE] $@$(QUOTE)
120 ECHO_MKHIVE =@echo $(QUOTE)[MKHIVE] $@$(QUOTE)
121 ECHO_REGTESTS=@echo $(QUOTE)[REGTESTS] $@$(QUOTE)
122 ECHO_TEST =@echo $(QUOTE)[TEST] $@$(QUOTE)
157 host_objcopy = $(Q)objcopy
158 ifeq ($(HOST),mingw32-linux)
162 mkdir = -$(Q)mkdir -p
163 gcc = $(Q)$(PREFIX)-gcc
164 gpp = $(Q)$(PREFIX)-g++
165 ld = $(Q)$(PREFIX)-ld
166 nm = $(Q)$(PREFIX)-nm
167 objdump = $(Q)$(PREFIX)-objdump
168 ar = $(Q)$(PREFIX)-ar
169 objcopy = $(Q)$(PREFIX)-objcopy
170 dlltool = $(Q)$(PREFIX)-dlltool
171 windres = $(Q)$(PREFIX)-windres
175 else # mingw32-windows
185 objdump = $(Q)objdump
187 objcopy = $(Q)objcopy
188 dlltool = $(Q)dlltool
189 windres = $(Q)windres
195 ifneq ($(ROS_INTERMEDIATE),)
196 INTERMEDIATE := $(ROS_INTERMEDIATE)
198 INTERMEDIATE := obj-i386
200 INTERMEDIATE_ := $(INTERMEDIATE)$(SEP)
202 ifneq ($(ROS_OUTPUT),)
203 OUTPUT := $(ROS_OUTPUT)
205 OUTPUT := output-i386
207 OUTPUT_ := $(OUTPUT)$(SEP)
209 ifneq ($(ROS_TEMPORARY),)
210 TEMPORARY := $(ROS_TEMPORARY)
214 TEMPORARY_ := $(TEMPORARY)$(SEP)
216 ifneq ($(ROS_INSTALL),)
217 INSTALL := $(ROS_INSTALL)
221 INSTALL_ := $(INSTALL)$(SEP)
226 ifneq ($(INTERMEDIATE),$(OUTPUT))
232 NTOSKRNL_MC = ntoskrnl$(SEP)ntoskrnl.mc
233 KERNEL32_MC = lib$(SEP)kernel32$(SEP)kernel32.mc
234 BUILDNO_H = include$(SEP)reactos$(SEP)buildno.h
235 BUGCODES_H = include$(SEP)reactos$(SEP)bugcodes.h
236 BUGCODES_RC = ntoskrnl$(SEP)bugcodes.rc
237 ERRCODES_H = include$(SEP)reactos$(SEP)errcodes.h
238 ERRCODES_RC = lib$(SEP)kernel32$(SEP)errcodes.rc
241 include tools/tools.mak
242 -include makefile.auto
253 makefile.auto: $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
255 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) mingw
258 $(BUGCODES_H) $(BUGCODES_RC): $(WMC_TARGET) $(NTOSKRNL_MC)
260 $(Q)$(WMC_TARGET) -i -H $(BUGCODES_H) -o $(BUGCODES_RC) $(NTOSKRNL_MC)
262 $(ERRCODES_H) $(ERRCODES_RC): $(WMC_TARGET) $(KERNEL32_MC)
264 $(Q)$(WMC_TARGET) -i -H $(ERRCODES_H) -o $(ERRCODES_RC) $(KERNEL32_MC)
266 .PHONY: makefile_auto_clean
268 -@$(rm) makefile.auto $(PREAUTO) 2>$(NUL)
271 clean: makefile_auto_clean
275 @-$(rm) makefile.auto
276 @$(MAKE) $(filter-out depends, $(MAKECMDGOALS))