# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


# Specify these as parameters to the make command
XPI_MODULE	= enigmail
XPI_MODULE_VERS = 1.0.0

DEPTH		= ../../../..
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@

include $(DEPTH)/config/autoconf.mk

PREF_JS_EXPORTS = $(srcdir)/prefs/enigmail.js

include $(topsrcdir)/config/config.mk

XPIFILE = $(XPI_MODULE)-$(XPI_MODULE_VERS).xpi
LANGXPIFILE = $(XPI_MODULE)-en-US-$(XPI_MODULE_VERS).xpi

libs:
	$(INSTALL) $(srcdir)/enigmail.js $(DIST)/bin/components
	$(INSTALL) $(srcdir)/mimeDecrypt.js $(DIST)/bin/components
	$(INSTALL) $(srcdir)/mimeEncrypt.js $(DIST)/bin/components
	$(INSTALL) $(srcdir)/enigprefs-service.js $(DIST)/bin/components
	$(INSTALL) $(srcdir)/enigMsgCompFields.js $(DIST)/bin/components
	$(INSTALL) $(srcdir)/prefs/enigmail.js $(DIST)/bin/defaults/preferences
	$(INSTALL) $(srcdir)/*.jsm $(DIST)/bin/modules

clean:
	rm -f $(DIST)/bin/components/enigmail.js \
	  $(DIST)/bin/components/mimeDecrypt.js \
	  $(DIST)/bin/components/mimeEncrypt.js \
	  $(DIST)/bin/components//enigprefs-service.js \
	  $(DIST)/bin/components/enigMsgCompFields.js \
	  $(DIST)/bin/defaults/pref/enigmail.js ; \
	  for f in $(srcdir)/*.jsm ; do \
	    fn=`basename $$f`; rm -f $(DIST)/bin/modules/$$fn ; \
	  done
