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