2011-02-03 02:37:19 +03:00
|
|
|
version := 0.1.8
|
2010-09-29 00:42:26 +04:00
|
|
|
ifeq ($(TOPSRCDIR),)
|
|
|
|
export TOPSRCDIR = $(shell pwd)
|
|
|
|
endif
|
|
|
|
srcdir=$(TOPSRCDIR)/extensions/firefox-share/src/
|
|
|
|
objdir=$(TOPSRCDIR)/extensions/firefox-share/dist/
|
|
|
|
stage_dir=$(objdir)/stage
|
2011-01-27 06:51:58 +03:00
|
|
|
xpi_dir=$(TOPSRCDIR)/web/dev
|
2011-01-07 01:46:52 +03:00
|
|
|
web_dir=$(TOPSRCDIR)/web/dev
|
|
|
|
static_dir=$(TOPSRCDIR)/web/$(version)
|
2010-10-01 02:26:08 +04:00
|
|
|
webbuild_dir=$(TOPSRCDIR)/tools/webbuild
|
|
|
|
requirejs_dir=$(webbuild_dir)/requirejs
|
2010-09-29 00:42:26 +04:00
|
|
|
|
2011-01-27 06:51:58 +03:00
|
|
|
xpi_name := ffshare.xpi
|
2010-10-27 23:34:05 +04:00
|
|
|
xpi_files := chrome.manifest chrome install.rdf defaults components modules
|
2010-09-30 21:35:42 +04:00
|
|
|
dep_files := Makefile $(shell find $(srcdir) -type f)
|
2010-09-29 00:42:26 +04:00
|
|
|
|
|
|
|
SLINK = ln -sf
|
|
|
|
ifneq ($(findstring MINGW,$(shell uname -s)),)
|
|
|
|
SLINK = cp -r
|
|
|
|
export NO_SYMLINK = 1
|
|
|
|
endif
|
|
|
|
|
2010-12-09 03:15:18 +03:00
|
|
|
all: xpi
|
2010-09-30 21:35:42 +04:00
|
|
|
|
|
|
|
xpi: $(xpi_dir)/$(xpi_name)
|
2010-09-29 00:42:26 +04:00
|
|
|
|
2010-09-30 21:35:42 +04:00
|
|
|
$(xpi_dir):
|
2010-09-29 00:42:26 +04:00
|
|
|
mkdir -p $(xpi_dir)
|
2010-12-09 03:15:18 +03:00
|
|
|
|
2010-10-27 23:34:05 +04:00
|
|
|
stage_files = $(stage_dir)/defaults $(stage_dir)/chrome $(stage_dir)/install.rdf $(stage_dir)/chrome.manifest $(stage_dir)/components $(stage_dir)/modules
|
2010-09-30 21:35:42 +04:00
|
|
|
|
|
|
|
$(stage_dir):
|
2010-09-29 00:42:26 +04:00
|
|
|
mkdir -p $(stage_dir)
|
2010-09-30 21:35:42 +04:00
|
|
|
$(MAKE) $(stage_files)
|
2010-12-09 03:15:18 +03:00
|
|
|
|
2010-09-30 21:35:42 +04:00
|
|
|
$(stage_dir)/chrome.manifest: $(srcdir)/chrome.manifest
|
|
|
|
$(SLINK) $(srcdir)/chrome.manifest $(stage_dir)/chrome.manifest
|
2010-09-29 00:42:26 +04:00
|
|
|
|
2010-09-30 21:35:42 +04:00
|
|
|
$(stage_dir)/install.rdf: $(srcdir)/install.rdf
|
|
|
|
$(SLINK) $(srcdir)/install.rdf $(stage_dir)/install.rdf
|
2010-09-29 00:42:26 +04:00
|
|
|
|
2010-09-30 21:35:42 +04:00
|
|
|
$(stage_dir)/chrome: $(srcdir)/chrome
|
|
|
|
$(SLINK) $(srcdir)/chrome $(stage_dir)/chrome
|
|
|
|
|
2010-10-27 23:34:05 +04:00
|
|
|
$(stage_dir)/components: $(srcdir)/components
|
|
|
|
$(SLINK) $(srcdir)/components $(stage_dir)/components
|
|
|
|
|
|
|
|
$(stage_dir)/modules: $(srcdir)/modules
|
|
|
|
$(SLINK) $(srcdir)/modules $(stage_dir)/modules
|
|
|
|
|
2010-09-30 21:35:42 +04:00
|
|
|
$(stage_dir)/defaults: $(srcdir)/defaults
|
|
|
|
$(SLINK) $(srcdir)/defaults $(stage_dir)/defaults
|
|
|
|
|
2010-12-09 03:15:18 +03:00
|
|
|
$(xpi_dir)/$(xpi_name): $(xpi_dir) $(stage_dir) $(dep_files)
|
2010-09-29 00:42:26 +04:00
|
|
|
rm -f $(xpi_dir)/$(xpi_name)
|
2010-09-30 21:35:42 +04:00
|
|
|
cd $(stage_dir) && zip -9r $(xpi_name) $(xpi_files)
|
2010-09-29 00:42:26 +04:00
|
|
|
mv $(stage_dir)/$(xpi_name) $(xpi_dir)/$(xpi_name)
|
|
|
|
|
2010-10-01 02:26:08 +04:00
|
|
|
web: $(static_dir)
|
|
|
|
|
|
|
|
$(static_dir):
|
2010-10-01 21:01:55 +04:00
|
|
|
rsync -av $(web_dir)/ $(static_dir)/
|
2011-01-07 01:46:52 +03:00
|
|
|
|
2011-01-08 00:02:20 +03:00
|
|
|
perl -i -pe "s:version='[^']+':version='$(version)':" $(TOPSRCDIR)/setup.py
|
2011-01-07 03:10:26 +03:00
|
|
|
find $(static_dir) -name \*.html | xargs perl -i -pe 's:/dev/:/$(version)/:go'
|
|
|
|
|
2011-01-07 01:46:52 +03:00
|
|
|
cd $(static_dir) && $(requirejs_dir)/build/build.sh build.js
|
|
|
|
cd $(static_dir)/settings && $(requirejs_dir)/build/build.sh build.js
|
|
|
|
cd $(static_dir)/share && $(requirejs_dir)/build/build.sh build.js
|
2011-01-15 02:26:10 +03:00
|
|
|
cd $(static_dir)/play/designs/popup && $(requirejs_dir)/build/build.sh build.js
|
2010-10-01 02:26:08 +04:00
|
|
|
|
2010-09-29 00:42:26 +04:00
|
|
|
clean:
|
|
|
|
rm -rf $(objdir)
|
2010-10-01 02:26:08 +04:00
|
|
|
rm -rf $(static_dir)
|
2010-09-29 00:42:26 +04:00
|
|
|
|
2010-09-30 21:35:42 +04:00
|
|
|
.PHONY: xpi clean
|