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 $
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 #*************************************************************************
37 # --- Settings -----------------------------------------------------
39 .INCLUDE
: settings.mk
41 # --- Product Version Information ----------------------------------
43 .INCLUDE
: ..
/productversion.mk
45 # --- Files --------------------------------------------------------
47 .IF
"$(WITH_LANG)"!=""
48 ULFDIR
:=$(COMMONMISC
)$/$(TARGET
)
49 .ELSE
# "$(WITH_LANG)"!=""
51 .ENDIF
# "$(WITH_LANG)"!=""
55 launcher_comment.ulf \
56 launcher_genericname.ulf \
59 LAUNCHERLIST
= writer calc draw impress math base printeradmin qstart startcenter
60 LAUNCHERDEPN
= ..
/menus
/{$(LAUNCHERLIST
)}.desktop
62 LAUNCHERFLAGFILE
= $(COMMONMISC
)/$(TARGET
)/xdg.flag
68 spreadsheet-template \
72 presentation-template \
78 oasis-spreadsheet-template \
80 oasis-drawing-template \
82 oasis-presentation-template \
84 oasis-master-document \
89 ms-excel-template-12 \
90 ms-powerpoint-presentation-12 \
91 ms-powerpoint-presentation \
92 ms-powerpoint-template-12 \
97 openxmlformats-officedocument-presentationml-presentation \
98 openxmlformats-officedocument-presentationml-template \
99 openxmlformats-officedocument-spreadsheetml-sheet \
100 openxmlformats-officedocument-spreadsheetml-template \
101 openxmlformats-officedocument-wordprocessingml-document \
102 openxmlformats-officedocument-wordprocessingml-template \
103 ms-excel-sheet-binary-12 \
108 oasis-text-template \
110 oasis-spreadsheet-template \
112 oasis-drawing-template \
114 oasis-presentation-template \
116 oasis-master-document \
122 spreadsheet-template \
126 presentation-template \
133 ..
/icons
/hicolor
/{16x16
32x32
48x48
}/apps
/{$(LAUNCHERLIST
:s
/qstart
//)}.png \
134 ..
/icons
/hicolor
/{16x16
32x32
48x48
}/mimetypes
/{$(MIMEICONLIST
)}.png \
135 ..
/icons
/locolor
/{16x16
32x32
}/apps
/{$(LAUNCHERLIST
:s
/qstart
//)}.png \
136 ..
/icons
/locolor
/{16x16
32x32
}/mimetypes
/{$(MIMEICONLIST
)}.png
138 # --- Targets ------------------------------------------------------
143 ALLTAR
: $(LAUNCHERFLAGFILE
) $(SPECFILES
) $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/build.flag
145 .ENDIF
# "$(GUI)"=="UNIX"
148 # Copy/patch the .desktop files to the output tree and
149 # merge-in the translations.
152 $(LAUNCHERFLAGFILE
) : ..
/productversion.mk brand.pl translate.pl
$(ULFDIR
)$/launcher_name.ulf
$(ULFDIR
)$/launcher_comment.ulf
$(ULFDIR
)/launcher_genericname.ulf
153 $(LAUNCHERFLAGFILE
) : $(LAUNCHERDEPN
)
154 @@
-$(MKDIRHIER
) $(@
:db
).
$(INPATH
).
$(@
:f
)
155 @echo Creating desktop entries for
$(@
:f
) ..
156 @echo
---------------------------------
157 @
$(PERL
) brand.pl
-p
'$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -u
$(UNIXWRAPPERNAME
) --iconprefix
'$${{WITHOUTDOTUNIXPRODUCTNAME}}${ICONVERSION}-' $< $(@
:db
).
$(INPATH
).
$(@
:f
)
158 @
$(PERL
) translate.pl
-p
'$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d
$(@
:db
).
$(INPATH
).
$(@
:f
) --ext
"desktop" --key
"Name" $(ULFDIR
)$/launcher_name.ulf
159 @
$(PERL
) translate.pl
-p
'$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d
$(@
:db
).
$(INPATH
).
$(@
:f
) --ext
"desktop" --key
"Comment" $(ULFDIR
)$/launcher_comment.ulf
160 @
$(PERL
) translate.pl
-p
'$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d
$(@
:db
).
$(INPATH
).
$(@
:f
) --ext
"desktop" --key
"GenericName" $(ULFDIR
)$/launcher_genericname.ulf
161 .IF
"$(WITH_LIBSN)"=="YES"
162 @noop x
$(foreach,i
,$(LAUNCHERLIST
) $(shell @echo
"StartupNotify=true" >> $(@
:db
).
$(INPATH
).
$(@
:f
)/$i.desktop
))x
164 @
$(MV
) -f
$(@
:db
).
$(INPATH
).
$(@
:f
)/* $(@
:d
)
165 @rmdir
$(@
:db
).
$(INPATH
).
$(@
:f
)
169 # Create shared mime info xml file
171 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.org.xml
: ..
/mimetypes
/{$(MIMELIST
)}.desktop create_mime_xml.pl
172 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.org.xml
: $(ULFDIR
)$/documents.ulf
173 @echo Create shared mime
info xml file ..
174 @echo
---------------------------------
175 @
$(PERL
) create_mime_xml.pl
$< > $@.
$(INPATH
)
176 @mv
-f
$@.
$(INPATH
) $@
179 # Create GNOME mime-info files
182 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.keys
: ..
/mimetypes
/openoffice.mime brand.pl translate.pl ..
/productversion.mk
$(ULFDIR
)$/documents.ulf
183 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.keys
: ..
/mimetypes
/{$(MIMELIST
)}.keys
184 @@
-$(MKDIRHIER
) $(@
:d
)
185 @echo Creating GNOME .keys file for
$(@
:d
:d
:f
) ..
186 @echo
---------------------------------
187 @
$(PERL
) brand.pl
-p
$(PRODUCTNAME.
$(@
:d
:d
:f
)) -u
$(UNIXFILENAME.
$(@
:d
:d
:f
)) --iconprefix
"$(ICONPREFIX.$(@:d:d:f))-" $< $(MISC
)/$(@
:d
:d
:f
)
188 @
$(PERL
) translate.pl
-p
$(PRODUCTNAME.
$(@
:d
:d
:f
)) -d
$(MISC
)/$(@
:d
:d
:f
) --ext
"keys" --key
"description" $(ULFDIR
)$/documents.ulf
189 @cat
$(MISC
)/$(@
:d
:d
:f
)/{$(MIMELIST
)}.keys
> $@.
$(INPATH
)
190 @mv
-f
$@.
$(INPATH
) $@
192 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.mime
: ..
/mimetypes
/$$(@
:f
)
193 @@
-$(MKDIRHIER
) $(@
:d
)
194 @echo Creating GNOME .mime file for
$(@
:d
:d
:f
) ..
195 @echo
---------------------------------
196 @cat
$< | tr
-d
"\015" > $@.
$(INPATH
)
197 @mv
-f
$@.
$(INPATH
) $@
199 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.applications
: ..
/productversion.mk
200 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.applications
: ..
/mimetypes
/$$(@
:f
)
201 @@
-$(MKDIRHIER
) $(@
:d
)
202 @echo Creating GNOME .applications file for
$(@
:d
:d
:f
) ..
203 @echo
---------------------------------
204 @cat
$< | tr
-d
"\015" | sed
-e
"s/OFFICENAME/$(UNIXFILENAME.$(@:d:d:f))/" -e
"s/%PRODUCTNAME/$(PRODUCTNAME.$(@:d:d:f)) $(PRODUCTVERSION.$(@:d:d:f))/" > $@.
$(INPATH
)
205 @mv
-f
$@.
$(INPATH
) $@
208 # Create KDE mimelnk files
210 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/mimelnklist
: brand.pl translate.pl ..
/productversion.mk
$(ULFDIR
)$/documents.ulf
211 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/mimelnklist
: ..
/mimetypes
/{$(MIMELIST
)}.desktop
212 @@
-$(MKDIRHIER
) $(@
:db
).
$(INPATH
)
213 @echo Creating KDE mimelnk entries for
$(@
:d
:d
:f
) ..
214 @echo
---------------------------------
215 @
$(PERL
) brand.pl
-p
"$(PRODUCTNAME.$(@:d:d:f))" -u
$(UNIXFILENAME.
$(@
:d
:d
:f
)) --iconprefix
"$(ICONPREFIX.$(@:d:d:f))-" $< $(@
:db
).
$(INPATH
)
216 @
$(PERL
) ..
/share
/translate.pl
-p
"$(PRODUCTNAME.$(@:d:d:f))" -d
$(@
:db
).
$(INPATH
) --ext
"desktop" --key
"Comment" $(ULFDIR
)$/documents.ulf
217 @mv
-f
$(@
:db
).
$(INPATH
)/* $(@
:d
)
218 @rmdir
$(@
:db
).
$(INPATH
)
219 @echo
"{$(MIMELIST)}.desktop" > $@
222 # Generate customized install scripts
224 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/create_tree.sh
: makefile.mk
225 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/create_tree.sh
: $$(@
:f
)
226 @@
-$(MKDIRHIER
) $(@
:d
)
227 @echo
"#\!/bin/bash" > $@.
$(INPATH
)
228 @echo
"PREFIX=$(UNIXFILENAME.$(@:d:d:f))" >> $@.
$(INPATH
)
229 @echo
"ICON_PREFIX=$(ICONPREFIX.$(@:d:d:f))" >> $@.
$(INPATH
)
230 @echo
"ICON_SOURCE_DIR=../../../desktop/icons" >> $@.
$(INPATH
)
231 @cat
$< >> $@.
$(INPATH
)
232 @chmod
774 $@.
$(INPATH
)
233 @mv
-f
$@.
$(INPATH
) $@
236 # Create skript files
239 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/{openoffice printeradmin
}.sh
: ..
/productversion.mk
240 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/{openoffice printeradmin
}.sh
: $$(@
:f
)
241 @@
-$(MKDIRHIER
) $(@
:d
)
242 @cat
$< | tr
-d
"\015" | sed
-e
"s/%PREFIX/$(UNIXFILENAME.$(@:d:d:f))/g" > $@.
$(INPATH
)
243 @mv
-f
$@.
$(INPATH
) $@
249 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/launcherlist
: $(LAUNCHERDEPN
)
250 @@
-$(MKDIRHIER
) $(@
:d
)
251 @echo
"{$(LAUNCHERLIST:s/qstart//)}.desktop" >$@.
$(INPATH
)
252 @mv
-f
$@.
$(INPATH
) $@
257 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/build.flag
: $(ICONDEPN
) \
258 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/launcherlist \
259 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/mimelnklist \
260 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/create_tree.sh \
261 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.keys \
262 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.mime \
263 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.org.xml \
264 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/openoffice.applications \
265 $(COMMONMISC
)$/{$(PRODUCTLIST
)}$/{openoffice printeradmin
}.sh