Create DEV300_m48 milestone tag from trunk@271829
[LibreOffice.git] / external / mingwheaders / makefile.mk
blob9214303548d03cff87ab28126c69328a1d8ed6ef
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
11 # $Revision: 1.8.10.1 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 PRJ=..
33 PRJNAME=external
34 TARGET=mingwheaders
36 .INCLUDE : settings.mk
38 .IF "$(OS)$(COM)" == "WNTGCC"
40 # Cygwin and MinGW use different directories for the W32API headers
41 .IF "$(USE_MINGW)" == "cygwin"
42 MINGW_INCLUDE_DIR=$/usr$/include/mingw/
43 MINGW_W32API_INCLUDE_DIR=$/usr$/include/w32api/
44 MINGW_W32API_LIB_DIR=$/usr$/include/w32api/
45 .ELSE
46 MINGW_INCLUDE_DIR=$(COMPATH)$/include/
47 MINGW_W32API_INCLUDE_DIR=$(COMPATH)$/include/
48 MINGW_W32API_LIB_DIR=$(COMPATH)$/lib/
49 .ENDIF
51 SYS_INCLUDE_DIR=$(MINGW_INCLUDE_DIR)$/sys/
53 PSDK_INCLUDE_DIR=$(PSDK_HOME)$/include$/
55 ATL_INCLUDE_DIR=$(PSDK_HOME)$/include$/atl$/
57 DIRECTXSDK_INCLUDE_DIR=$(DIRECTXSDK_HOME)$/include$/
59 FILES_TO_COPY_FROM_MINGW=excpt.h \
60 tchar.h
62 FILES_TO_COPY_FROM_W32API=amvideo.h \
63 bdatypes.h \
64 imm.h \
65 oaidl.h \
66 objfwd.h \
67 objidl.h \
68 uxtheme.h \
69 winbase.h \
70 wininet.h \
71 winnt.h \
72 winver.h \
73 wtypes.h
75 FILES_TO_COPY_FROM_SYS=stat.h
77 FILES_TO_COPY_FROM_PSDK=adoctint.h \
78 adodef.h \
79 adoguids.h \
80 adoint.h \
81 bcrypt.h \
82 commctrl.h \
83 control.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 imagehlp.h \
98 inaddr.h \
99 intsafe.h \
100 mapinls.h \
101 mapiwin.h \
102 msdasc.h \
103 msi.h \
104 msiquery.h \
105 multimon.h \
106 ncrypt.h \
107 ntquery.h \
108 ocidl.h \
109 oledb.h \
110 oleidl.h \
111 propidl.h \
112 propkeydef.h \
113 propsys.h \
114 qedit.h \
115 shlobj.h \
116 shobjidl.h \
117 shtypes.h \
118 specstrings.h \
119 specstrings_adt.h \
120 specstrings_strict.h \
121 sspi.h \
122 strmif.h \
123 strsafe.h \
124 structuredquery.h \
125 urlmon.h \
126 wincrypt.h \
127 wingdi.h \
128 winsock2.h \
129 winuser.h \
130 ws2def.h \
131 ws2ipdef.h \
132 ws2tcpip.h \
133 wspiapi.h \
134 adoid.h \
135 amstream.h \
136 austream.h \
137 ddstream.h \
138 dispex.h \
139 dshow.h \
140 exdispid.h \
141 gdiplus.h \
142 mmstream.h \
143 msxml.h \
144 oleauto.h \
145 olectl.h \
146 qos.h \
147 shlguid.h \
148 transact.h \
149 winerror.h
151 .IF "$(DISABLE_ATL)"==""
152 MINGWHEADER_ATL_PATCH_TARGET=$(MISC)$/mingwheader_atl_patch
153 MINGWHEADER_ATL_COPY_TARGET=$(MISC)$/mingwheader_atl_copy
154 FILES_TO_COPY_FROM_ATL=atlbase.h \
155 atlcom.h \
156 atlconv.h \
157 atlctl.h \
158 atlwin.h \
159 statreg.h
160 .ENDIF
162 FILES_TO_COPY_FROM_DIRECTXSDK=dxtrans.h \
163 d3dx9.h \
164 d3d.h \
165 d3dtypes.h \
166 d3dx9math.h \
167 d3dx9math.inl \
168 d3dx9core.h
170 $(MISC)$/mingwheader_patch_all : $(MISC)$/mingwheader_patch $(MINGWHEADER_ATL_PATCH_TARGET) $(LB)$/libmsvcrt.a
172 $(MISC)$/mingwheader_patch : $(MISC)$/mingwheader_copy
173 patch -bd $(MISC)$/mingw -p0 -N -f -Z <mingw_headers.patch
174 $(TOUCH) $(MISC)$/mingwheader_patch
176 .IF "$(DISABLE_ATL)"==""
177 $(MINGWHEADER_ATL_PATCH_TARGET) : $(MINGWHEADER_ATL_COPY_TARGET)
178 patch -bd $(MISC)$/mingw -p0 -N -f -Z <mingw_atl_headers.patch
179 $(TOUCH) $(MINGWHEADER_ATL_PATCH_TARGET)
180 .ENDIF
182 $(MISC)$/mingwheader_copy:
183 $(MKDIRHIER) $(MISC)$/mingw$/include
184 $(MKDIRHIER) $(MISC)$/mingw$/include/sys
185 $(COPY) $(FILES_TO_COPY_FROM_MINGW:^$(MINGW_INCLUDE_DIR)) $(MISC)$/mingw$/include
186 $(COPY) $(FILES_TO_COPY_FROM_W32API:^$(MINGW_W32API_INCLUDE_DIR)) $(MISC)$/mingw$/include
187 $(COPY) $(FILES_TO_COPY_FROM_SYS:^$(SYS_INCLUDE_DIR)) $(MISC)$/mingw$/include$/sys
188 $(COPY) $(FILES_TO_COPY_FROM_PSDK:^$(PSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
189 $(COPY) $(FILES_TO_COPY_FROM_DIRECTXSDK:^$(DIRECTXSDK_INCLUDE_DIR)) $(MISC)$/mingw$/include
190 $(TOUCH) $(MISC)$/mingwheader_copy
192 .IF "$(DISABLE_ATL)"==""
193 $(MINGWHEADER_ATL_COPY_TARGET):
194 $(MKDIRHIER) $(MISC)$/mingw$/include/atl
195 $(COPY) $(FILES_TO_COPY_FROM_ATL:^$(ATL_INCLUDE_DIR)) $(MISC)$/mingw$/include$/atl
196 $(TOUCH) $(MINGWHEADER_ATL_COPY_TARGET)
197 .ENDIF
199 $(LB)$/libmsvcrt.a:
200 .IF "$(USE_MINGW)" == "cygwin"
201 $(WRAPCMD) nm -g --defined-only $(COMPATH)$/lib/mingw/libmsvcrt.a > $(MISC)$/msvcrt.nm
202 .ELSE
203 $(WRAPCMD) nm -g --defined-only $(COMPATH)$/lib/libmsvcrt.a > $(MISC)$/msvcrt.nm
204 .ENDIF
205 echo EXPORTS > $(MISC)$/msvcrt.def
206 sed -ne 's/.* T _//p' $(MISC)$/msvcrt.nm | sort >> $(MISC)$/msvcrt.def
207 -sed -ne 's/.* I __imp__//p' $(MISC)$/msvcrt.nm | sort | diff - $(MISC)$/msvcrt.def | \
208 sed -ne 's/^< \(.*\)$/\1 DATA/p' > $(MISC)$/msvcrtdata.def
209 cat $(MISC)$/msvcrtdata.def >> $(MISC)$/msvcrt.def
210 dlltool --dllname msvcrt.dll --input-def=$(MISC)$/msvcrt.def --kill-at --output-lib=$(LB)$/libmsvcrt.a
212 clean:
213 -$(RM) $(MISC)$/mingw$/include$/*.h
214 -$(RM) $(MISC)$/mingwheader_copy
215 -$(RM) $(MISC)$/mingwheader_patch
217 .ENDIF
219 .INCLUDE : target.mk