Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / external / mingwheaders / makefile.mk
blob0e74daa1de452982161236cd06ff8d4c2b9f33e0
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 PRJ=..
29 PRJNAME=external
30 TARGET=mingwheaders
32 .INCLUDE : settings.mk
34 .IF "$(OS)$(COM)" == "WNTGCC"
36 .IF "$(CROSS_COMPILING)" != "YES"
38 # Don't do any of this for now. We support WNTGCC (MinGW) only as
39 # cross-compiler. It is dubious whether it would be legal to copy
40 # stuff from the Windows SDK to a cross-compilation build host
41 # anyway. Some headers and/or import libraries missing in MinGW (or
42 # mingw-w64 actually) we have copied from Wine in ../wine.
44 MINGW_INCLUDE_DIR=$(COMPATH)$/include/
45 MINGW_W32API_INCLUDE_DIR=$(COMPATH)$/include/
46 MINGW_W32API_LIB_DIR=$(COMPATH)$/lib/
48 SYS_INCLUDE_DIR=$(MINGW_INCLUDE_DIR)$/sys/
50 PSDK_INCLUDE_DIR=$(PSDK_HOME)$/include$/
52 ATL_INCLUDE_DIR=$(PSDK_HOME)$/include$/atl$/
54 DIRECTXSDK_INCLUDE_DIR=$(DIRECTXSDK_HOME)$/include$/
56 FILES_TO_COPY_FROM_MINGW= \
57 excpt.h \
58 tchar.h
60 FILES_TO_COPY_FROM_W32API= \
61 amvideo.h \
62 basetyps.h \
63 objidl.h \
64 specstrings.h \
65 uxtheme.h \
66 winbase.h \
67 windef.h \
68 wininet.h \
69 winver.h \
70 wtypes.h
72 FILES_TO_COPY_FROM_SYS= \
73 stat.h
75 FILES_TO_COPY_FROM_PSDK= \
76 adoctint.h \
77 adodef.h \
78 adoguids.h \
79 adoint.h \
80 bcrypt.h \
81 commctrl.h \
82 control.h \
83 dispex.h \
84 filter.h \
85 gdiplusbitmap.h \
86 gdiplusbrush.h \
87 gdiplusenums.h \
88 gdiplusfont.h \
89 gdiplusheaders.h \
90 gdiplusimageattributes.h \
91 gdiplusimaging.h \
92 gdiplusmatrix.h \
93 gdipluspath.h \
94 gdipluspen.h \
95 gdiplusregion.h \
96 gdiplusstringformat.h \
97 imm.h \
98 imagehlp.h \
99 mapiwin.h \
100 msdasc.h \
101 msi.h \
102 msiquery.h \
103 multimon.h \
104 ntquery.h \
105 oaidl.h \
106 ocidl.h \
107 oleauto.h \
108 olectl.h \
109 oledb.h \
110 oleidl.h \
111 propidl.h \
112 propkeydef.h \
113 propsys.h \
114 propvarutil.h \
115 shlobj.h \
116 shobjidl.h \
117 shtypes.h \
118 sspi.h \
119 strmif.h \
120 strsafe.h \
121 structuredquery.h \
122 urlmon.h \
123 wincrypt.h \
124 winerror.h \
125 wingdi.h \
126 wintrust.h \
127 winuser.h \
128 wspiapi.h \
129 exdispid.h \
130 dshow.h \
131 gdiplus.h \
132 msxml.h \
133 ncrypt.h \
134 shlguid.h \
135 transact.h
137 .IF "$(DISABLE_ATL)"==""
138 MINGWHEADER_ATL_PATCH_TARGET=$(MISC)$/mingwheader_atl_patch
139 MINGWHEADER_ATL_COPY_TARGET=$(MISC)$/mingwheader_atl_copy
140 FILES_TO_COPY_FROM_ATL= \
141 atlbase.h \
142 atlcom.h \
143 atlconv.h \
144 atlctl.h \
145 atlwin.h \
146 statreg.h
147 .ENDIF
149 FILES_TO_COPY_FROM_DIRECTXSDK= \
150 d3dtypes.h \
151 d3dx9core.h \
152 d3dx9math.h \
153 d3dx9math.inl \
154 dxtrans.h \
155 d3dx9.h
157 $(MISC)$/mingwheader_patch_all : $(MISC)$/mingwheader_patch $(MINGWHEADER_ATL_PATCH_TARGET) $(LB)$/libmsvcrt.a
159 $(MISC)$/mingwheader_patch : $(MISC)$/mingwheader_copy
160 patch -bd $(MISC)$/mingw -p0 -N -f -Z <mingw_headers.patch
161 $(TOUCH) $(MISC)$/mingwheader_patch
163 .IF "$(DISABLE_ATL)"==""
164 $(MINGWHEADER_ATL_PATCH_TARGET) : $(MINGWHEADER_ATL_COPY_TARGET)
165 patch -bd $(MISC)$/mingw -p0 -N -f -Z <mingw_atl_headers.patch
166 $(TOUCH) $(MINGWHEADER_ATL_PATCH_TARGET)
167 .ENDIF
169 $(MISC)$/mingwheader_copy:
170 $(MKDIRHIER) $(MISC)$/mingw$/include
171 $(MKDIRHIER) $(MISC)$/mingw$/include/sys
172 $(COPY) $(FILES_TO_COPY_FROM_MINGW:^$(MINGW_INCLUDE_DIR)) $(MISC)$/mingw$/include
173 $(COPY) $(FILES_TO_COPY_FROM_W32API:^$(MINGW_W32API_INCLUDE_DIR)) $(MISC)$/mingw$/include
174 $(COPY) $(FILES_TO_COPY_FROM_SYS:^$(SYS_INCLUDE_DIR)) $(MISC)$/mingw$/include$/sys
175 $(COPY) $(FILES_TO_COPY_FROM_PSDK:^$(PSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
176 $(COPY) $(FILES_TO_COPY_FROM_DIRECTXSDK:^$(DIRECTXSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
177 $(TOUCH) $(MISC)$/mingwheader_copy
179 .IF "$(DISABLE_ATL)"==""
180 $(MINGWHEADER_ATL_COPY_TARGET):
181 $(MKDIRHIER) $(MISC)$/mingw$/include/atl
182 $(COPY) $(FILES_TO_COPY_FROM_ATL:^$(ATL_INCLUDE_DIR)) $(MISC)$/mingw$/include$/atl
183 $(TOUCH) $(MINGWHEADER_ATL_COPY_TARGET)
184 .ENDIF
186 $(LB)$/libmsvcrt.a:
187 .IF "$(USE_MINGW)" == "cygwin"
188 $(COPY) $(COMPATH)$/lib/mingw/libmsvcrt.a $(LB)$/libmsvcrt_orig.a
189 .ELSE
190 $(COPY) $(COMPATH)$/lib/libmsvcrt.a $(LB)$/libmsvcrt_orig.a
191 .ENDIF
192 cd $(LB) && ar -x libmsvcrt_orig.a ofmt_stub.o
193 ar -d $(LB)$/libmsvcrt_orig.a ofmt_stub.o
194 nm -g --defined-only $(LB)$/libmsvcrt_orig.a > $(MISC)$/msvcrt.nm
195 echo EXPORTS > $(MISC)$/msvcrt.def
196 sed -ne 's/.* T _//p' $(MISC)$/msvcrt.nm | sort >> $(MISC)$/msvcrt.def
197 -sed -ne 's/.* I __imp__//p' $(MISC)$/msvcrt.nm | sort | diff - $(MISC)$/msvcrt.def | \
198 sed -ne 's/^< \(.*\)$/\1 DATA/p' > $(MISC)$/msvcrtdata.def
199 cat $(MISC)$/msvcrtdata.def >> $(MISC)$/msvcrt.def
200 dlltool --dllname msvcrt.dll --input-def=$(MISC)$/msvcrt.def --kill-at --output-lib=$(LB)$/libmsvcrt.a
201 cd $(LB) && ar -rs libmsvcrt.a ofmt_stub.o
203 clean:
204 -$(RM) $(MISC)$/mingw$/include$/*.h
205 -$(RM) $(MISC)$/mingwheader_copy
206 -$(RM) $(MISC)$/mingwheader_patch
208 .ENDIF
210 .ENDIF
212 .INCLUDE : target.mk