1
# Copyright (C) 2008 - 2009 Harri Pitkänen <hatapitk@iki.fi>
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
5
# as published by the Free Software Foundation; either version 2
6
# of the License, or (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
DESTDIR=/usr/lib/firefox
19
CC_LINK=g++ -shared -Wl,--no-undefined
20
include ../mozvoikko.config
22
XULRUNNER_INCLUDES=$(shell pkg-config --cflags libxul-unstable)
23
XULRUNNER_LIBS=$(shell pkg-config --libs libxul-unstable)
25
HEADERS=mozVoikko.hxx mozVoikkoSpell.hxx mozVoikkoUtils.hxx
26
OBJECTS=mozVoikko mozVoikkoSpell mozVoikkoUtils mozVoikkoSpellFactory
27
COMPONENT=libmozvoikko.so
28
EXTENSION=mozvoikko.xpi
29
UUID={b676e3ff-cda7-4e0c-b2b8-74e4bb40a67a}
34
CC_FLAGS=$(CFLAGS) -Wall -Werror -Wno-non-virtual-dtor -fno-rtti -fno-exceptions -fPIC
35
CC_INCLUDES=$(XULRUNNER_INCLUDES) -include mozilla-config.h -include xpcom-config.h
36
CC_DEFINES=-DSYSTEM_LIBVOIKKO
37
CC_LIBS=-Wl,--as-needed $(XULRUNNER_LIBS)
39
.PHONY: all clean xpi extension-files install-unpacked
45
extension-files: components/$(COMPONENT) install.rdf
47
$(EXTENSION): components/$(COMPONENT) install.rdf
50
components/$(COMPONENT): $(patsubst %,%.o,$(OBJECTS))
52
$(CC_LINK) -o $@ $^ $(CC_LIBS)
55
$(CC) $(CC_FLAGS) $(CC_INCLUDES) $(CC_DEFINES) -o $@ $<
57
INSTALL_RDF_SEDSCRIPT="s/@FF_MIN@/$(MOZVOIKKO_FF_MIN)/g; \
59
s/@TB_MIN@/$(MOZVOIKKO_TB_MIN)/g; \
61
s/@SM_MIN@/$(MOZVOIKKO_SM_MIN)/g; \
63
s/@VERSION@/$(MOZVOIKKO_VERSION)/g; \
65
install.rdf: install.rdf.in
66
sed -e $(INSTALL_RDF_SEDSCRIPT) < $^ > $@
69
$(RM) $(patsubst %,%.o,$(OBJECTS)) $(EXTENSION) install.rdf chrome.manifest
72
install-unpacked: extension-files
73
echo "binary-component components/libmozvoikko.so" > chrome.manifest
74
install -m 755 -d '$(DESTDIR)/$(UUID)' '$(DESTDIR)/$(UUID)/components'
75
install -m 644 'components/$(COMPONENT)' '$(DESTDIR)/$(UUID)/components'
76
install -m 644 install.rdf '$(DESTDIR)/$(UUID)'
77
install -m 644 chrome.manifest '$(DESTDIR)/$(UUID)'