OSDN Git Service

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