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 # -d Disable automatic dependencies.
56 # -mi Let make handle creation of install directories. Rbuild will not generate the directories.
57 # -ps Generate proxy makefiles in source tree instead of the output tree.
67 ifeq ($(word 1,$(shell gcc
-dumpmachine
)),mingw32
)
74 # Default to half-verbose mode
80 ifeq ($(VERBOSE
),full
)
90 ifeq ($(HOST
),mingw32-linux
)
95 ifeq ($(HALFVERBOSEECHO),yes)
96 ECHO_CP =@echo $(QUOTE)[COPY] $@$(QUOTE)
97 ECHO_MKDIR =@echo $(QUOTE)[MKDIR] $@$(QUOTE)
98 ECHO_BUILDNO =@echo $(QUOTE)[BUILDNO] $@$(QUOTE)
99 ECHO_INVOKE =@echo $(QUOTE)[INVOKE] $<$(QUOTE)
100 ECHO_PCH =@echo $(QUOTE)[PCH] $@$(QUOTE)
101 ECHO_CC =@echo $(QUOTE)[CC] $<$(QUOTE)
102 ECHO_GAS =@echo $(QUOTE)[GAS] $<$(QUOTE)
103 ECHO_NASM =@echo $(QUOTE)[NASM] $<$(QUOTE)
104 ECHO_AR =@echo $(QUOTE)[AR] $@$(QUOTE)
105 ECHO_WINEBLD =@echo $(QUOTE)[WINEBLD] $@$(QUOTE)
106 ECHO_WRC =@echo $(QUOTE)[WRC] $@$(QUOTE)
107 ECHO_WIDL =@echo $(QUOTE)[WIDL] $@$(QUOTE)
108 ECHO_BIN2RES =@echo $(QUOTE)[BIN2RES] $<$(QUOTE)
109 ECHO_DLLTOOL =@echo $(QUOTE)[DLLTOOL] $@$(QUOTE)
110 ECHO_LD =@echo $(QUOTE)[LD] $@$(QUOTE)
111 ECHO_NM =@echo $(QUOTE)[NM] $@$(QUOTE)
112 ECHO_OBJDUMP =@echo $(QUOTE)[OBJDUMP] $@$(QUOTE)
113 ECHO_RBUILD =@echo $(QUOTE)[RBUILD] $@$(QUOTE)
114 ECHO_RSYM =@echo $(QUOTE)[RSYM] $@$(QUOTE)
115 ECHO_WMC =@echo $(QUOTE)[WMC] $@$(QUOTE)
116 ECHO_NCI =@echo $(QUOTE)[NCI] $@$(QUOTE)
117 ECHO_CABMAN =@echo $(QUOTE)[CABMAN] $<$(QUOTE)
118 ECHO_CDMAKE =@echo $(QUOTE)[CDMAKE] $@$(QUOTE)
119 ECHO_MKHIVE =@echo $(QUOTE)[MKHIVE] $@$(QUOTE)
120 ECHO_REGTESTS=@echo $(QUOTE)[REGTESTS] $@$(QUOTE)
121 ECHO_TEST =@echo $(QUOTE)[TEST] $@$(QUOTE)
156 host_objcopy = $(Q)objcopy
157 ifeq ($(HOST),mingw32-linux)
161 mkdir = -$(Q)mkdir -p
162 gcc = $(Q)$(PREFIX)-gcc
163 gpp = $(Q)$(PREFIX)-g++
164 ld = $(Q)$(PREFIX)-ld
165 nm = $(Q)$(PREFIX)-nm
166 objdump = $(Q)$(PREFIX)-objdump
167 ar = $(Q)$(PREFIX)-ar
168 objcopy = $(Q)$(PREFIX)-objcopy
169 dlltool = $(Q)$(PREFIX)-dlltool
170 windres = $(Q)$(PREFIX)-windres
174 else # mingw32-windows
184 objdump = $(Q)objdump
186 objcopy = $(Q)objcopy
187 dlltool = $(Q)dlltool
188 windres = $(Q)windres
194 ifneq ($(ROS_INTERMEDIATE),)
195 INTERMEDIATE := $(ROS_INTERMEDIATE)
197 INTERMEDIATE := obj-i386
199 INTERMEDIATE_ := $(INTERMEDIATE)$(SEP)
201 ifneq ($(ROS_OUTPUT),)
202 OUTPUT := $(ROS_OUTPUT)
204 OUTPUT := output-i386
206 OUTPUT_ := $(OUTPUT)$(SEP)
208 ifneq ($(ROS_TEMPORARY),)
209 TEMPORARY := $(ROS_TEMPORARY)
213 TEMPORARY_ := $(TEMPORARY)$(SEP)
215 ifneq ($(ROS_INSTALL),)
216 INSTALL := $(ROS_INSTALL)
220 INSTALL_ := $(INSTALL)$(SEP)
225 ifneq ($(INTERMEDIATE),$(OUTPUT))
231 NTOSKRNL_MC = ntoskrnl$(SEP)ntoskrnl.mc
232 KERNEL32_MC = lib$(SEP)kernel32$(SEP)kernel32.mc
233 BUILDNO_H = include$(SEP)reactos$(SEP)buildno.h
234 BUGCODES_H = include$(SEP)reactos$(SEP)bugcodes.h
235 BUGCODES_RC = ntoskrnl$(SEP)bugcodes.rc
236 ERRCODES_H = include$(SEP)reactos$(SEP)errcodes.h
237 ERRCODES_RC = lib$(SEP)kernel32$(SEP)errcodes.rc
240 include tools/tools.mak
241 -include makefile.auto
252 makefile.auto: $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
254 $(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) mingw
257 $(BUGCODES_H) $(BUGCODES_RC): $(WMC_TARGET) $(NTOSKRNL_MC)
259 $(Q)$(WMC_TARGET) -i -H $(BUGCODES_H) -o $(BUGCODES_RC) $(NTOSKRNL_MC)
261 $(ERRCODES_H) $(ERRCODES_RC): $(WMC_TARGET) $(KERNEL32_MC)
263 $(Q)$(WMC_TARGET) -i -H $(ERRCODES_H) -o $(ERRCODES_RC) $(KERNEL32_MC)
265 .PHONY: makefile_auto_clean
267 -@$(rm) makefile.auto $(PREAUTO) 2>$(NUL)
270 clean: makefile_auto_clean
274 @-$(rm) makefile.auto
275 @$(MAKE) $(filter-out depends, $(MAKECMDGOALS))