4 # This target builds all of ReactOS.
7 # These targets builds a single module. Replace module with the name of
8 # the module you want to build.
11 # This target builds an ISO (ReactOS.iso) from which ReactOS can be booted
15 # This target builds an ISO (ReactOS-Live.iso) from which ReactOS can be
16 # booted, but not installed.
19 # This target installs all of ReactOS to a location specified by the
20 # ROS_INSTALL environment variable.
23 # These targets installs a single module to a location specified by the
24 # ROS_INSTALL environment variable. Replace module with the name of the
25 # module you want to install.
28 # This target cleans (deletes) all files that are generated when building
32 # These targets cleans (deletes) files that are generated when building a
33 # single module. Replace module with the name of the module you want to
37 # This target does a complete dependency check of the ReactOS codebase.
38 # This can require several minutes to complete. If you only need to check
39 # dependencies for a single or few modules then you can use the
40 # module_depends targets instead. This target can also repair a damaged or
41 # missing makefile.auto if needed.
44 # These targets do a dependency check of individual modules. Replace module
45 # with the name of the module for which you want to check dependencies.
46 # This is faster than the depends target which does a complete dependency
47 # check of the ReactOS codebase.
50 # Accepted environment variables:
53 # This variable specifies the prefix of the MinGW installation. On Windows
54 # a prefix is usually not needed, but on linux it is usually "mingw32". If
55 # not present and no executable named "gcc" can be found, then the prefix is
56 # assumed to be "mingw32". If your gcc is named i386-mingw32-gcc then set
57 # ROS_PREFIX to i386-mingw32. Don't include the dash (-) before gcc.
60 # This variable controls where to put intermediate files. Intermediate
61 # files are generated files that are needed to generate the final
62 # output files. Examples of intermediate files include *.o, *.a, and
63 # *.coff. N.B. Don't put a path separator at the end. The variable
64 # defaults to .\obj-i386.
67 # This variable controls where to put output files. Output files are
68 # generated files that makes up the result of the build process.
69 # Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't
70 # put a path separator at the end. The variable defaults to .\output-i386.
73 # This variable controls where to put temporary files. Temporary files
74 # are (usually small) generated files that are needed to generate the
75 # intermediate or final output files. Examples of temporary files include
76 # *.rci (preprocessed .rc files for wrc), *.tmp, and *.exp. N.B. Don't put
77 # a path separator at the end. The variable defaults to the current
81 # This variable controls where to install output files to when using
82 # 'make install'. N.B. Don't put a path separator at the end. The variable
83 # defaults to .\reactos.
86 # This variable controls if map files are to be generated for executable
87 # output files. Map files have the extension .map. The value can be either
88 # full (to build map files with assembly code), yes (to build map files
89 # without source code) or no (to not build any map files). The variable
93 # This variable controls if non-symbol-stripped versions are to be built
94 # of executable output files. Non-symbol-stripped executable output files
95 # have .nostrip added to the filename just before the extension. The value
96 # can be either yes (to build non-symbol-stripped versions of executable
97 # output files) or no (to not build non-symbol-stripped versions of
98 # executable output files). The variable defaults to no.
101 # Pass parameters to rbuild.
103 # -c Clean as you go. Delete generated files as soon as they are not needed anymore.
104 # -dd Disable automatic dependencies.
105 # -dm{module} Check only automatic dependencies for this module.
106 # -mi Let make handle creation of install directories. Rbuild will not generate the directories.
107 # -ps Generate proxy makefiles in source tree instead of the output tree.
117 ifeq ($(word 1,$(shell gcc
-dumpmachine
)),mingw32
)
118 ifeq ($(OSTYPE
),msys
)
128 # Default to half-verbose mode
134 ifeq ($(VERBOSE
),full
)
140 HALFVERBOSEECHO
= yes
144 ifeq ($(HOST
),mingw32-linux
)
149 ifeq ($(HALFVERBOSEECHO),yes)
150 ECHO_CP =@echo $(QUOTE)[COPY] $@$(QUOTE)
151 ECHO_MKDIR =@echo $(QUOTE)[MKDIR] $@$(QUOTE)
152 ECHO_BUILDNO =@echo $(QUOTE)[BUILDNO] $@$(QUOTE)
153 ECHO_INVOKE =@echo $(QUOTE)[INVOKE] $<$(QUOTE)
154 ECHO_PCH =@echo $(QUOTE)[PCH] $@$(QUOTE)
155 ECHO_CC =@echo $(QUOTE)[CC] $<$(QUOTE)
156 ECHO_GAS =@echo $(QUOTE)[GAS] $<$(QUOTE)
157 ECHO_NASM =@echo $(QUOTE)[NASM] $<$(QUOTE)
158 ECHO_AR =@echo $(QUOTE)[AR] $@$(QUOTE)
159 ECHO_WINEBLD =@echo $(QUOTE)[WINEBLD] $@$(QUOTE)
160 ECHO_WRC =@echo $(QUOTE)[WRC] $@$(QUOTE)
161 ECHO_WIDL =@echo $(QUOTE)[WIDL] $@$(QUOTE)
162 ECHO_BIN2RES =@echo $(QUOTE)[BIN2RES] $<$(QUOTE)
163 ECHO_DLLTOOL =@echo $(QUOTE)[DLLTOOL] $@$(QUOTE)
164 ECHO_LD =@echo $(QUOTE)[LD] $@$(QUOTE)
165 ECHO_NM =@echo $(QUOTE)[NM] $@$(QUOTE)
166 ECHO_OBJDUMP =@echo $(QUOTE)[OBJDUMP] $@$(QUOTE)
167 ECHO_RBUILD =@echo $(QUOTE)[RBUILD] $@$(QUOTE)
168 ECHO_RSYM =@echo $(QUOTE)[RSYM] $@$(QUOTE)
169 ECHO_WMC =@echo $(QUOTE)[WMC] $@$(QUOTE)
170 ECHO_NCI =@echo $(QUOTE)[NCI] $@$(QUOTE)
171 ECHO_CABMAN =@echo $(QUOTE)[CABMAN] $<$(QUOTE)
172 ECHO_CDMAKE =@echo $(QUOTE)[CDMAKE] $@$(QUOTE)
173 ECHO_MKHIVE =@echo $(QUOTE)[MKHIVE] $@$(QUOTE)
174 ECHO_REGTESTS=@echo $(QUOTE)[REGTESTS] $@$(QUOTE)
175 ECHO_TEST =@echo $(QUOTE)[TEST] $@$(QUOTE)
176 ECHO_GENDIB =@echo $(QUOTE)[GENDIB] $@$(QUOTE)
212 host_objcopy = $(Q)objcopy
213 ifeq ($(HOST),mingw32-linux)
214 export EXEPREFIX = ./
215 ifeq ($(OSTYPE),msys)
216 export EXEPOSTFIX = .exe
221 mkdir = -$(Q)mkdir -p
222 gcc = $(Q)$(PREFIX)-gcc
223 gpp = $(Q)$(PREFIX)-g++
224 ld = $(Q)$(PREFIX)-ld
225 nm = $(Q)$(PREFIX)-nm
226 objdump = $(Q)$(PREFIX)-objdump
227 ar = $(Q)$(PREFIX)-ar
228 objcopy = $(Q)$(PREFIX)-objcopy
229 dlltool = $(Q)$(PREFIX)-dlltool
230 windres = $(Q)$(PREFIX)-windres
234 else # mingw32-windows
235 ifeq ($(OSTYPE),msys)
237 export EXEPREFIX = ./
238 export EXEPOSTFIX = .exe
240 mkdir = -$(Q)mkdir -p
245 objdump = $(Q)objdump
247 objcopy = $(Q)objcopy
248 dlltool = $(Q)dlltool
249 windres = $(Q)windres
255 export EXEPOSTFIX = .exe
257 export SEP = \$(ROS_EMPTY)
263 objdump = $(Q)objdump
265 objcopy = $(Q)objcopy
266 dlltool = $(Q)dlltool
267 windres = $(Q)windres
274 ifneq ($(ROS_INTERMEDIATE),)
275 INTERMEDIATE := $(ROS_INTERMEDIATE)
277 INTERMEDIATE := obj-i386
279 INTERMEDIATE_ := $(INTERMEDIATE)$(SEP)
281 ifneq ($(ROS_OUTPUT),)
282 OUTPUT := $(ROS_OUTPUT)
284 OUTPUT := output-i386
286 OUTPUT_ := $(OUTPUT)$(SEP)
288 ifneq ($(ROS_TEMPORARY),)
289 TEMPORARY := $(ROS_TEMPORARY)
293 TEMPORARY_ := $(TEMPORARY)$(SEP)
295 ifneq ($(ROS_INSTALL),)
296 INSTALL := $(ROS_INSTALL)
300 INSTALL_ := $(INSTALL)$(SEP)
305 ifneq ($(INTERMEDIATE),$(OUTPUT))
311 NTOSKRNL_MC = ntoskrnl$(SEP)ntoskrnl.mc
312 KERNEL32_MC = lib$(SEP)kernel32$(SEP)kernel32.mc
313 BUILDNO_H = include$(SEP)reactos$(SEP)buildno.h
314 BUGCODES_H = include$(SEP)reactos$(SEP)bugcodes.h
315 BUGCODES_RC = ntoskrnl$(SEP)bugcodes.rc
316 ERRCODES_H = include$(SEP)reactos$(SEP)errcodes.h
317 ERRCODES_RC = lib$(SEP)kernel32$(SEP)errcodes.rc
320 include tools/tools.mak
321 include boot/freeldr/bootsect/bootsect.mak
322 -include makefile.auto
332 $(NCI_SERVICE_FILES) \
335 makefile.auto: $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
337 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) mingw
340 msvc: $(RBUILD_TARGET)
342 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) msvc
344 $(BUGCODES_H) $(BUGCODES_RC): $(WMC_TARGET) $(NTOSKRNL_MC)
346 $(Q)$(WMC_TARGET) -i -H $(BUGCODES_H) -o $(BUGCODES_RC) $(NTOSKRNL_MC)
348 $(ERRCODES_H) $(ERRCODES_RC): $(WMC_TARGET) $(KERNEL32_MC)
350 $(Q)$(WMC_TARGET) -i -H $(ERRCODES_H) -o $(ERRCODES_RC) $(KERNEL32_MC)
353 msvc6: $(RBUILD_TARGET)
355 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs6.00 msvc
358 msvc7: $(RBUILD_TARGET)
360 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 msvc
363 msvc71: $(RBUILD_TARGET)
365 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 msvc
368 msvc8: $(RBUILD_TARGET)
370 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 msvc
372 .PHONY: makefile_auto_clean
374 -@$(rm) makefile.auto $(PREAUTO) 2>$(NUL)
377 clean: makefile_auto_clean
381 @-$(rm) makefile.auto
382 @$(MAKE) $(filter-out depends, $(MAKECMDGOALS))