1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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 #*************************************************************************
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
/
42 MINGW_INCLUDE_DIR
=$(COMPATH
)$/include/
43 MINGW_W32API_INCLUDE_DIR
=$(COMPATH
)$/include/
44 MINGW_W32API_LIB_DIR
=$(COMPATH
)$/lib
/
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
= \
59 FILES_TO_COPY_FROM_W32API
= \
71 FILES_TO_COPY_FROM_SYS
= \
74 FILES_TO_COPY_FROM_PSDK
= \
89 gdiplusimageattributes.h \
95 gdiplusstringformat.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
= \
148 FILES_TO_COPY_FROM_DIRECTXSDK
= \
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
)
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
)
186 .IF
"$(USE_MINGW)" == "cygwin"
187 $(COPY
) $(COMPATH
)$/lib
/mingw
/libmsvcrt.a
$(LB
)$/libmsvcrt_orig.a
189 $(COPY
) $(COMPATH
)$/lib
/libmsvcrt.a
$(LB
)$/libmsvcrt_orig.a
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
203 -$(RM
) $(MISC
)$/mingw
$/include$/*.h
204 -$(RM
) $(MISC
)$/mingwheader_copy
205 -$(RM
) $(MISC
)$/mingwheader_patch