# 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/.

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

include $(DEPTH)/config/autoconf.mk

EXTRA_COMPONENTS = \
  nsSessionStore.manifest \
  $(NULL)

EXTRA_PP_COMPONENTS = \
	nsSessionStore.js \
	nsSessionStartup.js \
	$(NULL)

libs::
	$(NSINSTALL) $(srcdir)/*.jsm $(FINAL_TARGET)/modules/sessionstore

SS_EXTRA_PP_JS_MODULES = \
	SessionStore.jsm \
	$(NULL)

ifdef SS_EXTRA_PP_JS_MODULES
libs:: $(SS_EXTRA_PP_JS_MODULES)
ifndef NO_DIST_INSTALL
	$(EXIT_ON_ERROR) \
	$(NSINSTALL) -D $(FINAL_TARGET)/modules/sessionstore; \
	for i in $^; do \
	  dest=$(FINAL_TARGET)/modules/sessionstore/`basename $$i`; \
	  $(RM) -f $$dest; \
	  $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
	done
endif
endif

include $(topsrcdir)/config/rules.mk
