xref: /aoo41x/main/solenv/inc/extension_post.mk (revision 7871dc3e)
1*7871dc3eSAndrew Rist#**************************************************************
2*7871dc3eSAndrew Rist#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*7871dc3eSAndrew Rist#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*7871dc3eSAndrew Rist#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19*7871dc3eSAndrew Rist#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirEXTENSION_TARGET:=$(ZIP9TARGETN)
25cdf0e10cSrcweir
26cdf0e10cSrcweir.SOURCE.xcu : $(MISC)/$(EXTNAME)/merge $(MISC)/$(EXTNAME)/registry/data $(MISC)/$(COMPONENT_SHARED_CONFIG)_in/merge $(MISC)/$(COMPONENT_SHARED_CONFIG)_in/registry/data $(COMPONENT_CONFIGDIR) .
27cdf0e10cSrcweir.SOURCE.xcs : $(MISC)/$(EXTNAME)/registry $(MISC)/$(EXTNAME)/registry/schema .
28cdf0e10cSrcweir
29cdf0e10cSrcweirfixme=$(MISC)/$(EXTNAME)/merge/$(MISC)
30cdf0e10cSrcweirfixme2=$(fixme:n)
31cdf0e10cSrcweir
32cdf0e10cSrcweirfixme3=$(MISC)/$(EXTNAME)/$(MISC)
33cdf0e10cSrcweirfixme4=$(fixme:n)
34cdf0e10cSrcweir
35cdf0e10cSrcweir$(EXTENSIONDIR)/$(COMPONENT_CONFIGDEST)/%.xcu : %.xcu
36cdf0e10cSrcweir# ugly hacking to workaround prepended first source path
37cdf0e10cSrcweir	@@-$(MKDIRHIER) $(subst,$(fixme2),$(MISC) $(@:d))
38cdf0e10cSrcweir.IF "$(COMPONENT_XCU_REPLACEMENT)"!=""
39cdf0e10cSrcweir	$(TYPE) $< | sed '$(COMPONENT_XCU_REPLACEMENT)' > $(subst,$(fixme2),$(MISC) $@)
40cdf0e10cSrcweir.ELSE          # "$(COMPONENT_REPLACEMENT)"!=""
41cdf0e10cSrcweir	$(GNUCOPY) $< $(subst,$(fixme2),$(MISC) $@)
42cdf0e10cSrcweir.ENDIF          # "$(COMPONENT_REPLACEMENT)"!=""
43cdf0e10cSrcweir
44cdf0e10cSrcweir$(EXTENSIONDIR)/$(COMPONENT_CONFIGDESTSCHEMA)/%.xcs : %.xcs
45cdf0e10cSrcweir    @@-$(MKDIRHIER) $(subst,$(fixme4),$(MISC) $(@:d))
46cdf0e10cSrcweir	$(GNUCOPY) $< $(subst,$(fixme4),$(MISC) $@)
47cdf0e10cSrcweir
48cdf0e10cSrcweir$(EXTENSIONDIR)/%.jar : $(SOLARBINDIR)/%.jar
49cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
50cdf0e10cSrcweir	$(GNUCOPY) $< $@
51cdf0e10cSrcweir
52cdf0e10cSrcweir.IF "$(COMPONENT_FILES)"!=""
53cdf0e10cSrcweirCOMPONENT_FILES_SRC*=./
54cdf0e10cSrcweir# ugly hacking to workaround prepended first source path - also hits
55cdf0e10cSrcweir# here in case of "just copied" .xcu files
56cdf0e10cSrcweir$(COMPONENT_FILES) : $$(@:s|$(fixme2)|$(MISC)|:s|$(EXTENSIONDIR)/|$(COMPONENT_FILES_SRC)|)
57cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:s|$(fixme2)|$(MISC)|:d)
58cdf0e10cSrcweir    $(COMMAND_ECHO)$(COPY) $< $(@:s|$(fixme2)|$(MISC)|)
59cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_FILES)"!=""
60cdf0e10cSrcweir
61cdf0e10cSrcweir.IF "$(COMPONENT_JARFILES)"!=""
62cdf0e10cSrcweir$(COMPONENT_JARFILES) : $(CLASSDIR)/$$(@:f)
63cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
64cdf0e10cSrcweir    $(COMMAND_ECHO)$(COPY) $< $@
65cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_JARFILES)"!=""
66cdf0e10cSrcweir
67cdf0e10cSrcweir.IF "$(COMPONENT_LIBRARIES)"!=""
68cdf0e10cSrcweirPACK_RUNTIME!:=TRUE
69cdf0e10cSrcweir# TODO(Q3): strip the binary?
70cdf0e10cSrcweir$(COMPONENT_LIBRARIES) : $(DLLDEST)/$$(@:f)
71cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
72cdf0e10cSrcweir    $(COMMAND_ECHO)$(COPY) $< $@
73cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_LIBRARIES)"!=""
74cdf0e10cSrcweir
75cdf0e10cSrcweir.IF "$(PACK_RUNTIME)"!=""
76cdf0e10cSrcweirPACK_RUNTIME_FLAG:=$(MISC)/$(TARGET)_pack_runtime.flag
77cdf0e10cSrcweir$(EXTENSION_TARGET) : $(PACK_RUNTIME_FLAG)
78cdf0e10cSrcweir
79cdf0e10cSrcweir$(EXTENSIONDIR) :
80cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
81cdf0e10cSrcweir
82cdf0e10cSrcweir$(PACK_RUNTIME_FLAG) : $(EXTENSIONDIR)
83cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
84cdf0e10cSrcweir.IF "$(OS)$(CPU)"=="WNTI"
85cdf0e10cSrcweir.IF "$(COM)"=="GCC"
86cdf0e10cSrcweir   $(GNUCOPY) $(SOLARBINDIR)/mingwm10.dll $(EXTENSIONDIR)
87cdf0e10cSrcweir   .IF "$(MINGW_GCCDLL)"!=""
88cdf0e10cSrcweir     $(GNUCOPY) $(SOLARBINDIR)/$(MINGW_GCCDLL) $(EXTENSIONDIR)
89cdf0e10cSrcweir   .ENDIF
90cdf0e10cSrcweir   .IF "$(MINGW_GXXDLL)"!=""
91cdf0e10cSrcweir     $(GNUCOPY) $(SOLARBINDIR)/$(MINGW_GXXDLL) $(EXTENSIONDIR)
92cdf0e10cSrcweir   .ENDIF
93cdf0e10cSrcweir.ELSE
94cdf0e10cSrcweir.IF "$(PACKMS)"!=""
95cdf0e10cSrcweir.IF "$(CCNUMVER)" <= "001399999999"
96cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcr71.dll $(EXTENSIONDIR)
97cdf0e10cSrcweir    $(GNUCOPY) $(PACKMS)/msvcp71.dll $(EXTENSIONDIR)
98cdf0e10cSrcweir.ELSE			# "$(CCNUMVER)" <= "001399999999"
99cdf0e10cSrcweir.IF "$(CCNUMVER)" <= "001499999999"
100cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcr80.dll $(EXTENSIONDIR)
101cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcp80.dll $(EXTENSIONDIR)
102cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcm80.dll $(EXTENSIONDIR)
103cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/Microsoft.VC80.CRT.manifest $(EXTENSIONDIR)
104cdf0e10cSrcweir.ELSE			# "$(CCNUMVER)" <= "001499999999"
105cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcr90.dll $(EXTENSIONDIR)
106cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcp90.dll $(EXTENSIONDIR)
107cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcm90.dll $(EXTENSIONDIR)
108cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
109cdf0e10cSrcweir.ENDIF 			# "$(CCNUMVER)" <= "001499999999"
110cdf0e10cSrcweir.ENDIF			# "$(CCNUMVER)" <= "001399999999"
111cdf0e10cSrcweir.ELSE        # "$(PACKMS)"!=""
112cdf0e10cSrcweir.IF "$(CCNUMVER)" <= "001399999999"
113cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcr71.dll $(EXTENSIONDIR)
114cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcp71.dll $(EXTENSIONDIR)
115cdf0e10cSrcweir.ELSE			# "$(CCNUMVER)" <= "001399999999"
116cdf0e10cSrcweir.IF "$(CCNUMVER)" <= "001499999999"
117cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcr80.dll $(EXTENSIONDIR)
118cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcp80.dll $(EXTENSIONDIR)
119cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcm80.dll $(EXTENSIONDIR)
120cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/Microsoft.VC80.CRT.manifest $(EXTENSIONDIR)
121cdf0e10cSrcweir.ELSE    		# "$(CCNUMVER)" <= "001499999999"
122cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcr90.dll $(EXTENSIONDIR)
123cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcp90.dll $(EXTENSIONDIR)
124cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcm90.dll $(EXTENSIONDIR)
125cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
126cdf0e10cSrcweir.ENDIF			# "$(CCNUMVER)" <= "001499999999"
127cdf0e10cSrcweir.ENDIF			# "$(CCNUMVER)" <= "001399999999"
128cdf0e10cSrcweir.ENDIF          # "$(PACKMS)"!=""
129cdf0e10cSrcweir.ENDIF	#"$(COM)"=="GCC"
130cdf0e10cSrcweir.ENDIF 			# "$(OS)$(CPU)"=="WNTI"
131cdf0e10cSrcweir	@$(TOUCH) $@
132cdf0e10cSrcweir.ENDIF			# "$(PACK_RUNTIME)"!=""
133cdf0e10cSrcweir
134cdf0e10cSrcweirIMPLEMENTATION_IDENTIFIER*="com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID)"
135cdf0e10cSrcweir
136cdf0e10cSrcweir.INCLUDE .IGNORE : $(MISC)/$(TARGET)_lang_track.mk
137cdf0e10cSrcweir.IF "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
138cdf0e10cSrcweirPHONYDESC=.PHONY
139cdf0e10cSrcweir.ENDIF			# "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
140cdf0e10cSrcweir.IF "$(DESCRIPTION)"!=""
141cdf0e10cSrcweir$(DESCRIPTION) $(PHONYDESC) : $(DESCRIPTION_SRC)
142cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
143cdf0e10cSrcweir	@echo LAST_WITH_LANG=$(WITH_LANG) > $(MISC)/$(TARGET)_lang_track.mk
144cdf0e10cSrcweir
145cdf0e10cSrcweir	$(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/licinserter.pl $(DESCRIPTION_SRC) $(COMPONENT_LIC_TEMPL) $@.1.$(EXTNAME)
146cdf0e10cSrcweir
147cdf0e10cSrcweir	$(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/transform_description.pl $@.1.$(EXTNAME) $@.2.$(EXTNAME)
148cdf0e10cSrcweir	@@-$(RM) $@.1.$(EXTNAME)
149cdf0e10cSrcweir
150cdf0e10cSrcweir	$(COMMAND_ECHO)$(TYPE) $@.2.$(EXTNAME) | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ >  $@.3.$(EXTNAME)
151cdf0e10cSrcweir	@@-$(RM) $@.2.$(EXTNAME)
152cdf0e10cSrcweir
153cdf0e10cSrcweir	$(COMMAND_ECHO)$(TYPE) $@.3.$(EXTNAME) | sed s/UPDATED_SUPPORTED_PLATFORM/$(PLATFORMID)/ > $@
154cdf0e10cSrcweir	@@-$(RM) $@.3.$(EXTNAME)
155cdf0e10cSrcweir
156cdf0e10cSrcweir.ENDIF			# "$(DESCRIPTION)"!=""
157cdf0e10cSrcweir# default OOo license text!!!
158cdf0e10cSrcweir# may not fit...
159cdf0e10cSrcweir.IF "$(CUSTOM_LICENSE)"==""
160cdf0e10cSrcweir.IF "$(GUI)" == "WNT"
161cdf0e10cSrcweirPACKLICDEPS=$(SOLARBINDIR)/osl/license$$(@:b:s/_/./:e:s/./_/)$$(@:e)
162cdf0e10cSrcweir.ELSE			# "$(GUI)" == "WNT"
163cdf0e10cSrcweirPACKLICDEPS=$(SOLARBINDIR)/osl/LICENSE$$(@:b:s/_/./:e:s/./_/)$$(@:e)
164cdf0e10cSrcweir.ENDIF			# "$(GUI)" == "WNT"
165cdf0e10cSrcweir.ELSE			# "$(CUSTOM_LICENSE)" == ""
166cdf0e10cSrcweirPACKLICDEPS=$(CUSTOM_LICENSE)
167cdf0e10cSrcweir.ENDIF			# "$(CUSTOM_LICENSE)" == ""
168cdf0e10cSrcweir.IF "$(PACKLICS)"!=""
169cdf0e10cSrcweir$(PACKLICS) : $(PACKLICDEPS)
170cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
171cdf0e10cSrcweir	$(COMMAND_ECHO)$(GNUCOPY) $< $@
172cdf0e10cSrcweir.ENDIF			# "$(PACKLICS)"!=""
173cdf0e10cSrcweir
174cdf0e10cSrcweir.IF "$(COMPONENT_MANIFEST)"!=""
175cdf0e10cSrcweir#$(COMPONENT_MANIFEST) : $$(@:f)
176cdf0e10cSrcweir$(COMPONENT_MANIFEST) : $(MANIFEST_SRC) $(MANIFEST_DEPS)
177cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
178cdf0e10cSrcweir.IF "$(COMPONENT_MANIFEST_GENERIC)" == ""
179cdf0e10cSrcweir	$(COMMAND_ECHO)$(TYPE) $(MANIFEST_SRC) | $(SED) "s/SHARED_EXTENSION/$(DLLPOST)/" | $(SED) "s/EXEC_EXTENSION/$(EXECPOST)/" > $@
180cdf0e10cSrcweir.ELSE			# "$(COMPONENT_MANIFEST_GENERIC)" != ""
181cdf0e10cSrcweir    $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/makemani.pl $(PRJ)/util/manifest.xml $(EXTENSIONDIR) $(COMPONENT_MANIFEST_SEARCHDIR) $(@:d:d)
182cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_MANIFEST_GENERIC)" != ""
183cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_MANIFEST)"!=""
184cdf0e10cSrcweir
185cdf0e10cSrcweirALLTAR : $(EXTENSION_PACKDEPS)
186