1 #*************************************************************************
3 # The Contents of this file are made available subject to the terms of
6 # Copyright 2000, 2010 Oracle and/or its affiliates.
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
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 CreatingDialogs example of the Developers Guide.
38 SETTINGS
=$(PRJ
)/settings
40 include $(SETTINGS
)/settings.mk
41 include $(SETTINGS
)/std.mk
43 # Define non-platform/compiler specific settings
44 SAMPLE_NAME
=BaDToolkitControls
45 SAMPLE_GEN_OUT
=$(OUT_MISC
)/$(SAMPLE_NAME
)
47 COMP_NAME
=ToolkitControls
48 COMP_GEN_OUT
=$(SAMPLE_GEN_OUT
)/$(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
= $(COMP_GEN_OUT
)/META-INF
/manifest.xml
52 COMP_REGISTERFLAG
=$(COMP_GEN_OUT
)$(PS
)devguide_basic_
$(COMP_NAME
)_register_component.flag
55 ToolkitControls
/dialog.xlb\
56 ToolkitControls
/FileDialog.xba\
57 ToolkitControls
/FileDialogDlg.xdl\
58 ToolkitControls
/MultiPage.xba\
59 ToolkitControls
/MultiPageDlg.xdl\
60 ToolkitControls
/ProgressBar.xba\
61 ToolkitControls
/ProgressBarDlg.xdl\
62 ToolkitControls
/script.xlb\
63 ToolkitControls
/ScrollBar.xba\
64 ToolkitControls
/ScrollBarDlg.xdl
70 include $(SETTINGS
)/stdtarget.mk
72 # rule for component package manifest
73 $(COMP_GEN_OUT
)/%/manifest.xml
:
74 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
75 @echo
$(OSEP
)?xml version
="$(QM)1.0$(QM)" encoding
="$(QM)UTF-8$(QM)"?
$(CSEP
) > $@
76 @echo
$(OSEP
)!DOCTYPE manifest
:manifest PUBLIC
"$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP
) >> $@
77 @echo
$(OSEP
)manifest
:manifest xmlns
:manifest
="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP
) >> $@
78 @echo
$(SQM
) $(SQM
)$(OSEP
)manifest
:file-entry manifest
:media-type
="$(QM)application/vnd.sun.star.basic-library$(QM)" >> $@
79 @echo
$(SQM
) $(SQM
)manifest
:full-path
="$(QM)$(COMP_NAME)$(QM)"/$(CSEP
) >> $@
80 @echo
$(OSEP
)/manifest
:manifest
$(CSEP
) >> $@
82 # rule for component package file
83 $(COMP_PACKAGE
) : $(COMP_UNOPKG_MANIFEST
) $(COMP_LIBRARY_FILES
)
84 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$@
))
85 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
86 $(SDK_ZIP
) $@ ToolkitControls
/dialog.xlb \
87 ToolkitControls
/FileDialog.xba ToolkitControls
/FileDialogDlg.xdl \
88 ToolkitControls
/MultiPage.xba ToolkitControls
/MultiPageDlg.xdl \
89 ToolkitControls
/ProgressBar.xba ToolkitControls
/ProgressBarDlg.xdl \
90 ToolkitControls
/script.xlb ToolkitControls
/ScrollBar.xba \
91 ToolkitControls
/ScrollBarDlg.xdl
92 cd
$(subst /,$(PS
),$(COMP_GEN_OUT
)) && $(SDK_ZIP
) -u ..
/..
/..
/bin
/$(@F
) META-INF
/manifest.xml
94 $(COMP_REGISTERFLAG
) : $(COMP_PACKAGE
)
95 ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
96 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$@
))
97 -$(MKDIR
) $(subst /,$(PS
),$(@D
))
98 $(DEPLOYTOOL
) $(COMP_PACKAGE_URL
)
99 @echo flagged
> $(subst /,$(PS
),$@
)
101 @echo
--------------------------------------------------------------------------------
102 @echo If you want to
install your component automatically
, please set the environment
103 @echo variable SDK_AUTO_DEPLOYMENT
= YES. But note that auto deployment is only
104 @echo possible if no office instance is running.
105 @echo
--------------------------------------------------------------------------------
108 $(SAMPLE_NAME
) : $(COMP_REGISTERFLAG
)
109 @echo
--------------------------------------------------------------------------------
110 @echo The
"$(QM)ToolkitControls$(QM)" library was installed in your office installation
111 @echo if SDK_AUTO_DEPLOYMENT
= YES. You can use it in the BASIC IDE
as a normal
113 @echo You can also load the document
"$(QM)$(COMP_NAME).odt$(QM)" and press a button
114 @echo to run one of the example macros.
116 @echo
$(MAKE
) $(COMP_NAME
).odt.load
117 @echo
--------------------------------------------------------------------------------
119 $(COMP_NAME
).odt.load
: $(COMP_REGISTERFLAG
)
120 "$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(basename $@
)
124 -$(DELRECURSIVE
) $(subst /,$(PS
),$(COMP_GEN_OUT
))
125 -$(DEL
) $(subst \\,\
,$(subst /,$(PS
),$(COMP_PACKAGE_URL
)))