-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
66 lines (56 loc) · 1.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
PACKAGE = sogo-integrator
GIT_REV = $(shell git rev-parse --verify HEAD | cut -c1-10)
VERSION = $(shell awk -F'"' '/em:version="/ {print $$2}' <install.rdf)
FIND_FILTER = ! -path './custom/*' -type f
ifndef XPI_ARCHIVE
ifeq ($(build),)
XPI_ARCHIVE = $(PACKAGE)-$(VERSION)-$(GIT_REV).xpi
else
XPI_ARCHIVE = $(PACKAGE)-$(VERSION)-$(GIT_REV)-$(build).xpi
endif
endif
SHELL = /bin/bash
ZIP = /usr/bin/zip
all: custom-build MANIFEST rest
custom-build:
@if test "x$$build" == "x"; then \
echo "Building package with default settings."; \
else \
echo "Building package with custom settings for '$$build'."; \
if ! test -d custom/$$build; then \
echo "Custom build '$$build' does not exist"; \
exit 1; \
fi; fi
MANIFEST:
@echo chrome.manifest > $@
@echo NEWS >> $@
@echo COPYING >> $@
@find . $(FIND_FILTER) -name "*.dtd" >> $@
@find . $(FIND_FILTER) -name "*.gif" >> $@
@find . $(FIND_FILTER) -name "*.idl" >> $@
@find . $(FIND_FILTER) -name "*.js" >> $@
@find . $(FIND_FILTER) -name "*.css" >> $@
@find . $(FIND_FILTER) -name "*.jpg" >> $@
@find . $(FIND_FILTER) -name "*.png" >> $@
@find . $(FIND_FILTER) -name "*.properties" >> $@
@find . $(FIND_FILTER) -name "*.rdf" >> $@
@find . $(FIND_FILTER) -name "*.xpt" >> $@
@find . $(FIND_FILTER) -name "*.xul" >> $@
@find . $(FIND_FILTER) -name "*.xml" >> $@
rest:
@make $(XPI_ARCHIVE)
$(XPI_ARCHIVE): FILENAMES = $(shell cat MANIFEST)
$(XPI_ARCHIVE): $(FILENAMES)
@echo Generating $(XPI_ARCHIVE)...
@rm -f $(XPI_ARCHIVE)
@$(ZIP) -9r $(XPI_ARCHIVE) $(FILENAMES) > /dev/null
@if test "x$$build" != "x"; then \
cd custom/$$build; \
$(ZIP) -9r ../../$(XPI_ARCHIVE) * > /dev/null; \
fi
clean:
rm -f MANIFEST-pre
rm -f *.xpi
find . -name "*~" -exec rm -f {} \;
distclean: clean
rm -f MANIFEST