tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / odk / examples / DevelopersGuide / Components / Addons / ProtocolHandlerAddon_cpp / Makefile
blob239b7e283ea76e67e8fe627f23251d62430631e4
1 #*************************************************************************
3 # The Contents of this file are made available subject to the terms of
4 # the BSD license.
5 #
6 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # All rights reserved.
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
11 # are met:
12 # 1. Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in the
16 # documentation and/or other materials provided with the distribution.
17 # 3. Neither the name of Sun Microsystems, Inc. nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
30 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
31 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #**************************************************************************
35 # Builds the ProtocolHandlerAddon C++ component example of the SDK.
37 PRJ=../../../../..
38 SETTINGS=$(PRJ)/settings
40 include $(SETTINGS)/settings.mk
41 include $(SETTINGS)/std.mk
43 # Define non-platform/compiler specific settings
44 COMP_NAME=ProtocolHandlerAddon_cpp
45 COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
46 OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME)
47 OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME)
48 OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
49 COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
50 COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
51 COMP_UNOPKG_MANIFEST = $(OUT_COMP_GEN)/$(COMP_NAME)/META-INF/manifest.xml
52 COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components
54 REGISTERFLAG = $(OUT_MISC)/cpp_$(COMP_NAME)_register_component.flag
56 CXXFILES = component.cxx \
57 addon.cxx
59 SLOFILES = $(patsubst %.cxx,$(OUT_COMP_SLO)/%.$(OBJ_EXT),$(CXXFILES))
61 # Targets
62 .PHONY: ALL
63 ALL : \
64 Example
66 include $(SETTINGS)/stdtarget.mk
68 $(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
69 -$(MKDIR) $(subst /,$(PS),$(@D))
70 $(CC) $(CC_FLAGS) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
72 ifeq "$(OS)" "WIN"
73 $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
74 -$(MKDIR) $(subst /,$(PS),$(@D))
75 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
76 $(LINK) $(COMP_LINK_FLAGS) /OUT:$@ \
77 /MAP:$(OUT_COMP_GEN)/$(subst $(SHAREDLIB_EXT),map,$(@F)) $(SLOFILES) \
78 $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) msvcprt.lib $(LIBO_SDK_LDFLAGS_STDLIBS)
79 $(LINK_MANIFEST)
80 else
81 $(SHAREDLIB_OUT)/%.$(SHAREDLIB_EXT) : $(SLOFILES)
82 -$(MKDIR) $(subst /,$(PS),$(@D))
83 $(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(SLOFILES) \
84 $(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STC++LIB)
85 ifeq "$(OS)" "MACOSX"
86 $(INSTALL_NAME_URELIBS) $@
87 endif
88 endif
90 # rule for component package manifest
91 $(OUT_COMP_GEN)/%/manifest.xml :
92 -$(MKDIR) $(subst /,$(PS),$(@D))
93 @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
94 @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
95 @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
96 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
97 @echo $(SQM) $(SQM)manifest:full-path="$(QM)Addons.xcu$(QM)"/$(CSEP) >> $@
98 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
99 @echo $(SQM) $(SQM)manifest:full-path="$(QM)ProtocolHandler.xcu$(QM)"/$(CSEP) >> $@
100 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components;platform=$(UNOPKG_PLATFORM)$(QM)">> $@
101 @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME).components$(QM)"/$(CSEP)>> $@
102 @echo $(OSEP)/manifest:manifest$(CSEP) >> $@
104 $(COMP_COMPONENTS) :
105 -$(MKDIR) $(subst /,$(PS),$(@D))
106 @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
107 @echo $(OSEP)components xmlns="$(QM)http://openoffice.org/2010/uno-components$(QM)"$(CSEP) >> $@
108 @echo $(SQM) $(SQM)$(OSEP)component loader="$(QM)com.sun.star.loader.SharedLibrary$(QM)" uri="$(QM)$(UNOPKG_PLATFORM)/$(COMP_IMPL_NAME)$(QM)"$(CSEP) >> $@
109 @echo $(SQM) $(SQM)$(OSEP)implementation name="$(QM)org.openoffice.Office.addon.example$(QM)"$(CSEP) >> $@
110 @echo $(SQM) $(SQM)$(OSEP)service name="$(QM)com.sun.star.frame.ProtocolHandler$(QM)"/$(CSEP) >> $@
111 @echo $(SQM) $(SQM)$(OSEP)/implementation$(CSEP) >> $@
112 @echo $(SQM) $(SQM)$(OSEP)/component$(CSEP) >> $@
113 @echo $(OSEP)/components$(CSEP) >> $@
115 # rule for component package file
116 $(COMP_PACKAGE) : $(SHAREDLIB_OUT)/$(COMP_IMPL_NAME) Addons.xcu ProtocolHandler.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
117 -$(MKDIR) $(subst /,$(PS),$(@D)) && $(DEL) $(subst \\,\,$(subst /,$(PS),$@))
118 -$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
119 $(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
120 cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) ../../bin/$(@F) $(COMP_NAME).components
121 cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u ../../bin/$(@F) $(UNOPKG_PLATFORM)/$(<F)
122 $(SDK_ZIP) -u $@ Addons.xcu ProtocolHandler.xcu
123 cd $(subst /,$(PS),$(OUT_COMP_GEN)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
125 $(REGISTERFLAG) : $(COMP_PACKAGE)
126 ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
127 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
128 $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
129 @echo flagged > $(subst /,$(PS),$@)
130 else
131 @echo --------------------------------------------------------------------------------
132 @echo If you want to install your component automatically, please set the environment
133 @echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only
134 @echo possible if no office instance is running.
135 @echo --------------------------------------------------------------------------------
136 endif
138 Example : $(REGISTERFLAG)
139 @echo --------------------------------------------------------------------------------
140 @echo The "$(QM)ProtocolHandler$(QM)" addon component was installed if SDK_AUTO_DEPLOYMENT = YES.
141 @echo You can use this component inside your office installation, see the example
142 @echo description.
143 @echo --------------------------------------------------------------------------------
145 .PHONY: clean
146 clean :
147 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
148 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
149 -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
150 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
151 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_COMPONENTS)))
152 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(REGISTERFLAG)))
153 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(SHAREDLIB_OUT)/$(COMP_NAME).*))