merged tag ooo/DEV300_m102
[LibreOffice.git] / external / mingwheaders / makefile.mk
blobccfc9587462ce0dd0190ec33006c50d43ef60a9e
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 # Cygwin and MinGW use different directories for the W32API headers
37 .IF "$(USE_MINGW)" == "cygwin"
38 MINGW_INCLUDE_DIR=$/usr$/include/mingw/
39 MINGW_W32API_INCLUDE_DIR=$/usr$/include/w32api/
40 MINGW_W32API_LIB_DIR=$/usr$/include/w32api/
41 .ELSE
42 MINGW_INCLUDE_DIR=$(COMPATH)$/include/
43 MINGW_W32API_INCLUDE_DIR=$(COMPATH)$/include/
44 MINGW_W32API_LIB_DIR=$(COMPATH)$/lib/
45 .ENDIF
47 SYS_INCLUDE_DIR=$(MINGW_INCLUDE_DIR)$/sys/
49 PSDK_INCLUDE_DIR=$(PSDK_HOME)$/include$/
51 ATL_INCLUDE_DIR=$(PSDK_HOME)$/include$/atl$/
53 DIRECTXSDK_INCLUDE_DIR=$(DIRECTXSDK_HOME)$/include$/
55 FILES_TO_COPY_FROM_MINGW= \
56 excpt.h \
57 tchar.h
59 FILES_TO_COPY_FROM_W32API= \
60 amvideo.h \
61 basetyps.h \
62 objidl.h \
63 specstrings.h \
64 uxtheme.h \
65 winbase.h \
66 windef.h \
67 wininet.h \
68 winver.h \
69 wtypes.h
71 FILES_TO_COPY_FROM_SYS= \
72 stat.h
74 FILES_TO_COPY_FROM_PSDK= \
75 adoctint.h \
76 adodef.h \
77 adoguids.h \
78 adoint.h \
79 bcrypt.h \
80 commctrl.h \
81 control.h \
82 dispex.h \
83 filter.h \
84 gdiplusbitmap.h \
85 gdiplusbrush.h \
86 gdiplusenums.h \
87 gdiplusfont.h \
88 gdiplusheaders.h \
89 gdiplusimageattributes.h \
90 gdiplusimaging.h \
91 gdiplusmatrix.h \
92 gdipluspath.h \
93 gdipluspen.h \
94 gdiplusregion.h \
95 gdiplusstringformat.h \
96 imm.h \
97 imagehlp.h \
98 mapiwin.h \
99 msdasc.h \
100 msi.h \
101 msiquery.h \
102 multimon.h \
103 ntquery.h \
104 oaidl.h \
105 ocidl.h \
106 oleauto.h \
107 olectl.h \
108 oledb.h \
109 oleidl.h \
110 propidl.h \
111 propkeydef.h \
112 propsys.h \
113 propvarutil.h \
114 shlobj.h \
115 shobjidl.h \
116 shtypes.h \
117 sspi.h \
118 strmif.h \
119 strsafe.h \
120 structuredquery.h \
121 urlmon.h \
122 wincrypt.h \
123 winerror.h \
124 wingdi.h \
125 wintrust.h \
126 winuser.h \
127 wspiapi.h \
128 exdispid.h \
129 dshow.h \
130 gdiplus.h \
131 msxml.h \
132 ncrypt.h \
133 shlguid.h \
134 transact.h
136 .IF "$(DISABLE_ATL)"==""
137 MINGWHEADER_ATL_PATCH_TARGET=$(MISC)$/mingwheader_atl_patch
138 MINGWHEADER_ATL_COPY_TARGET=$(MISC)$/mingwheader_atl_copy
139 FILES_TO_COPY_FROM_ATL= \
140 atlbase.h \
141 atlcom.h \
142 atlconv.h \
143 atlctl.h \
144 atlwin.h \
145 statreg.h
146 .ENDIF
148 FILES_TO_COPY_FROM_DIRECTXSDK= \
149 d3dtypes.h \
150 d3dx9core.h \
151 d3dx9math.h \
152 d3dx9math.inl \
153 dxtrans.h \
154 d3dx9.h
156 $(MISC)$/mingwheader_patch_all : $(MISC)$/mingwheader_patch $(MINGWHEADER_ATL_PATCH_TARGET) $(LB)$/libmsvcrt.a
158 $(MISC)$/mingwheader_patch : $(MISC)$/mingwheader_copy
159 patch -bd $(MISC)$/mingw -p0 -N -f -Z <mingw_headers.patch
160 $(TOUCH) $(MISC)$/mingwheader_patch
162 .IF "$(DISABLE_ATL)"==""
163 $(MINGWHEADER_ATL_PATCH_TARGET) : $(MINGWHEADER_ATL_COPY_TARGET)
164 patch -bd $(MISC)$/mingw -p0 -N -f -Z <mingw_atl_headers.patch
165 $(TOUCH) $(MINGWHEADER_ATL_PATCH_TARGET)
166 .ENDIF
168 $(MISC)$/mingwheader_copy:
169 $(MKDIRHIER) $(MISC)$/mingw$/include
170 $(MKDIRHIER) $(MISC)$/mingw$/include/sys
171 $(COPY) $(FILES_TO_COPY_FROM_MINGW:^$(MINGW_INCLUDE_DIR)) $(MISC)$/mingw$/include
172 $(COPY) $(FILES_TO_COPY_FROM_W32API:^$(MINGW_W32API_INCLUDE_DIR)) $(MISC)$/mingw$/include
173 $(COPY) $(FILES_TO_COPY_FROM_SYS:^$(SYS_INCLUDE_DIR)) $(MISC)$/mingw$/include$/sys
174 $(COPY) $(FILES_TO_COPY_FROM_PSDK:^$(PSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
175 $(COPY) $(FILES_TO_COPY_FROM_DIRECTXSDK:^$(DIRECTXSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
176 $(TOUCH) $(MISC)$/mingwheader_copy
178 .IF "$(DISABLE_ATL)"==""
179 $(MINGWHEADER_ATL_COPY_TARGET):
180 $(MKDIRHIER) $(MISC)$/mingw$/include/atl
181 $(COPY) $(FILES_TO_COPY_FROM_ATL:^$(ATL_INCLUDE_DIR)) $(MISC)$/mingw$/include$/atl
182 $(TOUCH) $(MINGWHEADER_ATL_COPY_TARGET)
183 .ENDIF
185 $(LB)$/libmsvcrt.a:
186 .IF "$(USE_MINGW)" == "cygwin"
187 $(COPY) $(COMPATH)$/lib/mingw/libmsvcrt.a $(LB)$/libmsvcrt_orig.a
188 .ELSE
189 $(COPY) $(COMPATH)$/lib/libmsvcrt.a $(LB)$/libmsvcrt_orig.a
190 .ENDIF
191 cd $(LB) && ar -x libmsvcrt_orig.a ofmt_stub.o
192 ar -d $(LB)$/libmsvcrt_orig.a ofmt_stub.o
193 nm -g --defined-only $(LB)$/libmsvcrt_orig.a > $(MISC)$/msvcrt.nm
194 echo EXPORTS > $(MISC)$/msvcrt.def
195 sed -ne 's/.* T _//p' $(MISC)$/msvcrt.nm | sort >> $(MISC)$/msvcrt.def
196 -sed -ne 's/.* I __imp__//p' $(MISC)$/msvcrt.nm | sort | diff - $(MISC)$/msvcrt.def | \
197 sed -ne 's/^< \(.*\)$/\1 DATA/p' > $(MISC)$/msvcrtdata.def
198 cat $(MISC)$/msvcrtdata.def >> $(MISC)$/msvcrt.def
199 dlltool --dllname msvcrt.dll --input-def=$(MISC)$/msvcrt.def --kill-at --output-lib=$(LB)$/libmsvcrt.a
200 cd $(LB) && ar -rs libmsvcrt.a ofmt_stub.o
202 clean:
203 -$(RM) $(MISC)$/mingw$/include$/*.h
204 -$(RM) $(MISC)$/mingwheader_copy
205 -$(RM) $(MISC)$/mingwheader_patch
207 .ENDIF
209 .INCLUDE : target.mk