OSDN Git Service

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