OSDN Git Service

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