1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28############################################
29#
30# sample makefile for extension packing
31#
32# NOTE: not all of this is required or useful
33# for every specific case
34#
35############################################
36
37PRJ=..$/..
38
39PRJNAME=my_project
40TARGET=some_unique_target
41
42# --- Settings -----------------------------------------------------
43
44.INCLUDE: settings.mk
45# it might be useful to have an extension wide include to set things
46# like the EXTNAME variable (used for configuration processing)
47# .INCLUDE :  $(PRJ)$/source$/<extension name>$/<extension_name>.pmk
48
49# --- Files --------------------------------------------------------
50
51# name for uniq directory
52EXTENSIONNAME:=MyExtension
53EXTENSION_ZIPNAME:=MyExtension
54
55.IF "$(ENABLE_MYEXTENSION)" != "YES"
56@all:
57	@echo "$(EXTENSIONNAME) - extension disabled."
58.ENDIF
59.IF "$(SOLAR_JAVA)"==""
60@all:
61	@echo "$(EXTENSIONNAME) - extension requires java."
62.ENDIF
63
64
65# some other targets to be done
66
67
68
69# --- Extension packaging ------------------------------------------
70
71# these variables are optional and defaulted to the current directory
72
73DESCRIPTION_SRC:=config$/description.xml
74MANIFEST_SRC:=config$/manifest.xml
75COMPONENT_CONFIGDIR:=config
76
77# ------------------------------------------------------------------
78
79# optional: generated list of .xcu files contained in the extension
80COMPONENT_MANIFEST_GENERIC:=TRUE
81COMPONENT_MANIFEST_SEARCHDIR:=registry
82
83
84# variables to trigger predifined targets
85# just copy:
86COMPONENT_FILES= \
87    $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
88    $(EXTENSIONDIR)$/some_local.html
89
90# localized configuration files
91COMPONENT_MERGED_XCU= \
92    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Addons.xcu \
93    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/extension$/MyExtension.xcu
94
95# other configuration files
96COMPONENT_XCU= \
97    $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Data.xcu
98
99# location of configurationfiles inside extension,
100# "." for flat .xcu files
101#COMPONENT_CONFIGDEST=.
102
103# native libraries
104COMPONENT_LIBRARIES= \
105    $(EXTENSIONDIR)$/$(SHL1TARGET)$(DLLPOST)
106
107# jar files
108COMPONENT_JARFILES = \
109	$(EXTENSIONDIR)$/MyExtension.jar
110
111# disable fetching default OOo license text
112#CUSTOM_LICENSE=my_license.txt
113# override default license destination
114#PACKLICS= $(EXTENSIONDIR)$/registration$/$(CUSTOM_LICENSE)
115
116# -------------------------------
117#  variables for own targets specific to this extension; no common
118#  target available...
119#
120CONVERTER_FILE= \
121    $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
122
123COMPONENT_DIALOGS= \
124    $(EXTENSIONDIR)$/basic$/Module1.xba \
125    $(EXTENSIONDIR)$/basic$/TargetChooser.xdl \
126    $(EXTENSIONDIR)$/basic$/dialog.xlb \
127    $(EXTENSIONDIR)$/basic$/impress.png \
128    $(EXTENSIONDIR)$/basic$/script.xlb \
129    $(EXTENSIONDIR)$/basic$/writer.png
130
131# add own targets to packing dependencies (need to be done before
132# packing the xtension
133EXTENSION_PACKDEPS=$(CONVERTER_FILE)  $(COMPONENT_DIALOGS) makefile.mk $(CUSTOM_LICENSE)
134
135# global settings for extension packing
136.INCLUDE : extension_pre.mk
137.INCLUDE : target.mk
138# global targets for extension packing
139.INCLUDE : extension_post.mk
140
141# own targets
142$(CONVERTER_FILE) : $(SOLARBINDIR)$/$$(@:f)
143	@@-$(MKDIRHIER) $(@:d)
144    $(COPY) $< $@
145
146$(COMPONENT_DIALOGS) : dialogs$/$$(@:f)
147	@@-$(MKDIRHIER) $(@:d)
148    $(COPY) $< $@
149
150$(CUSTOM_LICENSE) : my_license.txt
151	@@-$(MKDIRHIER) $(@:d)
152    $(COPY) $< $@
153
154