OSDN Git Service

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