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
28PRJ=../../..
29PRJNAME=extensions
30TARGET=spotlightplugin
31
32# --- Settings ----------------------------------
33.INCLUDE : settings.mk
34
35.IF "$(OS)"!="MACOSX"
36dummy:
37    @echo Not using Mac OS X - nothing to build
38.ENDIF
39
40# --- Files -------------------------------------
41
42# ... object files ............................
43SLOFILES= \
44        $(SLO)$/ioapi.obj                \
45        $(SLO)$/unzip.obj                \
46        $(SLO)$/main.obj                 \
47        $(SLO)$/GetMetadataForFile.obj   \
48        $(SLO)$/OOoContentDataParser.obj \
49        $(SLO)$/OOoMetaDataParser.obj    \
50        $(SLO)$/OOoSpotlightImporter.obj \
51
52BUNDLE =    $(MISC)$/OOoSpotlightImporter.mdimporter
53CONTENTS =  $(BUNDLE)$/Contents
54RESOURCES = $(CONTENTS)$/Resources
55MACOS =     $(CONTENTS)$/MacOS
56
57BUNDLELIBS= -framework CoreFoundation \
58            -framework Foundation     \
59            -framework CoreServices   \
60            $(ZLIB3RDLIB)
61
62plistfiles  = $(CONTENTS)$/Info.plist
63binaries =    $(MACOS)$/OOoSpotlightImporter
64resources =   $(RESOURCES)/en.lproj/schema.strings \
65              $(RESOURCES)/schema.xml
66
67ZIPFLAGS = -r
68ZIP1TARGET = mdibundle
69ZIP1DIR = $(CONTENTS)
70ZIP1LIST = *
71
72
73# --- Targets ----------------------------------
74
75.INCLUDE : target.mk
76
77.IF "$(ZIP1TARGETN)"!=""
78$(ZIP1TARGETN) : $(plistfiles) $(binaries) $(resources)
79
80.ENDIF          # "$(ZIP1TARGETN)"!=""
81
82# Info.plist is just versioned and copied into the bundle
83$(CONTENTS)$/%.plist : mdimporter/%.plist
84    $(MKDIRHIER) $(@:d)
85    $(COPY) "$<" "$@"
86
87$(MACOS)$/OOoSpotlightImporter: $(SLOFILES)
88    $(MKDIRHIER) $(@:d)
89    $(CC) -o $(MACOS)$/OOoSpotlightImporter $(SLOFILES:s/.obj/.o/) $(EXTRA_LINKFLAGS) $(BUNDLELIBS) -bundle
90# we have to change the zlib install name, otherwise the plugin will not work
91    .IF "$(SYSTEM_ZLIB)"=="NO"
92    install_name_tool -change @executable_path/libz.1.dylib @executable_path/../../../../MacOS/libz.1.dylib $(MACOS)$/OOoSpotlightImporter
93    .ENDIF
94
95#the resources are just copied
96$(RESOURCES)$/% : mdimporter/%
97    $(MKDIRHIER) $(@:d)
98    $(COPY) "$<" "$@"
99
100