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
24############################################
25#
26# sample makefile for extension packing
27#
28# NOTE: not all of this is required or useful
29# for every specific case
30#
31############################################
32
33PRJ=..$/..
34
35PRJNAME=my_project
36TARGET=some_unique_target
37
38# --- Settings -----------------------------------------------------
39
40.INCLUDE: settings.mk
41# it might be useful to have an extension wide include to set things
42# like the EXTNAME variable (used for configuration processing)
43# .INCLUDE :  $(PRJ)$/source$/<extension name>$/<extension_name>.pmk
44
45# --- Files --------------------------------------------------------
46
47# name for uniq directory
48EXTENSIONNAME:=MyExtension
49EXTENSION_ZIPNAME:=MyExtension
50
51.IF "$(ENABLE_MYEXTENSION)" != "YES"
52@all:
53	@echo "$(EXTENSIONNAME) - extension disabled."
54.ENDIF
55.IF "$(SOLAR_JAVA)"==""
56@all:
57	@echo "$(EXTENSIONNAME) - extension requires java."
58.ENDIF
59
60
61# some other targets to be done
62
63
64
65# --- Extension packaging ------------------------------------------
66
67# these variables are optional and defaulted to the current directory
68
69DESCRIPTION_SRC:=config$/description.xml
70MANIFEST_SRC:=config$/manifest.xml
71COMPONENT_CONFIGDIR:=config
72
73# ------------------------------------------------------------------
74
75# optional: generated list of .xcu files contained in the extension
76COMPONENT_MANIFEST_GENERIC:=TRUE
77COMPONENT_MANIFEST_SEARCHDIR:=registry
78
79
80# variables to trigger predifined targets
81# just copy:
82COMPONENT_FILES= \
83    $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
84    $(EXTENSIONDIR)$/some_local.html
85
86# localized configuration files
87COMPONENT_MERGED_XCU= \
88    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Addons.xcu \
89    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/extension$/MyExtension.xcu
90
91# other configuration files
92COMPONENT_XCU= \
93    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Data.xcu
94
95# location of configurationfiles inside extension,
96# "." for flat .xcu files
97#COMPONENT_CONFIGDEST=.
98
99# native libraries
100COMPONENT_LIBRARIES= \
101    $(EXTENSIONDIR)$/$(SHL1TARGET)$(DLLPOST)
102
103# jar files
104COMPONENT_JARFILES = \
105	$(EXTENSIONDIR)$/MyExtension.jar
106
107# disable fetching default OOo license text
108#CUSTOM_LICENSE=my_license.txt
109# override default license destination
110#PACKLICS= $(EXTENSIONDIR)$/registration$/$(CUSTOM_LICENSE)
111
112# -------------------------------
113#  variables for own targets specific to this extension; no common
114#  target available...
115#
116CONVERTER_FILE= \
117    $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
118
119COMPONENT_DIALOGS= \
120    $(EXTENSIONDIR)$/basic$/Module1.xba \
121    $(EXTENSIONDIR)$/basic$/TargetChooser.xdl \
122    $(EXTENSIONDIR)$/basic$/dialog.xlb \
123    $(EXTENSIONDIR)$/basic$/impress.png \
124    $(EXTENSIONDIR)$/basic$/script.xlb \
125    $(EXTENSIONDIR)$/basic$/writer.png
126
127# add own targets to packing dependencies (need to be done before
128# packing the xtension
129EXTENSION_PACKDEPS=$(CONVERTER_FILE)  $(COMPONENT_DIALOGS) makefile.mk $(CUSTOM_LICENSE)
130
131# global settings for extension packing
132.INCLUDE : extension_pre.mk
133.INCLUDE : target.mk
134# global targets for extension packing
135.INCLUDE : extension_post.mk
136
137# own targets
138$(CONVERTER_FILE) : $(SOLARBINDIR)$/$$(@:f)
139	@@-$(MKDIRHIER) $(@:d)
140    $(COPY) $< $@
141
142$(COMPONENT_DIALOGS) : dialogs$/$$(@:f)
143	@@-$(MKDIRHIER) $(@:d)
144    $(COPY) $< $@
145
146$(CUSTOM_LICENSE) : my_license.txt
147	@@-$(MKDIRHIER) $(@:d)
148    $(COPY) $< $@
149
150