1*7871dc3eSAndrew Rist#**************************************************************
2*7871dc3eSAndrew Rist#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*7871dc3eSAndrew Rist#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*7871dc3eSAndrew Rist#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19*7871dc3eSAndrew Rist#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir############################################
25cdf0e10cSrcweir#
26cdf0e10cSrcweir# sample makefile for extension packing
27cdf0e10cSrcweir#
28cdf0e10cSrcweir# NOTE: not all of this is required or useful
29cdf0e10cSrcweir# for every specific case
30cdf0e10cSrcweir#
31cdf0e10cSrcweir############################################
32cdf0e10cSrcweir
33cdf0e10cSrcweirPRJ=..$/..
34cdf0e10cSrcweir
35cdf0e10cSrcweirPRJNAME=my_project
36cdf0e10cSrcweirTARGET=some_unique_target
37cdf0e10cSrcweir
38cdf0e10cSrcweir# --- Settings -----------------------------------------------------
39cdf0e10cSrcweir
40cdf0e10cSrcweir.INCLUDE: settings.mk
41cdf0e10cSrcweir# it might be useful to have an extension wide include to set things
42cdf0e10cSrcweir# like the EXTNAME variable (used for configuration processing)
43cdf0e10cSrcweir# .INCLUDE :  $(PRJ)$/source$/<extension name>$/<extension_name>.pmk
44cdf0e10cSrcweir
45cdf0e10cSrcweir# --- Files --------------------------------------------------------
46cdf0e10cSrcweir
47cdf0e10cSrcweir# name for uniq directory
48cdf0e10cSrcweirEXTENSIONNAME:=MyExtension
49cdf0e10cSrcweirEXTENSION_ZIPNAME:=MyExtension
50cdf0e10cSrcweir
51cdf0e10cSrcweir.IF "$(ENABLE_MYEXTENSION)" != "YES"
52cdf0e10cSrcweir@all:
53cdf0e10cSrcweir	@echo "$(EXTENSIONNAME) - extension disabled."
54cdf0e10cSrcweir.ENDIF
55cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"==""
56cdf0e10cSrcweir@all:
57cdf0e10cSrcweir	@echo "$(EXTENSIONNAME) - extension requires java."
58cdf0e10cSrcweir.ENDIF
59cdf0e10cSrcweir
60cdf0e10cSrcweir
61cdf0e10cSrcweir# some other targets to be done
62cdf0e10cSrcweir
63cdf0e10cSrcweir
64cdf0e10cSrcweir
65cdf0e10cSrcweir# --- Extension packaging ------------------------------------------
66cdf0e10cSrcweir
67cdf0e10cSrcweir# these variables are optional and defaulted to the current directory
68cdf0e10cSrcweir
69cdf0e10cSrcweirDESCRIPTION_SRC:=config$/description.xml
70cdf0e10cSrcweirMANIFEST_SRC:=config$/manifest.xml
71cdf0e10cSrcweirCOMPONENT_CONFIGDIR:=config
72cdf0e10cSrcweir
73cdf0e10cSrcweir# ------------------------------------------------------------------
74cdf0e10cSrcweir
75cdf0e10cSrcweir# optional: generated list of .xcu files contained in the extension
76cdf0e10cSrcweirCOMPONENT_MANIFEST_GENERIC:=TRUE
77cdf0e10cSrcweirCOMPONENT_MANIFEST_SEARCHDIR:=registry
78cdf0e10cSrcweir
79cdf0e10cSrcweir
80cdf0e10cSrcweir# variables to trigger predifined targets
81cdf0e10cSrcweir# just copy:
82cdf0e10cSrcweirCOMPONENT_FILES= \
83cdf0e10cSrcweir    $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
84cdf0e10cSrcweir    $(EXTENSIONDIR)$/some_local.html
85cdf0e10cSrcweir
86cdf0e10cSrcweir# localized configuration files
87cdf0e10cSrcweirCOMPONENT_MERGED_XCU= \
88cdf0e10cSrcweir    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Addons.xcu \
89cdf0e10cSrcweir    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/extension$/MyExtension.xcu
90cdf0e10cSrcweir
91cdf0e10cSrcweir# other configuration files
92cdf0e10cSrcweirCOMPONENT_XCU= \
93cdf0e10cSrcweir    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Data.xcu
94cdf0e10cSrcweir
95cdf0e10cSrcweir# location of configurationfiles inside extension,
96cdf0e10cSrcweir# "." for flat .xcu files
97cdf0e10cSrcweir#COMPONENT_CONFIGDEST=.
98cdf0e10cSrcweir
99cdf0e10cSrcweir# native libraries
100cdf0e10cSrcweirCOMPONENT_LIBRARIES= \
101cdf0e10cSrcweir    $(EXTENSIONDIR)$/$(SHL1TARGET)$(DLLPOST)
102cdf0e10cSrcweir
103cdf0e10cSrcweir# jar files
104cdf0e10cSrcweirCOMPONENT_JARFILES = \
105cdf0e10cSrcweir	$(EXTENSIONDIR)$/MyExtension.jar
106cdf0e10cSrcweir
107cdf0e10cSrcweir# disable fetching default OOo license text
108cdf0e10cSrcweir#CUSTOM_LICENSE=my_license.txt
109cdf0e10cSrcweir# override default license destination
110cdf0e10cSrcweir#PACKLICS= $(EXTENSIONDIR)$/registration$/$(CUSTOM_LICENSE)
111cdf0e10cSrcweir
112cdf0e10cSrcweir# -------------------------------
113cdf0e10cSrcweir#  variables for own targets specific to this extension; no common
114cdf0e10cSrcweir#  target available...
115cdf0e10cSrcweir#
116cdf0e10cSrcweirCONVERTER_FILE= \
117cdf0e10cSrcweir    $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
118cdf0e10cSrcweir
119cdf0e10cSrcweirCOMPONENT_DIALOGS= \
120cdf0e10cSrcweir    $(EXTENSIONDIR)$/basic$/Module1.xba \
121cdf0e10cSrcweir    $(EXTENSIONDIR)$/basic$/TargetChooser.xdl \
122cdf0e10cSrcweir    $(EXTENSIONDIR)$/basic$/dialog.xlb \
123cdf0e10cSrcweir    $(EXTENSIONDIR)$/basic$/impress.png \
124cdf0e10cSrcweir    $(EXTENSIONDIR)$/basic$/script.xlb \
125cdf0e10cSrcweir    $(EXTENSIONDIR)$/basic$/writer.png
126cdf0e10cSrcweir
127cdf0e10cSrcweir# add own targets to packing dependencies (need to be done before
128cdf0e10cSrcweir# packing the xtension
129cdf0e10cSrcweirEXTENSION_PACKDEPS=$(CONVERTER_FILE)  $(COMPONENT_DIALOGS) makefile.mk $(CUSTOM_LICENSE)
130cdf0e10cSrcweir
131cdf0e10cSrcweir# global settings for extension packing
132cdf0e10cSrcweir.INCLUDE : extension_pre.mk
133cdf0e10cSrcweir.INCLUDE : target.mk
134cdf0e10cSrcweir# global targets for extension packing
135cdf0e10cSrcweir.INCLUDE : extension_post.mk
136cdf0e10cSrcweir
137cdf0e10cSrcweir# own targets
138cdf0e10cSrcweir$(CONVERTER_FILE) : $(SOLARBINDIR)$/$$(@:f)
139cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
140cdf0e10cSrcweir    $(COPY) $< $@
141cdf0e10cSrcweir
142cdf0e10cSrcweir$(COMPONENT_DIALOGS) : dialogs$/$$(@:f)
143cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
144cdf0e10cSrcweir    $(COPY) $< $@
145cdf0e10cSrcweir
146cdf0e10cSrcweir$(CUSTOM_LICENSE) : my_license.txt
147cdf0e10cSrcweir	@@-$(MKDIRHIER) $(@:d)
148cdf0e10cSrcweir    $(COPY) $< $@
149cdf0e10cSrcweir
150