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