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
=excpt.h \
62 FILES_TO_COPY_FROM_W32API
=amvideo.h \
75 FILES_TO_COPY_FROM_SYS
=stat.h
77 FILES_TO_COPY_FROM_PSDK
=adoctint.h \
90 gdiplusimageattributes.h \
96 gdiplusstringformat.h \
120 specstrings_strict.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 \
162 FILES_TO_COPY_FROM_DIRECTXSDK
=dxtrans.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
)
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
)
200 .IF
"$(USE_MINGW)" == "cygwin"
201 $(WRAPCMD
) nm
-g
--defined-only
$(COMPATH
)$/lib
/mingw
/libmsvcrt.a
> $(MISC
)$/msvcrt.nm
203 $(WRAPCMD
) nm
-g
--defined-only
$(COMPATH
)$/lib
/libmsvcrt.a
> $(MISC
)$/msvcrt.nm
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
213 -$(RM
) $(MISC
)$/mingw
$/include$/*.h
214 -$(RM
) $(MISC
)$/mingwheader_copy
215 -$(RM
) $(MISC
)$/mingwheader_patch