OSDN Git Service

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