1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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 #*************************************************************************
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
/
46 MINGW_INCLUDE_DIR
=$(COMPATH
)$/include/
47 MINGW_W32API_INCLUDE_DIR
=$(COMPATH
)$/include/
48 MINGW_W32API_LIB_DIR
=$(COMPATH
)$/lib
/
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
= \
63 FILES_TO_COPY_FROM_W32API
= \
76 FILES_TO_COPY_FROM_SYS
= \
79 FILES_TO_COPY_FROM_PSDK
= \
94 gdiplusimageattributes.h \
100 gdiplusstringformat.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
= \
151 FILES_TO_COPY_FROM_DIRECTXSDK
= \
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
)
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
)
189 .IF
"$(USE_MINGW)" == "cygwin"
190 $(COPY
) $(COMPATH
)$/lib
/mingw
/libmsvcrt.a
$(LB
)$/libmsvcrt_orig.a
192 $(COPY
) $(COMPATH
)$/lib
/libmsvcrt.a
$(LB
)$/libmsvcrt_orig.a
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
206 -$(RM
) $(MISC
)$/mingw
$/include$/*.h
207 -$(RM
) $(MISC
)$/mingwheader_copy
208 -$(RM
) $(MISC
)$/mingwheader_patch