53c9b15294e02d116dd34404f0191f7f55a1418f
[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 depends$(EXE_POSTFIX)
18
19 LIBS = lib_unicode lib_wpp
20
21 CLEAN_FILES = $(TOOLS)
22
23 all: $(TOOLS) $(LIBS) zlib_target wmc_target cabman_target cdmake_target mkhive_target rgenstat_target \
24 wine2ros_target pipetools_target winebuild_target bin2res_target wrc_target widl_target \
25 buildno_target
26
27 regtests$(EXE_POSTFIX): regtests.c
28 @$(HOST_CC) $(CFLAGS) -o regtests$(EXE_POSTFIX) regtests.c
29
30 ifeq ($(HOST),mingw32-linux)
31 rcopy$(EXE_POSTFIX): rcopy.c
32 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
33 endif
34 ifeq ($(HOST),mingw32-windows)
35 rcopy$(EXE_POSTFIX): rcopy.c
36 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rcopy.c -o rcopy$(EXE_POSTFIX)
37 endif
38
39 rdel$(EXE_POSTFIX): rdel.c
40 @$(HOST_CC) $(CFLAGS) rdel.c -o rdel$(EXE_POSTFIX)
41
42 ifeq ($(HOST),mingw32-linux)
43 rline$(EXE_POSTFIX): rline.c
44 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rline.c -o rline$(EXE_POSTFIX)
45 endif
46 ifeq ($(HOST),mingw32-windows)
47 rline$(EXE_POSTFIX): rmkdir.c
48 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rline.c -o rline$(EXE_POSTFIX)
49 endif
50
51 ifeq ($(HOST),mingw32-linux)
52 rmkdir$(EXE_POSTFIX): rmkdir.c
53 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
54 endif
55 ifeq ($(HOST),mingw32-windows)
56 rmkdir$(EXE_POSTFIX): rmkdir.c
57 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rmkdir.c -o rmkdir$(EXE_POSTFIX)
58 endif
59
60 ifeq ($(HOST),mingw32-linux)
61 rrmdir$(EXE_POSTFIX): rrmdir.c
62 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rrmdir.c -o rrmdir$(EXE_POSTFIX)
63 endif
64 ifeq ($(HOST),mingw32-windows)
65 rrmdir$(EXE_POSTFIX): rrmdir.c
66 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rrmdir.c -o rrmdir$(EXE_POSTFIX)
67 endif
68
69 ifeq ($(HOST),mingw32-linux)
70 rsym$(EXE_POSTFIX): rsym.c
71 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rsym.c -o rsym$(EXE_POSTFIX)
72 endif
73 ifeq ($(HOST),mingw32-windows)
74 rsym$(EXE_POSTFIX): rsym.c
75 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rsym.c -o rsym$(EXE_POSTFIX)
76 endif
77
78 ifeq ($(HOST),mingw32-linux)
79 rtouch$(EXE_POSTFIX): rtouch.c
80 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS rtouch.c -o rtouch$(EXE_POSTFIX)
81 endif
82 ifeq ($(HOST),mingw32-windows)
83 rtouch$(EXE_POSTFIX): rtouch.c
84 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS rtouch.c -o rtouch$(EXE_POSTFIX)
85 endif
86
87 ifeq ($(HOST),mingw32-linux)
88 mkflpimg$(EXE_POSTFIX): mkflpimg.c
89 @$(HOST_CC) $(CFLAGS) -DUNIX_PATHS mkflpimg.c -o mkflpimg$(EXE_POSTFIX)
90 endif
91 ifeq ($(HOST),mingw32-windows)
92 mkflpimg$(EXE_POSTFIX): mkflpimg.c
93 @$(HOST_CC) $(CFLAGS) -DDOS_PATHS mkflpimg.c -o mkflpimg$(EXE_POSTFIX)
94 endif
95
96 depends$(EXE_POSTFIX): depends.c
97 @$(HOST_CC) $(CFLAGS) depends.c -o depends$(EXE_POSTFIX)
98
99 zlib_target:
100 $(MAKE) --silent -C ../lib/zlib -f Makefile.host
101
102 wmc_target:
103 $(MAKE) --silent -C wmc wmc$(EXE_POSTFIX)
104
105 cabman_target:
106 $(MAKE) --silent -C cabman cabman$(EXE_POSTFIX)
107
108 cdmake_target:
109 $(MAKE) --silent -C cdmake cdmake$(EXE_POSTFIX)
110
111 mkhive_target:
112 $(MAKE) --silent -C mkhive mkhive$(EXE_POSTFIX)
113
114 rgenstat_target:
115 $(MAKE) --silent -C rgenstat rgenstat$(EXE_POSTFIX)
116
117 wine2ros_target:
118 $(MAKE) --silent -C wine2ros wine2ros$(EXE_POSTFIX)
119
120 pipetools_target:
121 ifeq ($(HOST),mingw32-windows)
122 $(MAKE) --silent -C pipetools
123 endif
124
125 winebuild_target:
126 $(MAKE) --silent -C winebuild winebuild$(EXE_POSTFIX)
127
128 bin2res_target:
129 $(MAKE) --silent -C bin2res bin2res$(EXE_POSTFIX)
130
131 wrc_target: $(LIBS)
132 $(MAKE) --silent -C wrc wrc$(EXE_POSTFIX)
133
134 widl_target: lib_wpp
135 $(MAKE) --silent -C widl widl$(EXE_POSTFIX)
136
137 buildno_target:
138 $(MAKE) --silent -C buildno buildno$(EXE_POSTFIX)
139
140 lib_unicode:
141 $(MAKE) -C unicode
142
143 lib_wpp:
144 $(MAKE) -C wpp
145
146 .PHONY: wmc_target cdmake_target mkhive_target rgenstat_target pipetools_target wrc_target \
147 widl_target buildno_target lib_unicode lib_wpp
148
149
150 ifeq ($(HOST),mingw32-linux)
151 clean:
152 $(MAKE) --silent -C buildno clean
153 $(MAKE) --silent -C widl clean
154 $(MAKE) --silent -C wrc clean
155 $(MAKE) --silent -C cabman clean
156 $(MAKE) --silent -C cdmake clean
157 $(MAKE) --silent -C mkhive clean
158 $(MAKE) --silent -C wmc clean
159 $(MAKE) --silent -C rgenstat clean
160 $(MAKE) --silent -C wine2ros clean
161 $(MAKE) --silent -C winebuild clean
162 $(MAKE) --silent -C bin2res clean
163 $(MAKE) --silent -C ../lib/zlib -f Makefile.host clean
164 $(MAKE) -C wpp clean
165 $(MAKE) -C unicode clean
166 @rm mkconfig
167 @rm $(TOOLS)
168 endif
169 ifeq ($(HOST),mingw32-windows)
170 clean:
171 $(MAKE) --silent -C buildno clean
172 $(MAKE) --silent -C widl clean
173 $(MAKE) --silent -C wrc clean
174 $(MAKE) --silent -C cabman clean
175 $(MAKE) --silent -C cdmake clean
176 $(MAKE) --silent -C mkhive clean
177 $(MAKE) --silent -C wmc clean
178 $(MAKE) --silent -C rgenstat clean
179 $(MAKE) --silent -C pipetools clean
180 $(MAKE) --silent -C wine2ros clean
181 $(MAKE) --silent -C winebuild clean
182 $(MAKE) --silent -C bin2res clean
183 $(MAKE) --silent -C ../lib/zlib -f Makefile.host clean
184 $(MAKE) -C wpp clean
185 $(MAKE) -C unicode clean
186 -@del *$(EXE_POSTFIX)
187 endif
188
189 .PHONY: all clean