5602a9c5f10b03613bc3696f1a0e5b3cb06fa3e1
[reactos.git] / reactos / tools / Makefile
1 PATH_TO_TOP = ..
2
3 include $(PATH_TO_TOP)/rules.mak
4
5 CFLAGS += -Wall -Werror
6
7 TOOLS = \
8 regtests$(EXE_POSTFIX) \
9 rcopy$(EXE_POSTFIX) \
10 rdel$(EXE_POSTFIX) \
11 rline$(EXE_POSTFIX) \
12 rmkdir$(EXE_POSTFIX) \
13 rrmdir$(EXE_POSTFIX) \
14 rsym$(EXE_POSTFIX) \
15 rtouch$(EXE_POSTFIX) \
16 mkflpimg$(EXE_POSTFIX) \
17 ppc-le2be$(EXE_POSTFIX) \
18 hack-coff$(EXE_POSTFIX) \
19 depends$(EXE_POSTFIX)
20
21 LIBS = lib_unicode lib_wpp
22
23 CLEAN_FILES = $(TOOLS) tools-check.tmp tools-check.h
24
25 all: $(TOOLS) tools_check $(LIBS) zlib_target wmc_target cabman_target cdmake_target mkhive_target rgenstat_target \
26 wine2ros_target pipetools_target winebuild_target bin2res_target wrc_target widl_target \
27 buildno_target
28
29 tools_check:
30 $(MAKE) -f tools-check.mak
31
32 regtests$(EXE_POSTFIX): regtests.c
33 @$(HOST_CC) $(CFLAGS) -o regtests$(EXE_POSTFIX) regtests.c
34
35 ifeq ($(HOST),mingw32-linux)
36 rcopy$(EXE_POSTFIX): rcopy.c
37 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
38 endif
39 ifeq ($(HOST),mingw32-windows)
40 rcopy$(EXE_POSTFIX): rcopy.c
41 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
42 endif
43
44 rdel$(EXE_POSTFIX): rdel.c
45 @$(HOST_CC) $(CFLAGS) rdel.c -o rdel$(EXE_POSTFIX)
46
47 ifeq ($(HOST),mingw32-linux)
48 rline$(EXE_POSTFIX): rline.c
49 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rline.c -o rline$(EXE_POSTFIX)
50 endif
51 ifeq ($(HOST),mingw32-windows)
52 rline$(EXE_POSTFIX): rline.c
53 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rline.c -o rline$(EXE_POSTFIX)
54 endif
55
56 ifeq ($(HOST),mingw32-linux)
57 rmkdir$(EXE_POSTFIX): rmkdir.c
58 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
59 endif
60 ifeq ($(HOST),mingw32-windows)
61 rmkdir$(EXE_POSTFIX): rmkdir.c
62 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
63 endif
64
65 ifeq ($(HOST),mingw32-linux)
66 rrmdir$(EXE_POSTFIX): rrmdir.c
67 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rrmdir.c -o rrmdir$(EXE_POSTFIX)
68 endif
69 ifeq ($(HOST),mingw32-windows)
70 rrmdir$(EXE_POSTFIX): rrmdir.c
71 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rrmdir.c -o rrmdir$(EXE_POSTFIX)
72 endif
73
74 ifeq ($(HOST),mingw32-linux)
75 rsym$(EXE_POSTFIX): rsym.c
76 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rsym.c -o rsym$(EXE_POSTFIX)
77 endif
78 ifeq ($(HOST),mingw32-windows)
79 rsym$(EXE_POSTFIX): rsym.c
80 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rsym.c -o rsym$(EXE_POSTFIX)
81 endif
82
83 ifeq ($(HOST),mingw32-linux)
84 rtouch$(EXE_POSTFIX): rtouch.c
85 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rtouch.c -o rtouch$(EXE_POSTFIX)
86 endif
87 ifeq ($(HOST),mingw32-windows)
88 rtouch$(EXE_POSTFIX): rtouch.c
89 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rtouch.c -o rtouch$(EXE_POSTFIX)
90 endif
91
92 ifeq ($(HOST),mingw32-linux)
93 mkflpimg$(EXE_POSTFIX): mkflpimg.c
94 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS mkflpimg.c -o mkflpimg$(EXE_POSTFIX)
95 endif
96 ifeq ($(HOST),mingw32-windows)
97 mkflpimg$(EXE_POSTFIX): mkflpimg.c
98 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS mkflpimg.c -o mkflpimg$(EXE_POSTFIX)
99 endif
100
101 ifeq ($(HOST),mingw32-linux)
102 hack-coff$(EXE_POSTFIX): hack-coff.c
103 @$(HOST_CC) $(CFLAGS) hack-coff.c -o hack-coff$(EXE_POSTFIX)
104 endif
105 ifeq ($(HOST),mingw32-windows)
106 hack-coff$(EXE_POSTFIX): hack-coff.c
107 @$(HOST_CC) $(CFLAGS) hack-coff.c -o hack-coff$(EXE_POSTFIX)
108 endif
109
110 ifeq ($(HOST),mingw32-linux)
111 ppc-le2be$(EXE_POSTFIX): ppc-le2be.c
112 @$(HOST_CC) $(CFLAGS) ppc-le2be.c -o ppc-le2be$(EXE_POSTFIX)
113 endif
114 ifeq ($(HOST),mingw32-windows)
115 ppc-le2be$(EXE_POSTFIX): ppc-le2be.c
116 @$(HOST_CC) $(CFLAGS) ppc-le2be.c -o ppc-le2be$(EXE_POSTFIX)
117 endif
118
119 depends$(EXE_POSTFIX): depends.c
120 @$(HOST_CC) $(CFLAGS) depends.c -o depends$(EXE_POSTFIX)
121
122 zlib_target:
123 $(MAKE) --silent -C ../lib/zlib -f Makefile.host
124
125 wmc_target:
126 $(MAKE) --silent -C wmc wmc$(EXE_POSTFIX)
127
128 cabman_target:
129 $(MAKE) --silent -C cabman cabman$(EXE_POSTFIX)
130
131 cdmake_target:
132 $(MAKE) --silent -C cdmake cdmake$(EXE_POSTFIX)
133
134 mkhive_target:
135 $(MAKE) --silent -C mkhive mkhive$(EXE_POSTFIX)
136
137 rgenstat_target:
138 $(MAKE) --silent -C rgenstat rgenstat$(EXE_POSTFIX)
139
140 wine2ros_target:
141 $(MAKE) --silent -C wine2ros wine2ros$(EXE_POSTFIX)
142
143 pipetools_target:
144 ifeq ($(HOST),mingw32-windows)
145 $(MAKE) --silent -C pipetools
146 endif
147
148 winebuild_target:
149 $(MAKE) --silent -C winebuild winebuild$(EXE_POSTFIX)
150
151 bin2res_target:
152 $(MAKE) --silent -C bin2res bin2res$(EXE_POSTFIX)
153
154 wrc_target: $(LIBS)
155 $(MAKE) --silent -C wrc wrc$(EXE_POSTFIX)
156
157 widl_target: lib_wpp
158 $(MAKE) --silent -C widl widl$(EXE_POSTFIX)
159
160 buildno_target:
161 $(MAKE) --silent -C buildno buildno$(EXE_POSTFIX)
162
163 lib_unicode:
164 $(MAKE) -C unicode
165
166 lib_wpp:
167 $(MAKE) -C wpp
168
169 .PHONY: wmc_target cdmake_target mkhive_target rgenstat_target pipetools_target wrc_target \
170 widl_target buildno_target lib_unicode lib_wpp
171
172
173 ifeq ($(HOST),mingw32-linux)
174 clean:
175 $(MAKE) --silent -C buildno clean
176 $(MAKE) --silent -C widl clean
177 $(MAKE) --silent -C wrc clean
178 $(MAKE) --silent -C cabman clean
179 $(MAKE) --silent -C cdmake clean
180 $(MAKE) --silent -C mkhive clean
181 $(MAKE) --silent -C wmc clean
182 $(MAKE) --silent -C rgenstat clean
183 $(MAKE) --silent -C wine2ros clean
184 $(MAKE) --silent -C winebuild clean
185 $(MAKE) --silent -C bin2res clean
186 $(MAKE) --silent -C ../lib/zlib -f Makefile.host clean
187 $(MAKE) -C wpp clean
188 $(MAKE) -C unicode clean
189 @rm mkconfig
190 @rm $(TOOLS)
191 endif
192 ifeq ($(HOST),mingw32-windows)
193 clean:
194 $(MAKE) --silent -C buildno clean
195 $(MAKE) --silent -C widl clean
196 $(MAKE) --silent -C wrc clean
197 $(MAKE) --silent -C cabman clean
198 $(MAKE) --silent -C cdmake clean
199 $(MAKE) --silent -C mkhive clean
200 $(MAKE) --silent -C wmc clean
201 $(MAKE) --silent -C rgenstat clean
202 $(MAKE) --silent -C pipetools clean
203 $(MAKE) --silent -C wine2ros clean
204 $(MAKE) --silent -C winebuild clean
205 $(MAKE) --silent -C bin2res clean
206 $(MAKE) --silent -C ../lib/zlib -f Makefile.host clean
207 $(MAKE) -C wpp clean
208 $(MAKE) -C unicode clean
209 -@del *$(EXE_POSTFIX)
210 endif
211
212 .PHONY: all clean