da5b2cb682cac79fe5376586bfeee08c8ee33546
[reactos.git] / reactos / Makefile
1 # Default to half-verbose mode
2 ifeq ($(VERBOSE),no)
3 Q = @
4 HALFVERBOSEECHO = no
5 else
6 ifeq ($(VERBOSE),yes)
7 Q =
8 HALFVERBOSEECHO = no
9 else
10 Q = @
11 HALFVERBOSEECHO = yes
12 endif
13 endif
14 ifeq ($(HALFVERBOSEECHO),yes)
15 ECHO_INVOKE =@echo [INVOKE] $<
16 ECHO_PCH =@echo [PCH] $@
17 ECHO_CC =@echo [CC] $<
18 ECHO_GAS =@echo [GAS] $<
19 ECHO_NASM =@echo [NASM] $<
20 ECHO_AR =@echo [AR] $@
21 ECHO_WINEBLD=@echo [WINEBLD] $@
22 ECHO_WRC =@echo [WRC] $@
23 ECHO_BIN2RES=@echo [BIN2RES] $<
24 ECHO_DLLTOOL=@echo [DLLTOOL] $@
25 ECHO_LD =@echo [LD] $@
26 ECHO_RBUILD =@echo [RBUILD] $@
27 ECHO_RSYM =@echo [RSYM] $@
28 ECHO_NCI =@echo [NCI] $@
29 ECHO_CABMAN =@echo [CABMAN] $<
30 ECHO_CDMAKE =@echo [CDMAKE] $@
31 ECHO_TEST =@echo [TEST] $@
32 else
33 ECHO_INVOKE =
34 ECHO_PCH =
35 ECHO_CC =
36 ECHO_GAS =
37 ECHO_NASM =
38 ECHO_AR =
39 ECHO_WINEBLD=
40 ECHO_WRC =
41 ECHO_BIN2RES=
42 ECHO_DLLTOOL=
43 ECHO_LD =
44 ECHO_RBUILD =
45 ECHO_RSYM =
46 ECHO_NCI =
47 ECHO_CABMAN =
48 ECHO_CDMAKE =
49 ECHO_TEST =
50 endif
51
52
53 host_gcc = $(Q)gcc
54 host_gpp = $(Q)g++
55 host_ld = $(Q)ld
56 host_ar = $(Q)ar
57 host_objcopy = $(Q)objcopy
58 ifeq ($(HOST),mingw32-linux)
59 EXEPREFIX = ./
60 EXEPOSTFIX =
61 SEP = /
62 nmkdir = $(Q)mkdir -p
63 gcc = $(Q)mingw32-gcc
64 gpp = $(Q)mingw32-g++
65 ld = $(Q)mingw32-ld
66 ar = $(Q)mingw32-ar
67 objcopy = $(Q)mingw32-objcopy
68 dlltool = $(Q)mingw32-dlltool
69 windres = $(Q)mingw32-windres
70 rm = rm -f
71 cp = $(Q)cp
72 NUL = /dev/null
73 else # mingw32-windows
74 EXEPREFIX =
75 EXEPOSTFIX = .exe
76 SEP = \$(EMPTY_VAR)
77 nmkdir = $(Q)mkdir
78 gcc = $(Q)gcc
79 gpp = $(Q)g++
80 ld = $(Q)ld
81 ar = $(Q)ar
82 objcopy = $(Q)objcopy
83 dlltool = $(Q)dlltool
84 windres = $(Q)windres
85 rm = del /f /q
86 cp = $(Q)copy /y
87 NUL = NUL
88 endif
89
90 .PHONY: all
91 .PHONY: clean
92
93 all: makefile.auto
94
95 ifneq ($(ROS_INTERMEDIATE),)
96 $(ROS_INTERMEDIATE)tools: $(ROS_INTERMEDIATE)
97 ${nmkdir} $(ROS_INTERMEDIATE)tools
98 endif
99
100 ifneq ($(ROS_INTERMEDIATE),)
101 $(ROS_INTERMEDIATE):
102 ${nmkdir} $(ROS_INTERMEDIATE)
103 endif
104
105 NTOSKRNL_MC = .$(SEP)ntoskrnl$(SEP)ntoskrnl.mc
106 KERNEL32_MC = .$(SEP)lib$(SEP)kernel32$(SEP)kernel32.mc
107 BUILDNO_H = .$(SEP)include$(SEP)reactos$(SEP)buildno.h
108 BUGCODES_H = .$(SEP)include$(SEP)reactos$(SEP)bugcodes.h
109 BUGCODES_RC = .$(SEP)ntoskrnl$(SEP)bugcodes.rc
110 ERRCODES_H = .$(SEP)include$(SEP)reactos$(SEP)errcodes.h
111 ERRCODES_RC = .$(SEP)lib$(SEP)kernel32$(SEP)errcodes.rc
112
113 include tools/tools.mak
114 -include makefile.auto
115
116 PREAUTO := \
117 $(BUILDNO_H) \
118 $(BUGCODES_H) \
119 $(BUGCODES_RC) \
120 $(ERRCODES_H) \
121 $(ERRCODES_RC)
122
123 makefile.auto: $(RMKDIR_TARGET) $(BUILDNO_TARGET) $(NCI_SERVICE_FILES) $(WMC_TARGET) $(WRC_TARGET) \
124 $(RSYM_TARGET) $(CDMAKE_TARGET) $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
125 $(ECHO_RBUILD)
126 $(Q)tools$(SEP)rbuild$(SEP)rbuild$(EXEPOSTFIX) mingw
127
128
129 $(BUGCODES_H) $(BUGCODES_RC): $(WMC_TARGET) $(NTOSKRNL_MC)
130 $(WMC_TARGET) -i -H $(BUGCODES_H) -o $(BUGCODES_RC) $(NTOSKRNL_MC)
131
132 $(ERRCODES_H) $(ERRCODES_RC): $(WMC_TARGET) $(KERNEL32_MC)
133 $(WMC_TARGET) -i -H $(ERRCODES_H) -o $(ERRCODES_RC) $(KERNEL32_MC)
134
135 .PHONY: makefile_auto_clean
136 makefile_auto_clean:
137 -@$(rm) makefile.auto $(PREAUTO) 2>$(NUL)
138 clean: makefile_auto_clean