xref: /aoo41x/main/solenv/inc/extension_post.mk (revision e6ca2088)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew 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)
5877f0f650SHerbert Dürr	$(COMMAND_ECHO)$(COPY) $< $(@:s|$(fixme2)|$(MISC)|)
59cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_FILES)"!=""
60cdf0e10cSrcweir
61cdf0e10cSrcweir.IF "$(COMPONENT_JARFILES)"!=""
62cdf0e10cSrcweir$(COMPONENT_JARFILES) : $(CLASSDIR)/$$(@:f)
63cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
6477f0f650SHerbert Dürr	$(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)
7277f0f650SHerbert Dürr	$(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)"!=""
95*e6ca2088SHerbert Dürr.IF "$(CCNUMVER)" > "001499999999"
96cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcr90.dll $(EXTENSIONDIR)
97cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcp90.dll $(EXTENSIONDIR)
98cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/msvcm90.dll $(EXTENSIONDIR)
99cdf0e10cSrcweir	$(GNUCOPY) $(PACKMS)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
100*e6ca2088SHerbert Dürr.ENDIF 			# "$(CCNUMVER)" > "001499999999"
101cdf0e10cSrcweir.ELSE        # "$(PACKMS)"!=""
102*e6ca2088SHerbert Dürr.IF "$(CCNUMVER)" > "001499999999"
103cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcr90.dll $(EXTENSIONDIR)
104cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcp90.dll $(EXTENSIONDIR)
105cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/msvcm90.dll $(EXTENSIONDIR)
106cdf0e10cSrcweir	$(GNUCOPY) $(SOLARBINDIR)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
107*e6ca2088SHerbert Dürr.ENDIF			# "$(CCNUMVER)" > "001499999999"
108cdf0e10cSrcweir.ENDIF          # "$(PACKMS)"!=""
109cdf0e10cSrcweir.ENDIF	#"$(COM)"=="GCC"
110cdf0e10cSrcweir.ENDIF 			# "$(OS)$(CPU)"=="WNTI"
111cdf0e10cSrcweir	@$(TOUCH) $@
112cdf0e10cSrcweir.ENDIF			# "$(PACK_RUNTIME)"!=""
113cdf0e10cSrcweir
114cdf0e10cSrcweirIMPLEMENTATION_IDENTIFIER*="com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID)"
115cdf0e10cSrcweir
116cdf0e10cSrcweir.INCLUDE .IGNORE : $(MISC)/$(TARGET)_lang_track.mk
117cdf0e10cSrcweir.IF "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
118cdf0e10cSrcweirPHONYDESC=.PHONY
119cdf0e10cSrcweir.ENDIF			# "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
120cdf0e10cSrcweir.IF "$(DESCRIPTION)"!=""
121cdf0e10cSrcweir$(DESCRIPTION) $(PHONYDESC) : $(DESCRIPTION_SRC)
122cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
123cdf0e10cSrcweir	@echo LAST_WITH_LANG=$(WITH_LANG) > $(MISC)/$(TARGET)_lang_track.mk
124cdf0e10cSrcweir
125cdf0e10cSrcweir	$(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/licinserter.pl $(DESCRIPTION_SRC) $(COMPONENT_LIC_TEMPL) $@.1.$(EXTNAME)
126cdf0e10cSrcweir
127cdf0e10cSrcweir	$(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/transform_description.pl $@.1.$(EXTNAME) $@.2.$(EXTNAME)
128cdf0e10cSrcweir	@@-$(RM) $@.1.$(EXTNAME)
129cdf0e10cSrcweir
130cdf0e10cSrcweir	$(COMMAND_ECHO)$(TYPE) $@.2.$(EXTNAME) | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ >  $@.3.$(EXTNAME)
131cdf0e10cSrcweir	@@-$(RM) $@.2.$(EXTNAME)
132cdf0e10cSrcweir
133cdf0e10cSrcweir	$(COMMAND_ECHO)$(TYPE) $@.3.$(EXTNAME) | sed s/UPDATED_SUPPORTED_PLATFORM/$(PLATFORMID)/ > $@
134cdf0e10cSrcweir	@@-$(RM) $@.3.$(EXTNAME)
135cdf0e10cSrcweir
136cdf0e10cSrcweir.ENDIF			# "$(DESCRIPTION)"!=""
13777f0f650SHerbert Dürr
1382afa2055SHerbert Dürr# default license text for Apache OpenOffice extensions is ALv2
139cdf0e10cSrcweir.IF "$(CUSTOM_LICENSE)"==""
14077f0f650SHerbert DürrPACKLICDEPS=$(SOLARBINDIR)/osl/LICENSE_ALv2
141cdf0e10cSrcweir.ELSE			# "$(CUSTOM_LICENSE)" == ""
142cdf0e10cSrcweirPACKLICDEPS=$(CUSTOM_LICENSE)
143cdf0e10cSrcweir.ENDIF			# "$(CUSTOM_LICENSE)" == ""
144cdf0e10cSrcweir.IF "$(PACKLICS)"!=""
145cdf0e10cSrcweir$(PACKLICS) : $(PACKLICDEPS)
146cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
147cdf0e10cSrcweir	$(COMMAND_ECHO)$(GNUCOPY) $< $@
148cdf0e10cSrcweir.ENDIF			# "$(PACKLICS)"!=""
149cdf0e10cSrcweir
150cdf0e10cSrcweir.IF "$(COMPONENT_MANIFEST)"!=""
151cdf0e10cSrcweir#$(COMPONENT_MANIFEST) : $$(@:f)
152cdf0e10cSrcweir$(COMPONENT_MANIFEST) : $(MANIFEST_SRC) $(MANIFEST_DEPS)
153cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
154cdf0e10cSrcweir.IF "$(COMPONENT_MANIFEST_GENERIC)" == ""
155cdf0e10cSrcweir	$(COMMAND_ECHO)$(TYPE) $(MANIFEST_SRC) | $(SED) "s/SHARED_EXTENSION/$(DLLPOST)/" | $(SED) "s/EXEC_EXTENSION/$(EXECPOST)/" > $@
156cdf0e10cSrcweir.ELSE			# "$(COMPONENT_MANIFEST_GENERIC)" != ""
157cdf0e10cSrcweir    $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/makemani.pl $(PRJ)/util/manifest.xml $(EXTENSIONDIR) $(COMPONENT_MANIFEST_SEARCHDIR) $(@:d:d)
158cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_MANIFEST_GENERIC)" != ""
159cdf0e10cSrcweir.ENDIF			# "$(COMPONENT_MANIFEST)"!=""
160cdf0e10cSrcweir
161cdf0e10cSrcweirALLTAR : $(EXTENSION_PACKDEPS)
162