xref: /aoo41x/main/solenv/inc/extension_post.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
28EXTENSION_TARGET:=$(ZIP9TARGETN)
29
30.SOURCE.xcu : $(MISC)/$(EXTNAME)/merge $(MISC)/$(EXTNAME)/registry/data $(MISC)/$(COMPONENT_SHARED_CONFIG)_in/merge $(MISC)/$(COMPONENT_SHARED_CONFIG)_in/registry/data $(COMPONENT_CONFIGDIR) .
31.SOURCE.xcs : $(MISC)/$(EXTNAME)/registry $(MISC)/$(EXTNAME)/registry/schema .
32
33fixme=$(MISC)/$(EXTNAME)/merge/$(MISC)
34fixme2=$(fixme:n)
35
36fixme3=$(MISC)/$(EXTNAME)/$(MISC)
37fixme4=$(fixme:n)
38
39$(EXTENSIONDIR)/$(COMPONENT_CONFIGDEST)/%.xcu : %.xcu
40# ugly hacking to workaround prepended first source path
41	@@-$(MKDIRHIER) $(subst,$(fixme2),$(MISC) $(@:d))
42.IF "$(COMPONENT_XCU_REPLACEMENT)"!=""
43	$(TYPE) $< | sed '$(COMPONENT_XCU_REPLACEMENT)' > $(subst,$(fixme2),$(MISC) $@)
44.ELSE          # "$(COMPONENT_REPLACEMENT)"!=""
45	$(GNUCOPY) $< $(subst,$(fixme2),$(MISC) $@)
46.ENDIF          # "$(COMPONENT_REPLACEMENT)"!=""
47
48$(EXTENSIONDIR)/$(COMPONENT_CONFIGDESTSCHEMA)/%.xcs : %.xcs
49    @@-$(MKDIRHIER) $(subst,$(fixme4),$(MISC) $(@:d))
50	$(GNUCOPY) $< $(subst,$(fixme4),$(MISC) $@)
51
52$(EXTENSIONDIR)/%.jar : $(SOLARBINDIR)/%.jar
53	@@-$(MKDIRHIER) $(@:d)
54	$(GNUCOPY) $< $@
55
56.IF "$(COMPONENT_FILES)"!=""
57COMPONENT_FILES_SRC*=./
58# ugly hacking to workaround prepended first source path - also hits
59# here in case of "just copied" .xcu files
60$(COMPONENT_FILES) : $$(@:s|$(fixme2)|$(MISC)|:s|$(EXTENSIONDIR)/|$(COMPONENT_FILES_SRC)|)
61	@@-$(MKDIRHIER) $(@:s|$(fixme2)|$(MISC)|:d)
62    $(COMMAND_ECHO)$(COPY) $< $(@:s|$(fixme2)|$(MISC)|)
63.ENDIF			# "$(COMPONENT_FILES)"!=""
64
65.IF "$(COMPONENT_JARFILES)"!=""
66$(COMPONENT_JARFILES) : $(CLASSDIR)/$$(@:f)
67	@@-$(MKDIRHIER) $(@:d)
68    $(COMMAND_ECHO)$(COPY) $< $@
69.ENDIF			# "$(COMPONENT_JARFILES)"!=""
70
71.IF "$(COMPONENT_LIBRARIES)"!=""
72PACK_RUNTIME!:=TRUE
73# TODO(Q3): strip the binary?
74$(COMPONENT_LIBRARIES) : $(DLLDEST)/$$(@:f)
75	@@-$(MKDIRHIER) $(@:d)
76    $(COMMAND_ECHO)$(COPY) $< $@
77.ENDIF			# "$(COMPONENT_LIBRARIES)"!=""
78
79.IF "$(PACK_RUNTIME)"!=""
80PACK_RUNTIME_FLAG:=$(MISC)/$(TARGET)_pack_runtime.flag
81$(EXTENSION_TARGET) : $(PACK_RUNTIME_FLAG)
82
83$(EXTENSIONDIR) :
84	@@-$(MKDIRHIER) $(@:d)
85
86$(PACK_RUNTIME_FLAG) : $(EXTENSIONDIR)
87	@@-$(MKDIRHIER) $(@:d)
88.IF "$(OS)$(CPU)"=="WNTI"
89.IF "$(COM)"=="GCC"
90   $(GNUCOPY) $(SOLARBINDIR)/mingwm10.dll $(EXTENSIONDIR)
91   .IF "$(MINGW_GCCDLL)"!=""
92     $(GNUCOPY) $(SOLARBINDIR)/$(MINGW_GCCDLL) $(EXTENSIONDIR)
93   .ENDIF
94   .IF "$(MINGW_GXXDLL)"!=""
95     $(GNUCOPY) $(SOLARBINDIR)/$(MINGW_GXXDLL) $(EXTENSIONDIR)
96   .ENDIF
97.ELSE
98.IF "$(PACKMS)"!=""
99.IF "$(CCNUMVER)" <= "001399999999"
100	$(GNUCOPY) $(PACKMS)/msvcr71.dll $(EXTENSIONDIR)
101    $(GNUCOPY) $(PACKMS)/msvcp71.dll $(EXTENSIONDIR)
102.ELSE			# "$(CCNUMVER)" <= "001399999999"
103.IF "$(CCNUMVER)" <= "001499999999"
104	$(GNUCOPY) $(PACKMS)/msvcr80.dll $(EXTENSIONDIR)
105	$(GNUCOPY) $(PACKMS)/msvcp80.dll $(EXTENSIONDIR)
106	$(GNUCOPY) $(PACKMS)/msvcm80.dll $(EXTENSIONDIR)
107	$(GNUCOPY) $(PACKMS)/Microsoft.VC80.CRT.manifest $(EXTENSIONDIR)
108.ELSE			# "$(CCNUMVER)" <= "001499999999"
109	$(GNUCOPY) $(PACKMS)/msvcr90.dll $(EXTENSIONDIR)
110	$(GNUCOPY) $(PACKMS)/msvcp90.dll $(EXTENSIONDIR)
111	$(GNUCOPY) $(PACKMS)/msvcm90.dll $(EXTENSIONDIR)
112	$(GNUCOPY) $(PACKMS)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
113.ENDIF 			# "$(CCNUMVER)" <= "001499999999"
114.ENDIF			# "$(CCNUMVER)" <= "001399999999"
115.ELSE        # "$(PACKMS)"!=""
116.IF "$(CCNUMVER)" <= "001399999999"
117	$(GNUCOPY) $(SOLARBINDIR)/msvcr71.dll $(EXTENSIONDIR)
118	$(GNUCOPY) $(SOLARBINDIR)/msvcp71.dll $(EXTENSIONDIR)
119.ELSE			# "$(CCNUMVER)" <= "001399999999"
120.IF "$(CCNUMVER)" <= "001499999999"
121	$(GNUCOPY) $(SOLARBINDIR)/msvcr80.dll $(EXTENSIONDIR)
122	$(GNUCOPY) $(SOLARBINDIR)/msvcp80.dll $(EXTENSIONDIR)
123	$(GNUCOPY) $(SOLARBINDIR)/msvcm80.dll $(EXTENSIONDIR)
124	$(GNUCOPY) $(SOLARBINDIR)/Microsoft.VC80.CRT.manifest $(EXTENSIONDIR)
125.ELSE    		# "$(CCNUMVER)" <= "001499999999"
126	$(GNUCOPY) $(SOLARBINDIR)/msvcr90.dll $(EXTENSIONDIR)
127	$(GNUCOPY) $(SOLARBINDIR)/msvcp90.dll $(EXTENSIONDIR)
128	$(GNUCOPY) $(SOLARBINDIR)/msvcm90.dll $(EXTENSIONDIR)
129	$(GNUCOPY) $(SOLARBINDIR)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
130.ENDIF			# "$(CCNUMVER)" <= "001499999999"
131.ENDIF			# "$(CCNUMVER)" <= "001399999999"
132.ENDIF          # "$(PACKMS)"!=""
133.ENDIF	#"$(COM)"=="GCC"
134.ENDIF 			# "$(OS)$(CPU)"=="WNTI"
135	@$(TOUCH) $@
136.ENDIF			# "$(PACK_RUNTIME)"!=""
137
138IMPLEMENTATION_IDENTIFIER*="com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID)"
139
140.INCLUDE .IGNORE : $(MISC)/$(TARGET)_lang_track.mk
141.IF "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
142PHONYDESC=.PHONY
143.ENDIF			# "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
144.IF "$(DESCRIPTION)"!=""
145$(DESCRIPTION) $(PHONYDESC) : $(DESCRIPTION_SRC)
146	@@-$(MKDIRHIER) $(@:d)
147	@echo LAST_WITH_LANG=$(WITH_LANG) > $(MISC)/$(TARGET)_lang_track.mk
148
149	$(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/licinserter.pl $(DESCRIPTION_SRC) $(COMPONENT_LIC_TEMPL) $@.1.$(EXTNAME)
150
151	$(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/transform_description.pl $@.1.$(EXTNAME) $@.2.$(EXTNAME)
152	@@-$(RM) $@.1.$(EXTNAME)
153
154	$(COMMAND_ECHO)$(TYPE) $@.2.$(EXTNAME) | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ >  $@.3.$(EXTNAME)
155	@@-$(RM) $@.2.$(EXTNAME)
156
157	$(COMMAND_ECHO)$(TYPE) $@.3.$(EXTNAME) | sed s/UPDATED_SUPPORTED_PLATFORM/$(PLATFORMID)/ > $@
158	@@-$(RM) $@.3.$(EXTNAME)
159
160.ENDIF			# "$(DESCRIPTION)"!=""
161# default OOo license text!!!
162# may not fit...
163.IF "$(CUSTOM_LICENSE)"==""
164.IF "$(GUI)" == "WNT"
165PACKLICDEPS=$(SOLARBINDIR)/osl/license$$(@:b:s/_/./:e:s/./_/)$$(@:e)
166.ELSE			# "$(GUI)" == "WNT"
167PACKLICDEPS=$(SOLARBINDIR)/osl/LICENSE$$(@:b:s/_/./:e:s/./_/)$$(@:e)
168.ENDIF			# "$(GUI)" == "WNT"
169.ELSE			# "$(CUSTOM_LICENSE)" == ""
170PACKLICDEPS=$(CUSTOM_LICENSE)
171.ENDIF			# "$(CUSTOM_LICENSE)" == ""
172.IF "$(PACKLICS)"!=""
173$(PACKLICS) : $(PACKLICDEPS)
174	@@-$(MKDIRHIER) $(@:d)
175	$(COMMAND_ECHO)$(GNUCOPY) $< $@
176.ENDIF			# "$(PACKLICS)"!=""
177
178.IF "$(COMPONENT_MANIFEST)"!=""
179#$(COMPONENT_MANIFEST) : $$(@:f)
180$(COMPONENT_MANIFEST) : $(MANIFEST_SRC) $(MANIFEST_DEPS)
181	@@-$(MKDIRHIER) $(@:d)
182.IF "$(COMPONENT_MANIFEST_GENERIC)" == ""
183	$(COMMAND_ECHO)$(TYPE) $(MANIFEST_SRC) | $(SED) "s/SHARED_EXTENSION/$(DLLPOST)/" | $(SED) "s/EXEC_EXTENSION/$(EXECPOST)/" > $@
184.ELSE			# "$(COMPONENT_MANIFEST_GENERIC)" != ""
185    $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/makemani.pl $(PRJ)/util/manifest.xml $(EXTENSIONDIR) $(COMPONENT_MANIFEST_SEARCHDIR) $(@:d:d)
186.ENDIF			# "$(COMPONENT_MANIFEST_GENERIC)" != ""
187.ENDIF			# "$(COMPONENT_MANIFEST)"!=""
188
189ALLTAR : $(EXTENSION_PACKDEPS)
190