xref: /aoo41x/main/sysui/desktop/share/makefile.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
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.
14#
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).
20#
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.
25#
26#*************************************************************************
27
28PRJ=..$/..
29
30PRJNAME=sysui
31TARGET=desktopshare
32
33# --- Settings -----------------------------------------------------
34
35.INCLUDE :  settings.mk
36
37# --- Product Version Information ----------------------------------
38
39.INCLUDE :  ../productversion.mk
40
41# --- Files --------------------------------------------------------
42
43.IF "$(WITH_LANG)"!=""
44ULFDIR:=$(COMMONMISC)$/$(TARGET)
45.ELSE			# "$(WITH_LANG)"!=""
46ULFDIR:=.
47.ENDIF			# "$(WITH_LANG)"!=""
48
49ULFFILES= \
50    documents.ulf \
51    launcher_comment.ulf \
52    launcher_genericname.ulf \
53    launcher_name.ulf
54
55LAUNCHERLIST = writer calc draw impress math base printeradmin qstart startcenter javafilter
56LAUNCHERDEPN = ../menus/{$(LAUNCHERLIST)}.desktop
57
58LAUNCHERFLAGFILE = $(COMMONMISC)/$(TARGET)/xdg.flag
59
60MIMELIST = \
61	text \
62	text-template \
63	spreadsheet \
64	spreadsheet-template \
65	drawing \
66	drawing-template \
67	presentation \
68	presentation-template \
69	formula \
70	master-document \
71	oasis-text \
72	oasis-text-template \
73	oasis-spreadsheet \
74	oasis-spreadsheet-template \
75	oasis-drawing \
76	oasis-drawing-template \
77	oasis-presentation \
78	oasis-presentation-template \
79	oasis-formula \
80	oasis-master-document \
81	oasis-database \
82	oasis-web-template \
83	ms-excel-sheet-12 \
84	ms-excel-sheet \
85	ms-excel-template-12 \
86	ms-powerpoint-presentation-12 \
87	ms-powerpoint-presentation \
88	ms-powerpoint-template-12 \
89	ms-word-document-12 \
90	ms-word-document \
91	ms-word-document2 \
92	ms-word-template-12 \
93	openxmlformats-officedocument-presentationml-presentation \
94	openxmlformats-officedocument-presentationml-template \
95	openxmlformats-officedocument-spreadsheetml-sheet \
96	openxmlformats-officedocument-spreadsheetml-template \
97	openxmlformats-officedocument-wordprocessingml-document \
98	openxmlformats-officedocument-wordprocessingml-template \
99    ms-excel-sheet-binary-12	\
100    extension
101
102MIMEICONLIST = \
103	oasis-text \
104	oasis-text-template \
105	oasis-spreadsheet \
106	oasis-spreadsheet-template \
107	oasis-drawing \
108	oasis-drawing-template \
109	oasis-presentation \
110	oasis-presentation-template \
111	oasis-formula \
112	oasis-master-document \
113	oasis-database \
114	oasis-web-template \
115	text \
116	text-template \
117	spreadsheet \
118	spreadsheet-template \
119	drawing \
120	drawing-template \
121	presentation \
122	presentation-template \
123	formula \
124	master-document \
125	database \
126    extension
127
128ICONDEPN = \
129	../icons/hicolor/{16x16 32x32 48x48}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
130	../icons/hicolor/{16x16 32x32 48x48}/mimetypes/{$(MIMEICONLIST)}.png \
131	../icons/locolor/{16x16 32x32}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
132	../icons/locolor/{16x16 32x32}/mimetypes/{$(MIMEICONLIST)}.png
133
134# --- Targets ------------------------------------------------------
135
136.INCLUDE :  target.mk
137
138.IF "$(GUI)"=="UNX"
139ALLTAR : $(LAUNCHERFLAGFILE) $(SPECFILES) $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
140
141.ENDIF          # "$(GUI)"=="UNIX"
142
143#
144# Copy/patch the .desktop files to the output tree and
145# merge-in the translations.
146#
147
148$(LAUNCHERFLAGFILE) : ../productversion.mk brand.pl translate.pl $(ULFDIR)$/launcher_name.ulf $(ULFDIR)$/launcher_comment.ulf $(ULFDIR)/launcher_genericname.ulf
149$(LAUNCHERFLAGFILE) : $(LAUNCHERDEPN)
150	@@-$(MKDIRHIER) $(@:db).$(INPATH).$(@:f)
151	@echo Creating desktop entries for $(@:f) ..
152	@echo ---------------------------------
153	@$(PERL) brand.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -u $(UNIXWRAPPERNAME) --iconprefix '$${{WITHOUTDOTUNIXPRODUCTNAME}}${ICONVERSION}-' $< $(@:db).$(INPATH).$(@:f)
154	@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Name" $(ULFDIR)$/launcher_name.ulf
155	@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Comment" $(ULFDIR)$/launcher_comment.ulf
156	@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "GenericName" $(ULFDIR)$/launcher_genericname.ulf
157.IF "$(WITH_LIBSN)"=="YES"
158	@noop x$(foreach,i,$(LAUNCHERLIST) $(shell @echo "StartupNotify=true" >> $(@:db).$(INPATH).$(@:f)/$i.desktop))x
159.ENDIF
160	@$(MV) -f $(@:db).$(INPATH).$(@:f)/* $(@:d)
161	@rmdir $(@:db).$(INPATH).$(@:f)
162	@touch $@
163
164#
165# Create shared mime info xml file
166#
167$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml : ../mimetypes/{$(MIMELIST)}.desktop create_mime_xml.pl
168$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml : $(ULFDIR)$/documents.ulf
169	@echo Create shared mime info xml file ..
170	@echo ---------------------------------
171	@$(PERL) create_mime_xml.pl $< > $@.$(INPATH)
172	@mv -f $@.$(INPATH) $@
173
174#
175# Create GNOME mime-info files
176#
177
178$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys : ../mimetypes/openoffice.mime brand.pl translate.pl ../productversion.mk $(ULFDIR)$/documents.ulf
179$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys : ../mimetypes/{$(MIMELIST)}.keys
180	@@-$(MKDIRHIER) $(@:d)
181	@echo Creating GNOME .keys file for $(@:d:d:f) ..
182	@echo ---------------------------------
183	@$(PERL) brand.pl -p $(PRODUCTNAME.$(@:d:d:f)) -u $(UNIXFILENAME.$(@:d:d:f)) --iconprefix "$(ICONPREFIX.$(@:d:d:f))-" $< $(MISC)/$(@:d:d:f)
184	@$(PERL) translate.pl -p $(PRODUCTNAME.$(@:d:d:f)) -d $(MISC)/$(@:d:d:f) --ext "keys" --key "description" $(ULFDIR)$/documents.ulf
185	@cat $(MISC)/$(@:d:d:f)/{$(MIMELIST)}.keys > $@.$(INPATH)
186	@mv -f $@.$(INPATH) $@
187
188$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.mime : ../mimetypes/$$(@:f)
189	@@-$(MKDIRHIER) $(@:d)
190	@echo Creating GNOME .mime file for $(@:d:d:f) ..
191	@echo ---------------------------------
192	@cat $< | tr -d "\015" > $@.$(INPATH)
193	@mv -f $@.$(INPATH) $@
194
195$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications : ../productversion.mk
196$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications : ../mimetypes/$$(@:f)
197	@@-$(MKDIRHIER) $(@:d)
198	@echo Creating GNOME .applications file for $(@:d:d:f) ..
199	@echo ---------------------------------
200	@cat $< | tr -d "\015" | sed -e "s/OFFICENAME/$(UNIXFILENAME.$(@:d:d:f))/" -e "s/%PRODUCTNAME/$(PRODUCTNAME.$(@:d:d:f)) $(PRODUCTVERSION.$(@:d:d:f))/" > $@.$(INPATH)
201	@mv -f $@.$(INPATH) $@
202
203#
204# Create KDE mimelnk files
205#
206$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist : brand.pl translate.pl ../productversion.mk $(ULFDIR)$/documents.ulf
207$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist : ../mimetypes/{$(MIMELIST)}.desktop
208	@@-$(MKDIRHIER) $(@:db).$(INPATH)
209	@echo Creating KDE mimelnk entries for $(@:d:d:f) ..
210	@echo ---------------------------------
211	@$(PERL) brand.pl -p "$(PRODUCTNAME.$(@:d:d:f))" -u $(UNIXFILENAME.$(@:d:d:f)) --iconprefix "$(ICONPREFIX.$(@:d:d:f))-" $< $(@:db).$(INPATH)
212	@$(PERL) ../share/translate.pl -p "$(PRODUCTNAME.$(@:d:d:f))" -d $(@:db).$(INPATH) --ext "desktop" --key "Comment" $(ULFDIR)$/documents.ulf
213	@mv -f $(@:db).$(INPATH)/* $(@:d)
214	@rmdir $(@:db).$(INPATH)
215	@echo  "{$(MIMELIST)}.desktop" > $@
216
217#
218# Generate customized install scripts
219#
220$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : makefile.mk
221$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh : $$(@:f)
222	@@-$(MKDIRHIER) $(@:d)
223	@echo "#\!/bin/bash" > $@.$(INPATH)
224	@echo "PREFIX=$(UNIXFILENAME.$(@:d:d:f))" >> $@.$(INPATH)
225	@echo "ICON_PREFIX=$(ICONPREFIX.$(@:d:d:f))" >> $@.$(INPATH)
226	@echo "ICON_SOURCE_DIR=../../../desktop/icons" >> $@.$(INPATH)
227	@cat $< >> $@.$(INPATH)
228	@chmod 774 $@.$(INPATH)
229	@mv -f $@.$(INPATH) $@
230
231#
232# Create skript files
233#
234
235$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh : ../productversion.mk
236$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh : $$(@:f)
237	@@-$(MKDIRHIER) $(@:d)
238	@cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(@:d:d:f))/g" > $@.$(INPATH)
239	@mv -f $@.$(INPATH) $@
240
241#
242# Launcher list
243#
244
245$(COMMONMISC)$/{$(PRODUCTLIST)}$/launcherlist : $(LAUNCHERDEPN)
246	@@-$(MKDIRHIER) $(@:d)
247	@echo "{$(LAUNCHERLIST:s/qstart//)}.desktop" >$@.$(INPATH)
248	@mv -f $@.$(INPATH) $@
249
250#
251# Flagfile
252#
253$(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag : $(ICONDEPN) \
254	$(COMMONMISC)$/{$(PRODUCTLIST)}$/launcherlist \
255	$(COMMONMISC)$/{$(PRODUCTLIST)}$/mimelnklist \
256	$(COMMONMISC)$/{$(PRODUCTLIST)}$/create_tree.sh \
257	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.keys \
258	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.mime \
259	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.org.xml	\
260	$(COMMONMISC)$/{$(PRODUCTLIST)}$/openoffice.applications \
261	$(COMMONMISC)$/{$(PRODUCTLIST)}$/{openoffice printeradmin}.sh
262	@touch $@
263
264