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