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