OSDN Git Service

Add lib/libshell32/shell32.o to the libshell32.a library.
[mingw/mingw-org-wsl.git] / Makefile.in
1 ##
2 # @file Makefile.in
3 # Copyright (C) 2012-2013 MinGW.org Project
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the "Software"),
7 # to deal in the Software without restriction, including without limitation
8 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 # and/or sell copies of the Software, and to permit persons to whom the
10 # Software is furnished to do so, subject to the following conditions:
11
12 # The above copyright notice and this permission notice (including the next
13 # paragraph) shall be included in all copies or substantial portions of the
14 # Software.
15
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 # DEALINGS IN THE SOFTWARE.
23 ##
24 #
25 # @configure_input@
26 #
27 VPATH=$(srcdir)
28 PACKAGE_TARNAME=@PACKAGE_TARNAME@
29 PACKAGE_VERSION=@PACKAGE_VERSION@
30 PACKAGE_RELEASE=@PACKAGE_RELEASE@
31 RELEASE_STATUS=@RELEASE_STATUS@
32 RELEASE_REFERENCE=@RELEASE_REFERENCE@
33 srcdir=@srcdir@
34 top_srcdir=@top_srcdir@
35 top_builddir=@top_builddir@
36
37 prefix=@prefix@
38 exec_prefix=@exec_prefix@
39 datarootdir=@datarootdir@
40 bindir=@bindir@
41 libdir=@libdir@
42 includedir=@includedir@
43 docdir=@docdir@
44 mingwrtdocdir=$(docdir)/../mingwrt
45 w32apidocdir=$(docdir)/../w32api
46
47 mkinstalldirs=@MKDIR_P@
48
49 CC = @CC@
50 CFLAGS = @CFLAGS@
51 RANLIB = @RANLIB@
52 AS = @AS@
53 DLLTOOL = @DLLTOOL@
54 DLLTOOL_FLAGS = --as $(AS) -k --dllname
55 INSTALL = @INSTALL@
56 INSTALL_DATA = @INSTALL_DATA@
57 MKDIR_P = @MKDIR_P@
58
59 INCLUDES=-I$(top_srcdir)/include -I$(srcdir)/include \
60   -I$(top_srcdir)/src/libcrt/include -I$(top_srcdir)/misc/src/include \
61   -nostdinc -iwithprefixbefore include
62 ALL_CFLAGS=$(CFLAGS) $(INCLUDES) -DNTDDI_VERSION=0x04000000
63
64 .SUFFIXES: .def.in .def
65
66 mingwrt_lib_LIBRARIES = \
67   libmsvcrt.a \
68   libmsvcrtd.a \
69   libmsvcr70.a \
70   libmsvcr70d.a \
71   libmsvcr71.a \
72   libmsvcr71d.a \
73   libmsvcr80.a \
74   libmsvcr80d.a \
75   libmsvcr90.a \
76   libmsvcr90d.a \
77   libmsvcr100.a \
78   libmsvcr100d.a \
79   libmingw32.a \
80   libmoldname.a \
81   libmoldnamed.a \
82   libmoldname70.a \
83   libmoldname70d.a \
84   libmoldname71.a \
85   libmoldname71d.a \
86   libmoldname80.a \
87   libmoldname80d.a \
88   libmoldname90.a \
89   libmoldname90d.a \
90   libmoldname100.a \
91   libmoldname100d.a \
92   libmingwthrd.a \
93   libmingwthrd_old.a \
94   libm.a \
95   libmingwex.a \
96   libgmon.a
97
98 OBJDIR := src/libcrt/crt
99 mingwrt_lib_OBJECTS = \
100   $(OBJDIR)/CRT_fp10.o \
101   $(OBJDIR)/CRT_fp8.o \
102   $(OBJDIR)/CRT_noglob.o \
103   $(OBJDIR)/binmode.o \
104   $(OBJDIR)/crt2.o \
105   $(OBJDIR)/crtmt.o \
106   $(OBJDIR)/crtst.o \
107   $(OBJDIR)/dllcrt2.o \
108   $(OBJDIR)/txtmode.o
109
110 OBJDIR2 := misc/gpl/profile
111 mingwrt_lib_OBJECTS += \
112   $(OBJDIR2)/gcrt2.o 
113
114 winapi_DEF := $(notdir $(wildcard ${top_srcdir}/lib/lib32/*.def))
115 winapi_DDK_DEF := $(notdir $(wildcard $(top_srcdir)/lib/lib32/ddk/*.def))
116 winapi_DIRECTX_DEF := $(notdir $(wildcard $(top_srcdir)/lib/lib32/directx/*.def))
117 winapi_DIRECTX_DEF := $(subst dinput.def ,,$(winapi_DIRECTX_DEF))
118 winapi_DIRECTX_DEF := $(subst dinput8.def ,,$(winapi_DIRECTX_DEF))
119 winapi_DIRECTX_DINPUT_DEF := dinput.def dinput8.def
120 winapi_MRI := $(notdir $(wildcard ${top_srcdir}/lib/lib32/*.mri))
121 winapi_lib_LIBRARIES := $(addprefix lib,$(winapi_DEF:.def=.a))
122 winapi_lib_DDK_LIBRARIES := $(addprefix lib,$(winapi_DDK_DEF:.def=.a))
123 winapi_lib_DIRECTX_LIBRARIES := $(addprefix lib,$(winapi_DIRECTX_DEF:.def=.a))
124 winapi_lib_DIRECTX_DINPUT_LIBRARIES := $(addprefix lib,$(winapi_DIRECTX_DINPUT_DEF:.def=.a))
125 winapi_mri_LIBRARIES := $(addprefix lib,$(winapi_MRI:.mri=.a))
126 winapi_lib_EXTRA_LIBRARIES := libuuid.a libscrnsave.a libscrnsavw.a liblargeint.a libdmoguids.a libdxguid.a libdxerr8.a libdxerr9.a libstrmiids.a
127
128 lib_LIBRARIES := $(mingwrt_lib_LIBRARIES) $(winapi_lib_LIBRARIES) \
129   $(winapi_lib_EXTRA_LIBRARIES) $(winapi_mri_LIBRARIES) \
130   $(winapi_lib_DDK_LIBRARIES) $(winapi_lib_DIRECTX_LIBRARIES) \
131   $(winapi_lib_DIRECTX_DINPUT_LIBRARIES)
132
133 SRCDIR := src/libcrt/crt
134 crt0_SOURCES := \
135   $(SRCDIR)/crt1.c \
136   $(SRCDIR)/dllcrt1.c \
137   $(SRCDIR)/CRT_noglob.c \
138   $(SRCDIR)/crtmt.c \
139   $(SRCDIR)/crtst.c \
140   $(SRCDIR)/CRT_fp8.c \
141   $(SRCDIR)/CRT_fp10.c \
142   $(SRCDIR)/txtmode.c \
143   $(SRCDIR)/binmode.c \
144   $(SRCDIR)/ofmt_stub.s
145 crt0_OBJECTS := $(crt0_SOURCES:.c=.o) $(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o
146 crt0_OBJECTS := $(crt0_OBJECTS:.s=.o)
147
148 SRCDIR := src/libcrt/crt
149 mingwm10_dll_SOURCES := \
150   $(SRCDIR)/mthr.c \
151   $(SRCDIR)/mthr_init.c
152 mingwm10_dll_OBJECTS := $(mingwm10_dll_SOURCES:.c=.o)
153 mingwm10_dll_FLAGS := -shared -Wl,--image-base,0x6FBC0000 \
154   -Wl,--entry,_DllMainCRTStartup@12 -L.
155
156 SRCDIR := src/libcrt/crt
157 mold_SOURCES := \
158   $(SRCDIR)/isascii.c \
159   $(SRCDIR)/iscsym.c \
160   $(SRCDIR)/iscsymf.c \
161   $(SRCDIR)/toascii.c \
162   $(SRCDIR)/strcasecmp.c \
163   $(SRCDIR)/strncasecmp.c \
164   $(SRCDIR)/wscmpi.c
165 mold_OBJECTS := $(mode_SOURCES:.c=.o)
166
167 SRCDIR := misc/gpl/profile
168 gcrt0_SOURCES := $(SRCDIR)/gcrt0.c
169 gcrt0_OBJECTS := $(SRCDIR)/gcrt2.o
170
171 lib_OBJECTS := $(crt0_OBJECTS) $(gcrt0_OBJECTS)
172
173 bin_LIBRARIES := mingwm10.dll
174 doc_DOCUMENTS := ChangeLog README LICENSE NEWS TODO NOTES
175 doc_DOCUMENTS_EXTRA := doc/historical/mingw doc/historical/w32api
176
177 libuuid_a_SOURCES := $(addprefix src/libuuid/,$(notdir $(wildcard ${top_srcdir}/src/libuuid/*.c)))
178 libuuid_a_OBJECTS := $(libuuid_a_SOURCES:.c=.o)
179
180 libscrnsave_a_SOURCES := src/libscrnsave/scrnsave.c
181 libscrnsave_a_OBJECTS := $(libscrnsave_a_SOURCES:.c=.o)
182 scrnsave_o_CFLAGS := -UUNICODE
183
184 libscrnsavw_a_SOURCES := src/libscrnsave/scrnsave.c
185 libscrnsavw_a_OBJECTS := src/libscrnsave/scrnsavw.o
186 scrnsavw_o_CFLAGS := -DUNICODE
187
188 libshell32_a_SOURCES := src/libshell32/shell32.c
189 libshell32_a_OBJECTS := src/libshell32/shell32.o
190 shell32_o_CFLAGS := -DUNICODE
191
192 liblargeint_a_SOURCES := src/liblargeint/largeint.c
193 liblargeint_a_OBJECTS := $(liblargeint_a_SOURCES:.c=.o)
194
195 libdmoguids_a_SOURCES := misc/src/libdmoguids/dmoguids.c
196 libdmoguids_a_OBJECTS := $(libdmoguids_a_SOURCES:.c=.o)
197
198 libdxguid_a_SOURCES := misc/src/libdxguid/dxguid.c
199 libdxguid_a_OBJECTS := $(libdxguid_a_SOURCES:.c=.o)
200
201 libstrmiids_a_SOURCES := misc/src/libstrmiids/strmiids.c
202 libstrmiids_a_OBJECTS := $(libstrmiids_a_SOURCES:.c=.o)
203
204 libws2_32_a_SOURCES := src/libws2_32/ws2_32.c
205 libws2_32_a_OBJECTS := $(libws2_32_a_SOURCES:.c=.o)
206
207 extra_OBJECTS := $(libws2_32_a_OBJECTS) src/libcrt/crt/ofmt_stub.o
208
209 msvcrt_DEF = \
210   msvcrt.def msvcr70.def msvcr71.def msvcr80.def msvcr90.def msvcr100.def \
211   msvcrtd.def msvcr70d.def msvcr71d.def msvcr80d.def msvcr90d.def msvcr100d.def
212
213 moldname_DEF = \
214   moldname.def moldnamed.def moldname70.def moldname71.def moldname80.def \
215   moldname90.def moldname100.def moldname70d.def moldname71d.def \
216   moldname80d.def moldname90d.def moldname100d.def
217
218 SRCDIR := src/libcrt/crt
219 libmingw32_a_SOURCES := \
220   $(SRCDIR)/CRTglob.c \
221   $(SRCDIR)/CRTfmode.c \
222   $(SRCDIR)/CRTinit.c \
223   $(SRCDIR)/dllmain.c \
224   $(SRCDIR)/gccmain.c \
225   $(SRCDIR)/main.c \
226   $(SRCDIR)/crtst.c \
227   $(SRCDIR)/CRT_fp10.c \
228   $(SRCDIR)/txtmode.c \
229   $(SRCDIR)/pseudo-reloc.c \
230   $(SRCDIR)/pseudo-reloc-list.c \
231   $(SRCDIR)/cpu_features.c \
232   $(SRCDIR)/tlsmcrt.c \
233   $(SRCDIR)/tlsmthread.c \
234   $(SRCDIR)/tlssup.c \
235   $(SRCDIR)/tlsthrd.c
236 libmingw32_a_OBJECTS := $(libmingw32_a_SOURCES:.c=.o)
237
238 libmingwthrd_a_SOURCES := $(SRCDIR)/crtmt.c
239 libmingwthrd_a_OBJECTS := $(libmingwthrd_a_SOURCES:.c=.o)
240
241 SRCDIR := src/libcrt/complex
242 complex_SOURCES := \
243   $(SRCDIR)/cabs.c \
244   $(SRCDIR)/carg.c \
245   $(SRCDIR)/catan.c \
246   $(SRCDIR)/ccoshf.c \
247   $(SRCDIR)/clog.c \
248   $(SRCDIR)/creal.c \
249   $(SRCDIR)/csqrt.c \
250   $(SRCDIR)/cabsf.c \
251   $(SRCDIR)/cargf.c \
252   $(SRCDIR)/catanf.c \
253   $(SRCDIR)/ccoshl.c \
254   $(SRCDIR)/clogf.c \
255   $(SRCDIR)/crealf.c \
256   $(SRCDIR)/csqrtf.c \
257   $(SRCDIR)/cabsl.c \
258   $(SRCDIR)/cargl.c \
259   $(SRCDIR)/catanh.c \
260   $(SRCDIR)/ccosl.c\
261   $(SRCDIR)/clogl.c \
262   $(SRCDIR)/creall.c \
263   $(SRCDIR)/csqrtl.c \
264   $(SRCDIR)/cacos.c \
265   $(SRCDIR)/casin.c \
266   $(SRCDIR)/catanhf.c \
267   $(SRCDIR)/cexp.c \
268   $(SRCDIR)/cpow.c \
269   $(SRCDIR)/csin.c \
270   $(SRCDIR)/ctan.c \
271   $(SRCDIR)/cacosf.c \
272   $(SRCDIR)/casinf.c \
273   $(SRCDIR)/catanhl.c \
274   $(SRCDIR)/cexpf.c \
275   $(SRCDIR)/cpowf.c \
276   $(SRCDIR)/csinf.c \
277   $(SRCDIR)/ctanf.c \
278   $(SRCDIR)/cacosh.c \
279   $(SRCDIR)/casinh.c \
280   $(SRCDIR)/catanl.c \
281   $(SRCDIR)/cexpl.c \
282   $(SRCDIR)/cpowl.c \
283   $(SRCDIR)/csinh.c \
284   $(SRCDIR)/ctanh.c \
285   $(SRCDIR)/cacoshf.c \
286   $(SRCDIR)/casinhf.c \
287   $(SRCDIR)/ccos.c \
288   $(SRCDIR)/cimag.c \
289   $(SRCDIR)/cproj.c \
290   $(SRCDIR)/csinhf.c \
291   $(SRCDIR)/ctanhf.c \
292   $(SRCDIR)/cacoshl.c \
293   $(SRCDIR)/casinhl.c \
294   $(SRCDIR)/ccosf.c \
295   $(SRCDIR)/cimagf.c \
296   $(SRCDIR)/cprojf.c \
297   $(SRCDIR)/csinhl.c \
298   $(SRCDIR)/ctanhl.c \
299   $(SRCDIR)/cacosl.c \
300   $(SRCDIR)/casinl.c \
301   $(SRCDIR)/ccosh.c \
302   $(SRCDIR)/cimagl.c \
303   $(SRCDIR)/cprojl.c \
304   $(SRCDIR)/csinl.c \
305   $(SRCDIR)/ctanl.c
306 complex_SOURCES := $(wildcard src/libcrt/complex/*.c)
307
308 SRCDIR := src/libcrt/ctype
309 ctype_SOURCES := $(SRCDIR)/isblank.c $(SRCDIR)/iswblank.c
310
311 SRCDIR := src/libcrt/fenv
312 fenv_SOURCES := \
313   $(SRCDIR)/feclearexcept.c \
314   $(SRCDIR)/fegetround.c \
315   $(SRCDIR)/fesetenv.c \
316   $(SRCDIR)/fetestexcept.c \
317   $(SRCDIR)/fegetenv.c \
318   $(SRCDIR)/feholdexcept.c \
319   $(SRCDIR)/fesetexceptflag.c \
320   $(SRCDIR)/feupdateenv.c \
321   $(SRCDIR)/fegetexceptflag.c \
322   $(SRCDIR)/feraiseexcept.c \
323   $(SRCDIR)/fesetround.c
324
325 SRCDIR := misc/src/libcrt/gdtoa
326 gdtoa_SOURCES := \
327   $(SRCDIR)/g__fmt.c \
328   $(SRCDIR)/gethex.c \
329   $(SRCDIR)/qnan.c \
330   $(SRCDIR)/strtopx.c \
331   $(SRCDIR)/g_dfmt.c \
332   $(SRCDIR)/gdtoa.c \
333   $(SRCDIR)/gmisc.c \
334   $(SRCDIR)/smisc.c \
335   $(SRCDIR)/sum.c \
336   $(SRCDIR)/arithchk.c \
337   $(SRCDIR)/g_ffmt.c \
338   $(SRCDIR)/hd_init.c \
339   $(SRCDIR)/strtodg.c \
340   $(SRCDIR)/ulp.c \
341   $(SRCDIR)/dmisc.c \
342   $(SRCDIR)/g_xfmt.c \
343   $(SRCDIR)/hexnan.c \
344   $(SRCDIR)/strtodnrp.c \
345   $(SRCDIR)/dtoa.c \
346   $(SRCDIR)/misc.c \
347   $(SRCDIR)/strtof.c
348
349 SRCDIR := src/libcrt/inttypes
350 inttypes_SOURCES := \
351   $(SRCDIR)/imaxabs.c \
352   $(SRCDIR)/imaxdiv.c \
353   $(SRCDIR)/strtoimax.c \
354   $(SRCDIR)/strtoumax.c \
355   $(SRCDIR)/wcstoimax.c \
356   $(SRCDIR)/wcstoumax.c
357
358 SRCDIR := src/libcrt/math
359 MSRCDIR := misc/src/libcrt/math
360 math_SOURCES := \
361   $(SRCDIR)/acosf.c \
362   $(SRCDIR)/acosh.c \
363   $(SRCDIR)/acoshf.c \
364   $(SRCDIR)/acoshl.c \
365   $(SRCDIR)/acosl.c \
366   $(SRCDIR)/asinf.c \
367   $(SRCDIR)/asinh.c \
368   $(SRCDIR)/asinhf.c \
369   $(SRCDIR)/asinhl.c \
370   $(SRCDIR)/asinl.c \
371   $(SRCDIR)/atan2f.c \
372   $(SRCDIR)/atan2l.c \
373   $(SRCDIR)/atanf.c \
374   $(SRCDIR)/atanh.c \
375   $(SRCDIR)/atanhf.c \
376   $(SRCDIR)/atanhl.c \
377   $(SRCDIR)/atanl.c \
378   $(MSRCDIR)/cbrt.c \
379   $(MSRCDIR)/cbrtf.c \
380   $(MSRCDIR)/cbrtl.c \
381   $(SRCDIR)/ceilf.S \
382   $(SRCDIR)/ceill.S \
383   $(SRCDIR)/copysign.S \
384   $(SRCDIR)/copysignf.S \
385   $(SRCDIR)/copysignl.S \
386   $(SRCDIR)/cosf.S \
387   $(SRCDIR)/coshf.c \
388   $(MSRCDIR)/coshl.c \
389   $(SRCDIR)/cosl.S \
390   $(MSRCDIR)/erfl.c \
391   $(SRCDIR)/exp2.S \
392   $(SRCDIR)/exp2f.S \
393   $(SRCDIR)/exp2l.S \
394   $(SRCDIR)/expf.c \
395   $(SRCDIR)/expl.c \
396   $(SRCDIR)/expm1.c \
397   $(SRCDIR)/expm1f.c \
398   $(SRCDIR)/expm1l.c \
399   $(SRCDIR)/fabs.c \
400   $(SRCDIR)/fabsf.c \
401   $(SRCDIR)/fabsl.c \
402   $(SRCDIR)/fdim.c \
403   $(SRCDIR)/fdimf.c \
404   $(SRCDIR)/fdiml.c \
405   $(SRCDIR)/floorf.S \
406   $(SRCDIR)/floorl.S \
407   $(SRCDIR)/fma.S \
408   $(SRCDIR)/fmaf.S \
409   $(SRCDIR)/fmal.c \
410   $(SRCDIR)/fmax.c \
411   $(SRCDIR)/fmaxf.c \
412   $(SRCDIR)/fmaxl.c \
413   $(SRCDIR)/fmin.c \
414   $(SRCDIR)/fminf.c \
415   $(SRCDIR)/fminl.c \
416   $(SRCDIR)/fmodf.c \
417   $(SRCDIR)/fmodl.c \
418   $(SRCDIR)/fp_consts.c \
419   $(SRCDIR)/fp_constsf.c \
420   $(SRCDIR)/fp_constsl.c \
421   $(SRCDIR)/fpclassify.c \
422   $(SRCDIR)/fpclassifyf.c \
423   $(SRCDIR)/fpclassifyl.c \
424   $(SRCDIR)/frexpf.c \
425   $(MSRCDIR)/frexpl.S \
426   $(SRCDIR)/fucom.c \
427   $(SRCDIR)/hypotf.c \
428   $(MSRCDIR)/hypotl.c \
429   $(SRCDIR)/ilogb.S \
430   $(SRCDIR)/ilogbf.S \
431   $(SRCDIR)/ilogbl.S \
432   $(SRCDIR)/isnan.c \
433   $(SRCDIR)/isnanf.c \
434   $(SRCDIR)/isnanl.c \
435   $(SRCDIR)/ldexpf.c \
436   $(SRCDIR)/ldexpl.c \
437   $(MSRCDIR)/lgamma.c \
438   $(MSRCDIR)/lgammaf.c \
439   $(MSRCDIR)/lgammal.c \
440   $(SRCDIR)/llrint.c \
441   $(SRCDIR)/llrintf.c \
442   $(SRCDIR)/llrintl.c \
443   $(SRCDIR)/log10f.S \
444   $(SRCDIR)/log10l.S \
445   $(SRCDIR)/log1p.S \
446   $(SRCDIR)/log1pf.S \
447   $(SRCDIR)/log1pl.S \
448   $(SRCDIR)/log2.S \
449   $(SRCDIR)/log2f.S \
450   $(SRCDIR)/log2l.S \
451   $(SRCDIR)/logb.c \
452   $(SRCDIR)/logbf.c \
453   $(SRCDIR)/logbl.c \
454   $(SRCDIR)/logf.S \
455   $(SRCDIR)/logl.S \
456   $(SRCDIR)/lrint.c \
457   $(SRCDIR)/lrintf.c \
458   $(SRCDIR)/lrintl.c \
459   $(SRCDIR)/lround.c \
460   $(SRCDIR)/lroundl.c \
461   $(SRCDIR)/lroundf.c \
462   $(SRCDIR)/modff.c \
463   $(SRCDIR)/modfl.c \
464   $(SRCDIR)/nearbyint.S \
465   $(SRCDIR)/nearbyintf.S \
466   $(SRCDIR)/nearbyintl.S \
467   $(SRCDIR)/nextafterf.c \
468   $(SRCDIR)/nextafterl.c \
469   $(SRCDIR)/nexttoward.c \
470   $(SRCDIR)/nexttowardf.c \
471   $(MSRCDIR)/pow.c \
472   $(SRCDIR)/powf.c \
473   $(MSRCDIR)/powi.c \
474   $(MSRCDIR)/powif.c \
475   $(MSRCDIR)/powil.c \
476   $(MSRCDIR)/powl.c \
477   $(SRCDIR)/remainder.S \
478   $(SRCDIR)/remainderf.S \
479   $(SRCDIR)/remainderl.S \
480   $(SRCDIR)/remquo.S \
481   $(SRCDIR)/remquof.S \
482   $(SRCDIR)/remquol.S \
483   $(SRCDIR)/rint.c \
484   $(SRCDIR)/rintf.c \
485   $(SRCDIR)/rintl.c \
486   $(SRCDIR)/round.c \
487   $(SRCDIR)/roundf.c \
488   $(SRCDIR)/roundl.c \
489   $(MSRCDIR)/s_erf.c \
490   $(SRCDIR)/scalbn.S \
491   $(SRCDIR)/scalbnf.S \
492   $(SRCDIR)/scalbnl.S \
493   $(MSRCDIR)/sf_erf.c \
494   $(SRCDIR)/signbit.c \
495   $(SRCDIR)/signbitf.c \
496   $(SRCDIR)/signbitl.c \
497   $(SRCDIR)/sinf.S \
498   $(SRCDIR)/sinhf.c \
499   $(MSRCDIR)/sinhl.c \
500   $(SRCDIR)/sinl.S \
501   $(SRCDIR)/sqrtf.c \
502   $(SRCDIR)/sqrtl.c \
503   $(SRCDIR)/tanf.S \
504   $(SRCDIR)/tanhf.c \
505   $(MSRCDIR)/tanhl.c \
506   $(SRCDIR)/tanl.S \
507   $(MSRCDIR)/tgamma.c \
508   $(MSRCDIR)/tgammaf.c \
509   $(MSRCDIR)/tgammal.c \
510   $(SRCDIR)/trunc.c \
511   $(SRCDIR)/truncf.c \
512   $(SRCDIR)/truncl.c
513
514 SRCDIR := src/libcrt/misc
515 misc_SOURCES := \
516   $(SRCDIR)/getopt.c \
517   $(SRCDIR)/membarrier.c \
518   $(SRCDIR)/mingw-aligned-malloc.c \
519   $(SRCDIR)/mingw-fseek.c \
520   $(SRCDIR)/glob.c
521
522 SRCDIR := src/libcrt/posix/libgen
523 posix_libgen_SOURCES := $(SRCDIR)/basename.c $(SRCDIR)/dirname.c
524 SRCDIR := src/libcrt/posix/unistd
525 posix_unistd_SOURCES := $(SRCDIR)/ftruncate.c $(SRCDIR)/usleep.c
526 posix_SOURCES := $(posix_libgen_SOURCES) $(posix_unistd_SOURCES)
527
528 SRCDIR := misc/src/libcrt/profile
529 profile_SOURCES := \
530   $(SRCDIR)/gmon.c \
531   $(SRCDIR)/mcount.c \
532   misc/gpl/profile/profil.c \
533 libgmon_a_SOURCES := $(profile_SOURCES)
534 libgmon_a_OBJECTS := $(libgmon_a_SOURCES:.c=.o)
535
536 SRCDIR := src/libcrt/search
537 search_SOURCES := \
538   $(SRCDIR)/tdelete.c \
539   $(SRCDIR)/tfind.c \
540   $(SRCDIR)/tsearch.c \
541   $(SRCDIR)/twalk.c
542
543 SRCDIR := src/libcrt/stdio
544 MSRCDIR := misc/src/libcrt/stdio
545 stdio_SOURCES := \
546   $(SRCDIR)/btowc.c \
547   $(SRCDIR)/fopen64.c \
548   $(SRCDIR)/fprintf.c \
549   $(SRCDIR)/fseeko64.c \
550   $(SRCDIR)/ftello64.c \
551   $(SRCDIR)/lseek64.c \
552   $(MSRCDIR)/pformat.c \
553   $(SRCDIR)/printf.c \
554   $(SRCDIR)/snprintf.c \
555   $(SRCDIR)/snwprintf.c \
556   $(SRCDIR)/sprintf.c \
557   $(SRCDIR)/vfprintf.c \
558   $(SRCDIR)/vfscanf.c \
559   $(SRCDIR)/vfwscanf.c \
560   $(SRCDIR)/vprintf.c \
561   $(SRCDIR)/vscanf.c \
562   $(SRCDIR)/vsnprintf.c \
563   $(SRCDIR)/vsnwprintf.c \
564   $(SRCDIR)/vsprintf.c \
565   $(SRCDIR)/vsscanf.c \
566   $(SRCDIR)/vswscanf.c \
567   $(SRCDIR)/vwscanf.c
568
569 SRCDIR := src/libcrt/stdlib
570 stdlib_SOURCES := \
571   $(SRCDIR)/_Exit.c \
572   $(SRCDIR)/atoll.c \
573   $(SRCDIR)/lltoa.c \
574   $(SRCDIR)/lltow.c \
575   $(SRCDIR)/ulltoa.c \
576   $(SRCDIR)/ulltow.c \
577   $(SRCDIR)/wtoll.c
578
579 SRCDIR := src/libcrt/sys/time
580 sys_time_SOURCES := $(SRCDIR)/gettimeofday.c
581 sys_SOURCES := $(sys_time_SOURCES)
582
583 SRCDIR := src/libcrt/tchar
584 tchar_SOURCES := \
585   $(SRCDIR)/dirent.c \
586   $(SRCDIR)/wdirent.c
587
588 SRCDIR := src/libcrt/wchar
589 wchar_SOURCES := \
590   $(SRCDIR)/fwide.c \
591   $(SRCDIR)/mbrtowc.c \
592   $(SRCDIR)/mbsinit.c \
593   $(SRCDIR)/wcrtomb.c \
594   $(SRCDIR)/wcstof.c \
595   $(SRCDIR)/wcstold.c \
596   $(SRCDIR)/wctob.c \
597   $(SRCDIR)/wmemchr.c \
598   $(SRCDIR)/wmemcmp.c \
599   $(SRCDIR)/wmemcpy.c \
600   $(SRCDIR)/wmemmove.c \
601   $(SRCDIR)/wmemset.c
602
603 SRCDIR := src/libcrt/wctype
604 wctype_SOURCES := \
605   $(SRCDIR)/wctrans.c \
606   $(SRCDIR)/wctype.c
607
608 libmingwex_a_SOURCES := \
609   $(complex_SOURCES) \
610   $(ctype_SOURCES) \
611   $(fenv_SOURCES) \
612   $(gdtoa_SOURCES) \
613   $(inttypes_SOURCES) \
614   $(math_SOURCES) \
615   $(misc_SOURCES) \
616   $(posix_SOURCES) \
617   $(search_SOURCES) \
618   $(stdio_SOURCES) \
619   $(stdlib_SOURCES) \
620   $(sys_SOURCES) \
621   $(tchar_SOURCES) \
622   $(wchar_SOURCES) \
623   $(wctype_SOURCES)
624 libmingwex_a_OBJECTS := $(libmingwex_a_SOURCES:.c=.o)
625 libmingwex_a_OBJECTS := $(libmingwex_a_OBJECTS:.S=.o)
626
627 SRCDIR := misc/src/libdinput
628 libdinput_a_SOURCES := \
629   $(SRCDIR)/dinput_joy.c \
630   $(SRCDIR)/dinput_joy2.c \
631   $(SRCDIR)/dinput_kbd.c \
632   $(SRCDIR)/dinput_mouse.c \
633   $(SRCDIR)/dinput_mouse2.c
634 libdinput_a_OBJECTS := $(libdinput_a_SOURCES:.c=.o)
635
636 SRCDIR := misc/src/libdxerr8
637 libdxerr8_a_SOURCES := $(SRCDIR)/dxerr.c $(SRCDIR)/dxerr8.c $(SRCDIR)/dxerr8w.c
638 libdxerr8_a_OBJECTS := $(libdxerr8_a_SOURCES:.c=.o)
639
640 SRCDIR := misc/src/libdxerr9
641 libdxerr9_a_SOURCES := $(SRCDIR)/dxerr.c $(SRCDIR)/dxerr9.c $(SRCDIR)/dxerr9w.c
642 libdxerr9_a_OBJECTS := $(libdxerr9_a_SOURCES:.c=.o)
643
644 ALL_SOURCES := \
645   $(libmingw32_a_SOURCES) \
646   $(libmingwthrd_a_SOURCES) \
647   $(libgmon_a_SOURCES) \
648   $(libmingwex_a_SOURCES) \
649   $(mingwm10_dll_SOURCES) \
650   $(libdinput_a_SOURCES) \
651   $(libdxerr8_a_SOURCES) \
652   $(libdxerr9_a_SOURCES)
653
654 all: $(extra_OBJECTS) $(msvcrt_DEF) $(moldname_DEF) $(lib_LIBRARIES) $(bin_LIBRARIES) $(lib_OBJECTS)
655
656 $(msvcrt_DEF): lib/lib32/msvcrt.def.in
657         N=`echo $@ | sed -e 's|\([a-z]*\)\([0-9]*\).*|\1|'`; \
658         test "$$N" == "msvcr" && N="msvcrt"; \
659         V=`echo $@ | sed -e 's|\([a-z]*\)\([0-9]*\).*|\2|'`; \
660         test -z "$$V" && V=60; \
661         test "$$V" != "100" && V="0$${V}"; \
662         V="0x$${V}0"; \
663         $(CC) -DRUNTIME=$(basename $(notdir $@)) \
664                 -D__FILENAME__=$@ \
665                 -D__$(basename $(notdir $@))__=1 \
666                 -C -E -P -xc-header \
667                 $? > $@
668
669 $(moldname_DEF): lib/lib32/moldname.def.in
670         N=`echo $@ | sed -e 's|\([a-z]*\)\([0-9]*\).*|\1|'`; \
671         test "$$N" == "msvcr" && N="msvcrt"; \
672         V=`echo $@ | sed -e 's|\([a-z]*\)\([0-9]*\).*|\2|'`; \
673         test -z "$$V" && V=60; \
674         F="$@"; \
675         test "$$V" != "100" && V="0$${V}"; \
676         V="0x$${V}0"; \
677         $(CC) -DRUNTIME=$(basename $(notdir $@)) \
678                 -D__FILENAME__=$$F \
679                 -D__$(basename $(notdir $@))__=1 \
680                 -C -E -P -xc-header \
681                 $? > $@
682
683 SRCDIR := lib/lib32
684 $(notdir $(winapi_lib_LIBRARIES)): $(addprefix lib/lib32/,$(winapi_DEF))
685         @echo Making library $@ from $(subst lib,,$(@:.a=.def)).
686         $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/,$(subst lib,,$(@:.a=.def))) --output-lib $@
687         $(RANLIB) $@
688
689 $(notdir $(winapi_mri_LIBRARIES)): $(addprefix lib/lib32/,$(winapi_MRI))
690         @echo Making library $@ from $<.
691         $(AR) -M < $<
692         $(RANLIB) $@
693
694 SRCDIR := lib/lib32/ddk
695 $(notdir $(winapi_lib_DDK_LIBRARIES)): $(addprefix lib/lib32/ddk/,$(winapi_DDK_DEF))
696         @echo Making library $@ from $(subst lib,,$(@:.a=.def)).
697         $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/ddk/,$(subst lib,,$(@:.a=.def))) --output-lib $@
698         $(RANLIB) $@
699
700 SRCDIR := lib/lib32/directx
701 $(notdir $(winapi_lib_DIRECTX_LIBRARIES)): $(addprefix lib/lib32/directx/,$(winapi_DIRECTX_DEF))
702         @echo Making library $@ from $(subst lib,,$(@:.a=.def)).
703         $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/directx/,$(subst lib,,$(@:.a=.def))) --output-lib $@
704         $(RANLIB) $@
705
706 libmoldname.a: moldname.def
707         @echo Making library $@ from $?.
708         DLLNAME="msvcrt.dll"; \
709         $(DLLTOOL) $(DLLTOOL_FLAGS) $${DLLNAME} -U --def $< --output-lib $@
710         $(RANLIB) $@
711
712 libmoldname%.a: moldname%.def
713         @echo Making library $@ from $?.
714         V=`echo $@ | sed -e 's|lib\([a-z]*\)\([0-9]*\).*|\2|'`; \
715         DLLNAME="msvcr$${V}.dll"; \
716         $(DLLTOOL) $(DLLTOOL_FLAGS) $${DLLNAME} -U --def $< --output-lib $@
717         $(RANLIB) $@
718
719 lib%.a: %.def
720         @echo Making library $@ from $?.
721         N=`echo $@ | sed -e 's|lib\([a-z]*\)\([0-9]*\).*|\1|'`; \
722         V=`echo $@ | sed -e 's|lib\([a-z]*\)\([0-9]*\).*|\2|'`; \
723         DLLNAME="$${N}$${V}.dll"; \
724         $(DLLTOOL) $(DLLTOOL_FLAGS) $${DLLNAME} --def $< --output-lib $@ ; \
725         if [[ $${DLLNAME} = msvcrt.dll || \
726               $${DLLNAME} = msvcrtd.dll || \
727               $${DLLNAME} = msvcr70.dll || \
728               $${DLLNAME} = msvcr70d.dll || \
729               $${DLLNAME} = msvcr71.dll || \
730               $${DLLNAME} = msvcr71d.dll ]]; then \
731           $(AR) rc $@ src/libcrt/crt/ofmt_stub.o; \
732         fi
733         $(RANLIB) $@
734
735 lib%.a: src/lib%/%.o
736         @echo Making library $@ from $?.
737         $(AR) rc $@ $*.o
738         $(RANLIB) $@
739
740 %.o : %.c
741         $(MKDIR_P) $(@D)
742         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
743
744 %.o : %.s
745         $(MKDIR_P) $(@D)
746         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
747
748 SRCDIR := src/libcrt/crt
749 $(SRCDIR)/crt2.o $(SRCDIR)/dllcrt2.o:
750         $(MKDIR_P) $(@D)
751         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
752
753 $(SRCDIR)/crt2.o: $(SRCDIR)/crt1.c
754 $(SRCDIR)/dllcrt2.o: $(SRCDIR)/dllcrt1.c
755
756 SRCDIR := src/libscrnsave
757 $(libscrnsave_a_OBJECTS): $(libscrnsave_a_SOURCES)
758         $(MKDIR_P) $(@D)
759         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(scrnsave_o_CFLAGS) -o $@ $<
760
761 $(libscrnsavw_a_OBJECTS): $(libscrnsavw_a_SOURCES)
762         $(MKDIR_P) $(@D)
763         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(scrnsavw_o_CFLAGS) -o $@ $<
764
765 SRCDIR := src/libshell32
766 $(libshell32_a_OBJECTS): $(libshell32_a_SOURCES)
767         $(MKDIR_P) $(@D)
768         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(shell32_o_CFLAGS) -o $@ $<
769
770 SRCDIR := misc/gpl/profile
771 $(SRCDIR)/gcrt2.o:
772         mkdir -p $(@D)
773         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
774
775 $(SRCDIR)/gcrt2.o: $(SRCDIR)/gcrt0.c
776
777 libmingw32.a: $(libmingw32_a_OBJECTS)
778         $(AR) rc $@ $(libmingw32_a_OBJECTS)
779         $(RANLIB) $@
780
781 libmingwex.a: $(libmingwex_a_OBJECTS)
782         $(AR) rc $@ $(libmingwex_a_OBJECTS)
783         $(RANLIB) $@
784
785 libmingwthrd.a: $(libmingwthrd_a_OBJECTS)
786         $(AR) rc $@ $(libmingwthrd_a_OBJECTS)
787         $(RANLIB) $@
788
789 libmingwthrd_old.a: $(libmingwthrd_a_OBJECTS) mingwm10.dll mingwthrd.def
790         $(DLLTOOL) $(DLLTOOL_FLAGS) mingwm10.dll \
791           --def mingwthrd.def --output-lib $@
792         $(AR) rc $@ $(libmingwthrd_a_OBJECTS)
793         $(RANLIB) $@
794
795 libgmon.a: $(libgmon_a_OBJECTS)
796         $(AR) rc $@ $(libgmon_a_OBJECTS)
797         $(RANLIB) $@
798
799 libuuid.a: $(libuuid_a_OBJECTS)
800         $(AR) rc $@ $(libuuid_a_OBJECTS)
801         $(RANLIB) $@
802
803 libscrnsave.a: $(libscrnsave_a_OBJECTS)
804         $(AR) rc $@ $(libscrnsave_a_OBJECTS)
805         $(RANLIB) $@
806
807 libscrnsavw.a: $(libscrnsavw_a_OBJECTS)
808         $(AR) rc $@ $(libscrnsavw_a_OBJECTS)
809         $(RANLIB) $@
810
811 liblargeint.a: $(liblargeint_a_OBJECTS)
812         $(AR) rc $@ $(liblargeint_a_OBJECTS)
813         $(RANLIB) $@
814
815 libdinput.a libdinput8.a: $(libdinput_a_OBJECTS)
816         $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/directx/,$(subst lib,,$(@:.a=.def))) --output-lib $@
817         $(AR) rc $@ $(libdinput_a_OBJECTS)
818         $(RANLIB) $@
819
820 $(libdinput_a_OBJECTS) : $(libdinput_a_SOURCES)
821 $(libdmoguids_a_OBJECTS) : $(libdmoguids_a_SOURCES)
822 $(libdxguid_a_OBJECTS) : $(libdxguid_a_SOURCES)
823 $(libstrmiids_a_OBJECTS) : $(libstrmiids_a_SOURCES)
824 $(libws2_32_a_OBJECTS) : $(libws2_32_a_SOURCES)
825         $(MKDIR_P) $(@D)
826         $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -o $@ $<
827
828 libdxerr8.a: $(libdxerr8_a_OBJECTS)
829         $(AR) rc $@ $(libdxerr8_a_OBJECTS)
830         $(RANLIB) $@
831
832 libdxerr9.a: $(libdxerr9_a_OBJECTS)
833         $(AR) rc $@ $(libdxerr9_a_OBJECTS)
834         $(RANLIB) $@
835
836 libdmoguids.a: $(libdmoguids_a_OBJECTS)
837         $(AR) rc $@ $(libdmoguids_a_OBJECTS)
838         $(RANLIB) $@
839
840 libdxguid.a: $(libdxguid_a_OBJECTS)
841         $(AR) rc $@ $(libdxguid_a_OBJECTS)
842         $(RANLIB) $@
843
844 libstrmiids.a: $(libstrmiids_a_OBJECTS)
845         $(AR) rc $@ $(libstrmiids_a_OBJECTS)
846         $(RANLIB) $@
847
848 # Note this target will override the previous global rules and give a warning
849 # from the make process. It is needed due to the extra ws2_32.o object file.
850 libws2_32.a: lib/lib32/ws2_32.def $(libws2_32_a_OBJECTS)
851         @echo Making library $@ from $(subst lib,,$(@:.a=.def)).
852         $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/,$(subst lib,,$(@:.a=.def))) --output-lib $@
853         $(AR) rc $@ $(libws2_32_a_OBJECTS)
854         $(RANLIB) $@
855
856 # Note this target will override the previous global rules and give a warning
857 # from the make process. It is needed due to the extra shell32.o object file.
858 libshell32.a: lib/lib32/shell32.def $(libshell32_a_OBJECTS)
859         @echo Making library $@ from $(subst lib,,$(@:.a=.def)).
860         $(DLLTOOL) $(DLLTOOL_FLAGS) $(subst lib,,$(@:.a=.dll)) --def $(addprefix $(top_srcdir)/lib/lib32/,$(subst lib,,$(@:.a=.def))) --output-lib $@
861         $(AR) rc $@ $(libshell32_a_OBJECTS)
862         $(RANLIB) $@
863
864 _libm_dummy.c:
865         @echo "static int __mingw_libm_dummy;" > _libm_dummy.c
866
867 libm.a: _libm_dummy.o
868         $(AR) rc $@ _libm_dummy.o
869         $(RANLIB) $@
870
871 mingwthrd.def: $(mingwm10_dll_OBJECTS)
872         $(DLLTOOL) --as $(AS) --output-def mingwthrd.def $(mingwm10_dll_OBJECTS)
873
874 mingwm10.dll: $(mingwm10_dll_OBJECTS) mingwthrd.def libmingwex.a
875         $(CC) $(mingwm10_dll_FLAGS) $(mingwm10_dll_OBJECTS) mingwthrd.def \
876           -o mingwm10.dll -L .
877
878 clean:
879         rm -f *.def *.s *.o *.dll *.a _libm_dummy.c stamp*
880         rm -rf .deps/ src/ misc/
881         cd tests && $(MAKE) $@
882
883 distclean: clean
884         rm -f config.log config.status config.cache config.h
885         rm -f core a.out *~ Makefile
886         rm -rf dist/
887         cd tests && $(MAKE) $@
888
889 need-DESTDIR-compatibility := prefix bindir includedir libdir mandir
890
891 $(need-DESTDIR-compatibility):
892         @test -z "$(DESTDIR)" || case "$($@)" in ?:*) \
893           $(MAKE) --no-print-directory REJECT="$@" \
894             fail-DESTDIR-compatibility ;; \
895         esac
896
897 fail-DESTDIR-compatibility:
898         $(error DESTDIR is not supported when $(REJECT) contains a Windows \
899         path '$($(REJECT))'; \
900         try 'make install $(REJECT)=$(shell echo '$($(REJECT))' | \
901         sed s,:,:$(DESTDIR),) ...' instead)
902
903 check:
904         cd tests && $(MAKE) $@
905
906 install-dirs: $(need-DESTDIR-compatibility)
907         $(mkinstalldirs) $(DESTDIR)$(bindir)
908         $(mkinstalldirs) $(DESTDIR)$(libdir)
909         $(mkinstalldirs) $(DESTDIR)$(docdir)
910         $(mkinstalldirs) $(DESTDIR)$(docdir)/historical
911         $(mkinstalldirs) $(DESTDIR)$(docdir)/historical/mingw
912         $(mkinstalldirs) $(DESTDIR)$(docdir)/historical/mingw/man
913         $(mkinstalldirs) $(DESTDIR)$(docdir)/historical/w32api
914         $(mkinstalldirs) $(DESTDIR)$(includedir)
915         for I in `find $(top_srcdir)/include/* -type d`; do \
916           J=`basename $$I`; \
917           $(mkinstalldirs) $(DESTDIR)$(includedir)/$$J ; \
918         done
919
920 install-libs: all
921         for LIB in $(lib_LIBRARIES); do \
922           $(INSTALL_DATA) $$LIB $(DESTDIR)$(libdir)/$$LIB ; \
923         done
924
925 install-objs: all
926         for OBJ in $(lib_OBJECTS); do \
927           $(INSTALL_DATA) $$OBJ $(DESTDIR)$(libdir) ; \
928         done
929
930 install-docs:
931         for DOC in $(doc_DOCUMENTS); do \
932           $(INSTALL_DATA) $(top_srcdir)/$$DOC $(DESTDIR)$(docdir)/$$DOC ; \
933         done
934         cp -af $(top_srcdir)/doc/historical $(DESTDIR)$(docdir) ;
935
936 install-includes:
937         for INC in $(top_srcdir)/include/*.h; do \
938           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir) ; \
939         done
940         for I in `find $(top_srcdir)/include/* -type d`; do \
941           J=`basename $$I`; \
942           for INC in $$I/*.h; do \
943             $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/$$J ; \
944           done \
945         done
946
947 install-bins: all
948         for BIN in $(bin_LIBRARIES); do \
949           $(INSTALL_DATA) $$BIN $(DESTDIR)$(bindir)/$$BIN ; \
950         done
951
952 install: all \
953   install-dirs \
954   install-libs \
955   install-objs \
956   install-docs \
957   install-includes \
958   install-bins
959
960 install-mingwrt-dirs: $(need-DESTDIR-compatibility)
961         $(mkinstalldirs) $(DESTDIR)$(bindir)
962         $(mkinstalldirs) $(DESTDIR)$(libdir)
963         $(mkinstalldirs) $(DESTDIR)$(mingwrtdocdir)
964         $(mkinstalldirs) $(DESTDIR)$(mingwrtdocdir)/historical
965         rmdir $(DESTDIR)$(mingwrtdocdir)/../mingw-org-wsl
966         $(mkinstalldirs) $(DESTDIR)$(includedir)
967         $(mkinstalldirs) $(DESTDIR)$(includedir)/sys
968
969 mingwrt_bin_LIBRARIES := mingwm10.dll
970 mingwrt_lib_INCLUDES := \
971   _mingw.h   dirent.h  glob.h      getopt.h    math.h    setjmp.h  strings.h \
972   assert.h   dos.h     inttypes.h  mbctype.h   share.h   wchar.h   varargs.h \
973   complex.h  errno.h   io.h        mbstring.h  signal.h  tchar.h   wctype.h \
974   conio.h    excpt.h   libgen.h    mem.h       stdint.h  time.h \
975   ctype.h    fcntl.h   limits.h    memory.h    stdio.h   unistd.h \
976   dir.h      fenv.h    locale.h    process.h   stdlib.h  utime.h \
977   direct.h   float.h   malloc.h    search.h    string.h  values.h
978
979 mingwrt_lib_SYS_INCLUDES := \
980   fcntl.h  locking.h  stat.h  timeb.h  unistd.h \
981   file.h   param.h    time.h  types.h  utime.h
982
983
984 install-mingwrt: install-mingwrt-dirs
985         for BIN in $(mingwrt_bin_LIBRARIES); do \
986           $(INSTALL_DATA) $$BIN $(DESTDIR)$(bindir)/ ; \
987         done
988         for INC in $(addprefix $(top_srcdir)/include/,$(mingwrt_lib_INCLUDES)); do \
989           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/ ; \
990         done
991         for INC in $(addprefix $(top_srcdir)/include/sys/,$(mingwrt_lib_SYS_INCLUDES)); do \
992           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/sys/ ; \
993         done
994         for LIB in $(mingwrt_lib_LIBRARIES); do \
995           $(INSTALL_DATA) $$LIB $(DESTDIR)$(libdir)/ ; \
996         done
997         for OBJ in $(mingwrt_lib_OBJECTS); do \
998           $(INSTALL_DATA) $$OBJ $(DESTDIR)$(libdir)/ ; \
999         done
1000         cp -af $(top_srcdir)/doc/historical/mingw/* $(DESTDIR)$(mingwrtdocdir)/historical/ ;
1001
1002 dist: all dist-mingwrt dist-w32api dist-wsl
1003
1004 dist-mingwrt:
1005         $(MAKE) prefix=./dist/mingwrt/installed _dist-mingwrt-all_
1006
1007 _dist-mingwrt-all_: all dist-mingwrt-dll dist-mingwrt-dev dist-mingwrt-lic dist-mingwrt-doc dist-mingwrt-src
1008
1009 dist-mingwrt-mkdir:
1010         $(MKDIR_P) ./dist/mingwrt/packages
1011
1012 dist-mingwrt-install: all
1013         $(MAKE) prefix=./dist/mingwrt/installed install-mingwrt
1014
1015 dist-mingwrt-dll: dist-mingwrt-mkdir dist-mingwrt-install
1016 ifeq ($(RELEASE_STATUS),prod)
1017         cd ./dist/mingwrt/installed ; \
1018         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-dll.tar.lzma bin/*.dll
1019 else
1020         cd ./dist/mingwrt/installed ; \
1021         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-dll.tar.lzma bin/*.dll
1022 endif
1023
1024 dist-mingwrt-dev: dist-mingwrt-mkdir dist-mingwrt-install
1025 ifeq ($(RELEASE_STATUS),prod)
1026         cd ./dist/mingwrt/installed ; \
1027         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-dev.tar.lzma include/ lib/
1028 else
1029         cd ./dist/mingwrt/installed ; \
1030         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-dev.tar.lzma include/ lib/
1031 endif
1032
1033 $(DESTDIR)$(mingwrtdocdir)/LICENSE: dist-mingwrt-mkdir dist-mingwrt-install
1034         cp $(top_srcdir)/LICENSE $(DESTDIR)$(mingwrtdocdir)
1035
1036 dist-mingwrt-lic: $(DESTDIR)$(mingwrtdocdir)/LICENSE
1037 ifeq ($(RELEASE_STATUS),prod)
1038         cd ./dist/mingwrt/installed ; \
1039         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-lic.tar.lzma share/doc/mingwrt/LICENSE
1040 else
1041         cd ./dist/mingwrt/installed ; \
1042         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-lic.tar.lzma share/doc/mingwrt/LICENSE
1043 endif
1044
1045 dist-mingwrt-doc: dist-mingwrt-install
1046 ifeq ($(RELEASE_STATUS),prod)
1047         for DOC in $(doc_DOCUMENTS); do \
1048           $(INSTALL) $(INSTALL_FLAGS) $(top_srcdir)/$$DOC $(DESTDIR)$(mingwrtdocdir)/$$DOC ; \
1049         done
1050         cd ./dist/mingwrt/installed ; \
1051         rm -f share/doc/mingwrt/LICENSE ; \
1052         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-doc.tar.lzma share/doc/mingwrt
1053 else
1054         for DOC in $(doc_DOCUMENTS); do \
1055           $(INSTALL) $(INSTALL_FLAGS) $(top_srcdir)/$$DOC $(DESTDIR)$(mingwrtdocdir)/$$DOC ; \
1056         done
1057         cd ./dist/mingwrt/installed ; \
1058         rm -f share/doc/mingwrt/LICENSE ; \
1059         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-doc.tar.lzma share/doc/mingwrt
1060 endif
1061
1062 dist-mingwrt-src:
1063 ifeq ($(RELEASE_STATUS),prod)
1064         cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw.org-wsl
1065         cd $(DESTDIR)$(prefix)/mingw.org-wsl ; \
1066         rm -rf .git autom4te.cache ; \
1067         rm -f config.log config.status config.cache config.h ; \
1068         rm -f .gitignore core a.out Makefile ; \
1069         find . -type f -name \*~ -delete ; \
1070         find . -type f -name \*.log -delete ; \
1071         find . -type f -name \*.bak -delete ; \
1072         find . -type f -name .\*.swp -delete ; \
1073         cd .. ; \
1074         rm -rf mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src ; \
1075         mv mingw.org-wsl mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src ; \
1076         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src.tar.lzma mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src
1077 else
1078         cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw.org-wsl
1079         cd $(DESTDIR)$(prefix)/mingw.org-wsl ; \
1080         rm -rf .git autom4te.cache ; \
1081         rm -f config.log config.status config.cache config.h ; \
1082         rm -f .gitignore core a.out Makefile ; \
1083         find . -type f -name \*~ -delete ; \
1084         find . -type f -name \*.log -delete ; \
1085         find . -type f -name \*.bak -delete ; \
1086         find . -type f -name .\*.swp -delete ; \
1087         cd .. ; \
1088         rm -rf mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src ; \
1089         mv mingw.org-wsl mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src ; \
1090         tar acf ../packages/mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src.tar.lzma mingwrt-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src
1091 endif
1092
1093 install-w32api-dirs: $(need-DESTDIR-compatibility)
1094         $(mkinstalldirs) $(DESTDIR)$(bindir)
1095         $(mkinstalldirs) $(DESTDIR)$(libdir)
1096         $(mkinstalldirs) $(DESTDIR)$(w32apidocdir)
1097         $(mkinstalldirs) $(DESTDIR)$(w32apidocdir)/historical
1098         rmdir $(DESTDIR)$(w32apidocdir)/../mingw-org-wsl
1099         $(mkinstalldirs) $(DESTDIR)$(includedir)
1100         $(mkinstalldirs) $(DESTDIR)$(includedir)/ddk
1101         $(mkinstalldirs) $(DESTDIR)$(includedir)/gdiplus
1102         $(mkinstalldirs) $(DESTDIR)$(includedir)/GL
1103
1104 w32api_lib_INCLUDES := \
1105   accctrl.h aclapi.h aclui.h adsprop.h afxres.h audevcod.h aviriff.h \
1106   aygshell.h basetsd.h basetyps.h bdatypes.h cderr.h cguid.h cmnquery.h \
1107   comcat.h commctrl.h commdlg.h control.h cpl.h cplext.h custcntl.h \
1108   dbt.h dde.h ddeml.h devguid.h dhcpcsdk.h dlgs.h \
1109   docobj.h dsadmin.h dsclient.h dsgetdc.h dshow.h dsquery.h dsrole.h \
1110   dvdevcod.h dvdmedia.h edevdefs.h errorrep.h errors.h \
1111   evcode.h exdisp.h exdispid.h fltdefs.h gdiplus.h httpext.h icm.h idispids.h \
1112   il21dec.h imagehlp.h imm.h initguid.h intshcut.h ipexport.h iphlpapi.h \
1113   ipifcons.h ipinfoid.h iprtrmib.h iptypes.h ipxconst.h ipxrtdef.h ipxtfflt.h \
1114   isguids.h ks.h ksmedia.h largeint.h lm.h lmaccess.h lmalert.h lmapibuf.h \
1115   lmat.h lmaudit.h lmbrowsr.h lmchdev.h lmconfig.h lmcons.h lmerr.h lmerrlog.h \
1116   lmmsg.h lmremutl.h lmrepl.h lmserver.h lmshare.h lmsname.h lmstats.h lmsvc.h \
1117   lmuse.h lmuseflg.h lmwksta.h lzexpand.h mapi.h mciavi.h mcx.h mgm.h \
1118   mgmtapi.h mlang.h mmreg.h mmsystem.h mpegtype.h mprapi.h mq.h msacm.h \
1119   mshtml.h mswsock.h nb30.h nddeapi.h nspapi.h ntdef.h ntdll.h ntdsapi.h \
1120   ntdsbcli.h ntldap.h ntsecapi.h ntsecpkg.h oaidl.h objbase.h objfwd.h \
1121   objidl.h objsafe.h objsel.h ocidl.h odbcinst.h ole.h ole2.h ole2ver.h \
1122   oleacc.h oleauto.h olectl.h olectlid.h oledlg.h oleidl.h pbt.h poppack.h \
1123   powrprof.h prsht.h psapi.h pshpack1.h pshpack2.h pshpack4.h pshpack8.h \
1124   qedit.h rapi.h ras.h rasdlg.h raserror.h rassapi.h reason.h regstr.h \
1125   richedit.h richole.h routprot.h rpc.h rpcdce.h rpcdce2.h rpcdcep.h rpcndr.h \
1126   rpcnsi.h rpcnsip.h rpcnterr.h rpcproxy.h rtutils.h schannel.h schnlsp.h \
1127   scrnsave.h sddl.h sdkddkver.h secext.h security.h servprov.h setupapi.h \
1128   shellapi.h shldisp.h shlguid.h shlobj.h shlwapi.h shobjidl.h snmp.h \
1129   specstrings.h sql.h sqlext.h sqltypes.h sqlucode.h sspi.h stm.h strmif.h \
1130   subauth.h svcguid.h tlhelp32.h tmschema.h unknwn.h userenv.h usp10.h \
1131   uxtheme.h vfw.h vidcap.h vmr9.h vptype.h w32api.h winable.h winbase.h \
1132   winber.h wincon.h wincrypt.h windef.h windns.h windows.h windowsx.h \
1133   winerror.h wingdi.h wininet.h winioctl.h winldap.h winnetwk.h winnls.h \
1134   winnt.h winperf.h winreg.h winresrc.h winsnmp.h winsock.h winsock2.h \
1135   winspool.h winsvc.h winuser.h winver.h ws2spi.h ws2tcpip.h wsahelp.h wsipx.h \
1136   wsnetbs.h wtsapi32.h wtypes.h xprtdefs.h zmouse.h
1137
1138 w32api_lib_DDK_INCLUDES := \
1139   atm.h batclass.h cfg.h cfgmgr32.h d4drvif.h d4iface.h ddkmapi.h hidclass.h \
1140   hidpi.h hidsdi.h hidusage.h kbdmou.h mcd.h miniport.h minitape.h mountdev.h \
1141   mountmgr.h ndis.h ndisguid.h ndistapi.h ndiswan.h netevent.h netpnp.h \
1142   newdev.h ntapi.h ntdd8042.h ntddbeep.h ntddcdrm.h ntddcdvd.h ntddchgr.h \
1143   ntdddisk.h ntddk.h ntddkbd.h ntddmou.h ntddndis.h ntddpar.h ntddpcm.h \
1144   ntddscsi.h ntddser.h ntddstor.h ntddtape.h ntddtdi.h ntddvdeo.h ntddvol.h \
1145   ntifs.h ntpoapi.h ntstatus.h parallel.h pfhook.h poclass.h scsi.h scsiscan.h \
1146   scsiwmi.h smbus.h srb.h storport.h tdi.h tdiinfo.h tdikrnl.h tdistat.h \
1147   tvout.h upssvc.h usb.h usb100.h usbcamdi.h usbdi.h usbioctl.h usbiodef.h \
1148   usbscan.h usbuser.h video.h videoagp.h win2k.h winddi.h winddk.h winnt4.h \
1149   winxp.h ws2san.h xfilter.h
1150
1151 w32api_lib_GDIPLUS_INCLUDES := \
1152   gdiplus.h gdiplusbase.h gdiplusbrush.h gdipluscolor.h gdipluscolormatrix.h \
1153   gdipluseffects.h gdiplusenums.h gdiplusflat.h gdiplusgpstubs.h \
1154   gdiplusgraphics.h gdiplusheaders.h gdiplusimageattributes.h \
1155   gdiplusimagecodec.h gdiplusimaging.h gdiplusimpl.h gdiplusinit.h \
1156   gdipluslinecaps.h gdiplusmatrix.h gdiplusmem.h gdiplusmetafile.h \
1157   gdiplusmetaheader.h gdipluspath.h gdipluspen.h gdipluspixelformats.h \
1158   gdiplusstringformat.h gdiplustypes.h
1159
1160 w32api_lib_GL_INCLUDES := gl.h glext.h glu.h
1161
1162 w32api_lib_DIRECTX_INCLUDES := d3d9.h d3d9caps.h d3d9types.h dxerr8.h dxerr9.h
1163
1164 w32api_lib_LIBRARIES := \
1165   libaclui.a libadvapi32.a libapcups.a libavicap32.a libavifil32.a \
1166   libbthprops.a libcap.a libcfgmgr32.a libcomctl32.a libcomdlg32.a \
1167   libcrypt32.a libctl3d32.a libd3d8.a libd3d9.a libd3dim.a libd3drm.a \
1168   libd3dx8d.a libd3dx9d.a libd3dxof.a libddraw.a libdhcpcsvc.a libdinput.a \
1169   libdinput8.a libdlcapi.a libdmoguids.a libdnsapi.a libdplayx.a libdpnaddr.a \
1170   libdpnet.a libdpnlobby.a libdpvoice.a libdsetup.a libdsound.a libdxapi.a \
1171   libdxerr8.a libdxerr9.a libdxguid.a libfaultrep.a libgdi32.a libgdiplus.a \
1172   libglaux.a libglu32.a libhal.a libhid.a libhidparse.a libicmui.a \
1173   libigmpagnt.a libimagehlp.a libimm32.a libiphlpapi.a libkernel32.a \
1174   libksproxy.a libksuser.a liblargeint.a liblz32.a libmapi32.a libmcd.a \
1175   libmfcuia32.a libmgmtapi.a libmpr.a libmprapi.a libmqrt.a libmsacm32.a \
1176   libmscms.a libmsdmo.a libmsimg32.a libmsvcp60.a libmsvfw32.a libmswsock.a \
1177   libnddeapi.a libndis.a libnetapi32.a libnewdev.a libntdll.a libntoskrnl.a \
1178   libodbc32.a libodbccp32.a libole32.a liboleacc.a liboleaut32.a libolecli32.a \
1179   liboledlg.a libolepro32.a libolesvr32.a libopengl32.a libpenwin32.a \
1180   libpkpd32.a libpowrprof.a libpsapi.a libquartz.a librapi.a librasapi32.a \
1181   librasdlg.a librpcdce4.a librpcns4.a librpcrt4.a librtm.a librtutils.a \
1182   libscrnsave.a libscrnsavw.a libscsiport.a libsecur32.a libsetupapi.a \
1183   libshell32.a libshfolder.a libshlwapi.a libsnmpapi.a libstrmiids.a \
1184   libsvrapi.a libtapi32.a libtdi.a libthunk32.a liburl.a libusbcamd.a \
1185   libusbcamd2.a libuser32.a libuserenv.a libusp10.a libuuid.a libuxtheme.a \
1186   libvdmdbg.a libversion.a libvfw32.a libvideoprt.a libwin32k.a libwin32spl.a \
1187   libwininet.a libwinmm.a libwinspool.a libwinstrm.a libwldap32.a libwow32.a \
1188   libws2_32.a libwsnmp32.a libwsock32.a libwst.a libwtsapi32.a
1189
1190 install-w32api: install-w32api-dirs
1191         for INC in $(addprefix $(top_srcdir)/include/,$(w32api_lib_INCLUDES)); do \
1192           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/ ; \
1193         done
1194         for INC in $(addprefix $(top_srcdir)/include/ddk/,$(w32api_lib_DDK_INCLUDES)); do \
1195           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/ddk/ ; \
1196         done
1197         for INC in $(addprefix $(top_srcdir)/include/gdiplus/,$(w32api_lib_GDIPLUS_INCLUDES)); do \
1198           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/gdiplus/ ; \
1199         done
1200         for INC in $(addprefix $(top_srcdir)/misc/include/GL/,$(w32api_lib_GL_INCLUDES)); do \
1201           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/GL/ ; \
1202         done
1203         for INC in $(addprefix $(top_srcdir)/include/directx/,$(w32api_lib_DIRECTX_INCLUDES)); do \
1204           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir) ; \
1205         done
1206         for LIB in $(w32api_lib_LIBRARIES); do \
1207           $(INSTALL_DATA) $$LIB $(DESTDIR)$(libdir)/ ; \
1208         done
1209         cp -af $(top_srcdir)/doc/historical/w32api/* $(DESTDIR)$(w32apidocdir)/historical/ ;
1210
1211 dist-w32api:
1212         $(MAKE) prefix=./dist/w32api/installed _dist-w32api-all_
1213
1214 _dist-w32api-all_: all dist-w32api-dev dist-w32api-lic dist-w32api-doc dist-w32api-src
1215
1216 dist-w32api-mkdir:
1217         $(MKDIR_P) ./dist/w32api/packages
1218
1219 dist-w32api-install: all dist-w32api-mkdir
1220         $(MAKE) prefix=./dist/w32api/installed install-w32api
1221
1222 dist-w32api-dev: dist-w32api-install
1223 ifeq ($(RELEASE_STATUS),prod)
1224         cd ./dist/w32api/installed ; \
1225         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-dev.tar.lzma include/ lib/
1226 else
1227         cd ./dist/w32api/installed ; \
1228         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-dev.tar.lzma include/ lib/
1229 endif
1230
1231 $(DESTDIR)$(w32apidocdir)/LICENSE: dist-w32api-mkdir dist-w32api-install
1232         cp $(top_srcdir)/LICENSE $(DESTDIR)$(w32apidocdir)
1233
1234 dist-w32api-lic: $(DESTDIR)$(w32apidocdir)/LICENSE
1235 ifeq ($(RELEASE_STATUS),prod)
1236         cd ./dist/w32api/installed ; \
1237         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-lic.tar.lzma share/doc/w32api/LICENSE
1238 else
1239         cd ./dist/w32api/installed ; \
1240         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-lic.tar.lzma share/doc/w32api/LICENSE
1241 endif
1242
1243 dist-w32api-doc: dist-w32api-install
1244 ifeq ($(RELEASE_STATUS),prod)
1245         for DOC in $(doc_DOCUMENTS); do \
1246           $(INSTALL) $(INSTALL_FLAGS) $(top_srcdir)/$$DOC $(DESTDIR)$(w32apidocdir)/$$DOC ; \
1247         done
1248         cd ./dist/w32api/installed ; \
1249         rm -f share/doc/w32api/LICENSE ; \
1250         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-doc.tar.lzma share/doc/w32api
1251 else
1252         for DOC in $(doc_DOCUMENTS); do \
1253           $(INSTALL) $(INSTALL_FLAGS) $(top_srcdir)/$$DOC $(DESTDIR)$(w32apidocdir)/$$DOC ; \
1254         done
1255         cd ./dist/w32api/installed ; \
1256         rm -f share/doc/w32api/LICENSE ; \
1257         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-doc.tar.lzma share/doc/w32api
1258 endif
1259
1260 dist-w32api-src:
1261 ifeq ($(RELEASE_STATUS),prod)
1262         cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw.org-wsl
1263         cd $(DESTDIR)$(prefix)/mingw.org-wsl ; \
1264         rm -rf .git autom4te.cache ; \
1265         rm -f config.log config.status config.cache config.h ; \
1266         rm -f .gitignore core a.out Makefile ; \
1267         find . -type f -name \*~ -delete ; \
1268         find . -type f -name \*.log -delete ; \
1269         find . -type f -name \*.bak -delete ; \
1270         find . -type f -name .\*.swp -delete ; \
1271         cd .. ; \
1272         rm -rf w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src ; \
1273         mv mingw.org-wsl w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src ; \
1274         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src.tar.lzma w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src
1275 else
1276         cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw.org-wsl
1277         cd $(DESTDIR)$(prefix)/mingw.org-wsl ; \
1278         rm -rf .git autom4te.cache ; \
1279         rm -f config.log config.status config.cache config.h ; \
1280         rm -f .gitignore core a.out Makefile ; \
1281         find . -type f -name \*~ -delete ; \
1282         find . -type f -name \*.log -delete ; \
1283         find . -type f -name \*.bak -delete ; \
1284         find . -type f -name .\*.swp -delete ; \
1285         cd .. ; \
1286         rm -rf w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src ; \
1287         mv mingw.org-wsl w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src ; \
1288         tar acf ../packages/w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src.tar.lzma w32api-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src
1289 endif
1290
1291 install-wsl-dirs: $(need-DESTDIR-compatibility)
1292         $(mkinstalldirs) $(DESTDIR)$(bindir)
1293         $(mkinstalldirs) $(DESTDIR)$(libdir)
1294         $(mkinstalldirs) $(DESTDIR)$(docdir)
1295         $(mkinstalldirs) $(DESTDIR)$(docdir)/historical
1296         $(mkinstalldirs) $(DESTDIR)$(includedir)
1297         $(mkinstalldirs) $(DESTDIR)$(includedir)/sys
1298         $(mkinstalldirs) $(DESTDIR)$(includedir)/ddk
1299         $(mkinstalldirs) $(DESTDIR)$(includedir)/gdiplus
1300         $(mkinstalldirs) $(DESTDIR)$(includedir)/GL
1301
1302 install-wsl: install-wsl-dirs
1303         for BIN in $(mingwrt_bin_LIBRARIES); do \
1304           $(INSTALL_DATA) $$BIN $(DESTDIR)$(bindir)/ ; \
1305         done
1306         for INC in $(addprefix $(top_srcdir)/include/,$(mingwrt_lib_INCLUDES)); do \
1307           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/ ; \
1308         done
1309         for INC in $(addprefix $(top_srcdir)/include/sys/,$(mingwrt_lib_SYS_INCLUDES)); do \
1310           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/sys/ ; \
1311         done
1312         for INC in $(addprefix $(top_srcdir)/include/,$(w32api_lib_INCLUDES)); do \
1313           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/ ; \
1314         done
1315         for INC in $(addprefix $(top_srcdir)/include/ddk/,$(w32api_lib_DDK_INCLUDES)); do \
1316           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/ddk/ ; \
1317         done
1318         for INC in $(addprefix $(top_srcdir)/include/gdiplus/,$(w32api_lib_GDIPLUS_INCLUDES)); do \
1319           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/gdiplus/ ; \
1320         done
1321         for INC in $(addprefix $(top_srcdir)/misc/include/GL/,$(w32api_lib_GL_INCLUDES)); do \
1322           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/GL/ ; \
1323         done
1324         for INC in $(addprefix $(top_srcdir)/include/directx/,$(w32api_lib_DIRECTX_INCLUDES)); do \
1325           $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir) ; \
1326         done
1327         for LIB in $(mingwrt_lib_LIBRARIES) $(w32api_lib_LIBRARIES); do \
1328           $(INSTALL_DATA) $$LIB $(DESTDIR)$(libdir)/ ; \
1329         done
1330         for OBJ in $(mingwrt_lib_OBJECTS); do \
1331           $(INSTALL_DATA) $$OBJ $(DESTDIR)$(libdir)/ ; \
1332         done
1333         cp -af $(top_srcdir)/LICENSE $(DESTDIR)$(docdir)
1334         cp -af $(top_srcdir)/README $(DESTDIR)$(docdir)
1335         cp -af $(top_srcdir)/doc/historical/* $(DESTDIR)$(docdir)/historical
1336
1337 dist-wsl:
1338         $(MAKE) prefix=./dist/wsl/installed _dist-wsl-all_
1339
1340 _dist-wsl-all_: all dist-wsl-dll dist-wsl-dev dist-wsl-doc dist-wsl-lic dist-wsl-src
1341
1342 dist-wsl-mkdir:
1343         $(MKDIR_P) ./dist/wsl/packages
1344
1345 dist-wsl-install: all dist-wsl-mkdir
1346         $(MAKE) prefix=./dist/wsl/installed install-wsl
1347
1348 dist-wsl-dll: dist-wsl-install
1349 ifeq ($(RELEASE_STATUS),prod)
1350         cd ./dist/wsl/installed ; \
1351         tar acf ../packages/mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-dll.tar.lzma bin/*.dll ;
1352 else
1353         cd ./dist/wsl/installed ; \
1354         tar acf ../packages/$(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-dll.tar.lzma bin/*.dll ;
1355 endif
1356
1357 dist-wsl-dev: dist-wsl-install
1358 ifeq ($(RELEASE_STATUS),prod)
1359         cd ./dist/wsl/installed ; \
1360         tar acf ../packages/$(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-dev.tar.lzma include/ lib/
1361 else
1362         cd ./dist/wsl/installed ; \
1363         tar acf ../packages/$(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-dev.tar.lzma include/ lib/
1364 endif
1365
1366 dist-wsl-lic: dist-wsl-install
1367 ifeq ($(RELEASE_STATUS),prod)
1368         cd ./dist/wsl/installed ; \
1369         tar acf ../packages/mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-lic.tar.lzma share/doc/mingw.org-wsl/LICENSE
1370 else
1371         cd ./dist/wsl/installed ; \
1372         tar acf ../packages/$(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-lic.tar.lzma share/doc/mingw.org-wsl/LICENSE
1373 endif
1374
1375 dist-wsl-doc: dist-wsl-install
1376 ifeq ($(RELEASE_STATUS),prod)
1377         cd ./dist/wsl/installed ; \
1378         tar acf ../packages/mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-doc.tar.lzma share/doc/mingw.org-wsl/README
1379 else
1380         cd ./dist/wsl/installed ; \
1381         tar acf ../packages/$(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-doc.tar.lzma share/doc/mingw.org-wsl/README
1382 endif
1383
1384 dist-wsl-src: dist-wsl-install
1385 ifeq ($(RELEASE_STATUS),prod)
1386         cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw.org-wsl
1387         cd $(DESTDIR)$(prefix)/mingw.org-wsl ; \
1388         rm -rf .git autom4te.cache ; \
1389         rm -f config.log config.status config.cache config.h ; \
1390         rm -f .gitignore core a.out Makefile ; \
1391         find . -type f -name \*~ -delete ; \
1392         find . -type f -name \*.log -delete ; \
1393         find . -type f -name \*.bak -delete ; \
1394         find . -type f -name .\*.swp -delete ; \
1395         cd .. ; \
1396         rm -rf mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src ; \
1397         mv mingw.org-wsl mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src ; \
1398         tar acf ../packages/mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src.tar.lzma mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-src
1399 else
1400         cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw.org-wsl
1401         cd $(DESTDIR)$(prefix)/mingw.org-wsl ; \
1402         rm -rf .git autom4te.cache ; \
1403         rm -f config.log config.status config.cache config.h ; \
1404         rm -f .gitignore core a.out Makefile ; \
1405         find . -type f -name \*~ -delete ; \
1406         find . -type f -name \*.log -delete ; \
1407         find . -type f -name \*.bak -delete ; \
1408         find . -type f -name .\*.swp -delete ; \
1409         cd .. ; \
1410         rm -rf $(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src ; \
1411         mv mingw.org-wsl $(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src ; \
1412         tar acf ../packages/$(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src.tar.lzma $(RELEASE_STATUS)_mingw.org-wsl-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE)-mingw32-$(RELEASE_STATUS)-$(RELEASE_REFERENCE)-src
1413 endif
1414
1415 clean-dist: clean-dist-mingwrt clean-dist-w32api clean-dist-wsl
1416         rm -rf dist/
1417
1418 clean-dist-mingwrt:
1419         rm -rf dist/mingwrt/
1420
1421 clean-dist-w32api:
1422         rm -rf dist/w32api/
1423
1424 clean-dist-wsl:
1425         rm -rf dist/wsl/