merge the formfield patch from ooo-build
[ooovba.git] / odk / examples / DevelopersGuide / BasicAndDialogs / ToolkitControls / Makefile
blobcb97ceac864c827879cd1df296aa159c2ffcf366
1 #*************************************************************************
3 # $RCSfile: Makefile,v $
5 # $Revision: 1.4 $
7 # last change: $Author: obo $ $Date: 2007-01-25 11:03:04 $
9 # The Contents of this file are made available subject to the terms of
10 # the BSD license.
12 # Copyright (c) 2003 by Sun Microsystems, Inc.
13 # All rights reserved.
15 # Redistribution and use in source and binary forms, with or without
16 # modification, are permitted provided that the following conditions
17 # are met:
18 # 1. Redistributions of source code must retain the above copyright
19 # notice, this list of conditions and the following disclaimer.
20 # 2. Redistributions in binary form must reproduce the above copyright
21 # notice, this list of conditions and the following disclaimer in the
22 # documentation and/or other materials provided with the distribution.
23 # 3. Neither the name of Sun Microsystems, Inc. nor the names of its
24 # contributors may be used to endorse or promote products derived
25 # from this software without specific prior written permission.
27 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
34 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
35 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
36 # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
37 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 #**************************************************************************
41 # Builds the CreatingDialogs example of the Developers Guide.
43 PRJ=../../../..
44 SETTINGS=$(PRJ)/settings
46 include $(SETTINGS)/settings.mk
47 include $(SETTINGS)/std.mk
48 include $(SETTINGS)/dk.mk
50 # Define non-platform/compiler specific settings
51 SAMPLE_NAME=BaDToolkitControls
52 SAMPLE_GEN_OUT=$(OUT_MISC)/$(SAMPLE_NAME)
54 COMP_NAME=ToolkitControls
55 COMP_GEN_OUT=$(SAMPLE_GEN_OUT)/$(COMP_NAME)
56 COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
57 COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
58 COMP_UNOPKG_MANIFEST = $(COMP_GEN_OUT)/META-INF/manifest.xml
59 COMP_REGISTERFLAG=$(COMP_GEN_OUT)$(PS)devguide_basic_$(COMP_NAME)_register_component.flag
61 COMP_LIBRARY_FILES=\
62 ToolkitControls/dialog.xlb\
63 ToolkitControls/FileDialog.xba\
64 ToolkitControls/FileDialogDlg.xdl\
65 ToolkitControls/MultiPage.xba\
66 ToolkitControls/MultiPageDlg.xdl\
67 ToolkitControls/ProgressBar.xba\
68 ToolkitControls/ProgressBarDlg.xdl\
69 ToolkitControls/script.xlb\
70 ToolkitControls/ScrollBar.xba\
71 ToolkitControls/ScrollBarDlg.xdl
73 # Targets
74 .PHONY: ALL
75 ALL : $(SAMPLE_NAME)
77 include $(SETTINGS)/stdtarget.mk
79 # rule for component package manifest
80 $(COMP_GEN_OUT)/%/manifest.xml :
81 -$(MKDIR) $(subst /,$(PS),$(@D))
82 @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
83 @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
84 @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
85 @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.basic-library$(QM)" >> $@
86 @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_NAME)$(QM)"/$(CSEP) >> $@
87 @echo $(OSEP)/manifest:manifest$(CSEP) >> $@
89 # rule for component package file
90 $(COMP_PACKAGE) : $(COMP_UNOPKG_MANIFEST) $(COMP_LIBRARY_FILES)
91 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
92 -$(MKDIR) $(subst /,$(PS),$(@D))
93 $(SDK_ZIP) $@ ToolkitControls/dialog.xlb \
94 ToolkitControls/FileDialog.xba ToolkitControls/FileDialogDlg.xdl \
95 ToolkitControls/MultiPage.xba ToolkitControls/MultiPageDlg.xdl \
96 ToolkitControls/ProgressBar.xba ToolkitControls/ProgressBarDlg.xdl \
97 ToolkitControls/script.xlb ToolkitControls/ScrollBar.xba \
98 ToolkitControls/ScrollBarDlg.xdl
99 cd $(subst /,$(PS),$(COMP_GEN_OUT)) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
101 $(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
102 ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
103 -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
104 -$(MKDIR) $(subst /,$(PS),$(@D))
105 $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
106 @echo flagged > $(subst /,$(PS),$@)
107 else
108 @echo --------------------------------------------------------------------------------
109 @echo If you want to install your component automatically, please set the environment
110 @echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only
111 @echo possible if no office instance is running.
112 @echo --------------------------------------------------------------------------------
113 endif
115 $(SAMPLE_NAME) : $(COMP_REGISTERFLAG)
116 @echo --------------------------------------------------------------------------------
117 @echo The "$(QM)ToolkitControls$(QM)" library was installed in your office installation
118 @echo if SDK_AUTO_DEPLOYMENT = YES. You can use it in the BASIC IDE as a normal
119 @echo Basic library.
120 @echo You can also load the document "$(QM)$(COMP_NAME).odt$(QM)" and press a button
121 @echo to run one of the example macros.
122 @echo -
123 @echo $(MAKE) $(COMP_NAME).odt.load
124 @echo --------------------------------------------------------------------------------
126 $(COMP_NAME).odt.load : $(COMP_REGISTERFLAG)
127 "$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(basename $@)
129 .PHONY: clean
130 clean :
131 -$(DELRECURSIVE) $(subst /,$(PS),$(COMP_GEN_OUT))
132 -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))