c4a08fb720e48699bbcc9c5bd0cef82b2e1081cc
[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 =@true
34 ECHO_PCH =@true
35 ECHO_CC =@true
36 ECHO_GAS =@true
37 ECHO_NASM =@true
38 ECHO_AR =@true
39 ECHO_WINEBLD=@true
40 ECHO_WRC =@true
41 ECHO_BIN2RES=@true
42 ECHO_DLLTOOL=@true
43 ECHO_LD =@true
44 ECHO_RBUILD =@true
45 ECHO_RSYM =@true
46 ECHO_NCI =@true
47 ECHO_CABMAN =@true
48 ECHO_CDMAKE =@true
49 ECHO_TEST =@true
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 include tools/Makefile
106 -include makefile.auto
107
108 PREAUTO := \
109 include$(SEP)reactos$(SEP)buildno.h \
110 include$(SEP)reactos$(SEP)bugcodes.h \
111 ntoskrnl$(SEP)bugcodes.rc \
112 include$(SEP)reactos$(SEP)errcodes.h \
113 lib$(SEP)kernel32$(SEP)errcodes.rc
114
115 makefile.auto: $(RMKDIR_TARGET) $(BUILDNO_TARGET) $(NCI_SERVICE_FILES) $(WMC_TARGET) $(WRC_TARGET) \
116 $(RSYM_TARGET) $(CDMAKE_TARGET) $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
117 $(ECHO_RBUILD)
118 $(Q)tools$(SEP)rbuild$(SEP)rbuild$(EXEPOSTFIX) mingw
119
120
121 include$(SEP)reactos$(SEP)bugcodes.h ntoskrnl$(SEP)bugcodes.rc: $(WMC_TARGET) ntoskrnl$(SEP)ntoskrnl.mc
122 $(WMC_TARGET) -i -H include$(SEP)reactos$(SEP)bugcodes.h -o ntoskrnl$(SEP)bugcodes.rc ntoskrnl$(SEP)ntoskrnl.mc
123
124 include$(SEP)reactos$(SEP)errcodes.h lib$(SEP)kernel32$(SEP)errcodes.rc: $(WMC_TARGET) lib$(SEP)kernel32$(SEP)kernel32.mc
125 $(WMC_TARGET) -i -H include$(SEP)reactos$(SEP)errcodes.h -o lib$(SEP)kernel32$(SEP)errcodes.rc lib$(SEP)kernel32$(SEP)kernel32.mc
126
127 .PHONY: makefile_auto_clean
128 makefile_auto_clean:
129 -@$(rm) makefile.auto $(PREAUTO) 2>$(NUL)
130 clean: makefile_auto_clean