forked from mss/bonjourfoxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
76 lines (66 loc) · 2.91 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
67
68
69
70
71
72
73
74
75
76
FF_RELS = 3.0 3.5 3.6
BF_VER = 0.8.0
MIN_VER = 3.0
MAX_VER = 3.6.*
all: componentcheck xpi nixball snapshot
help:
@echo "Targets:"
@echo " xpcom\t\tbuild binaries for this platform"
@echo " dir\t\tbuild extension directories"
@echo " xpi\t\tbuild xpi from extension folders"
@echo " nixdir\t\tbuild nix source folder"
@echo " nixball\tbuild nix source tarball"
@echo " snapshot\tcreate source snapshot tarball"
@echo " all\t\tbuild xpcom, xpi and tarball"
@echo " clean\t\tremove all files generated by make"
@echo " help\t\tthis text"
xpcom:
make -C src FF_RELS="$(FF_RELS)"
dir: xpcom
@echo Creating extension folders
mkdir -p scratch && cp -r ext/* scratch
perl -pi -e "s/%%MINVER%%/$(MIN_VER)/g" scratch/install.rdf
perl -pi -e "s/%%MAXVER%%/$(MAX_VER)/g" scratch/install.rdf
perl -pi -e "s/%%VER%%/$(BF_VER)/g" scratch/install.rdf
cp src/$(MIN_VER)/*.xpt src/*.js scratch/components
@for release in $(FF_RELS); do \
mkdir -p scratch/lib/$$release && \
cp src/$$release/*.dll scratch/lib/$$release 2>/dev/null|| echo "*.dll for FF$$release missing" && \
cp src/$$release/*-universal.dylib scratch/lib/$$release 2>/dev/null|| echo "*-universal.dylib for FF$$release missing"; \
done
xpi: dir
@echo Creating bonjourfoxy-$(BF_VER).xpi
cd scratch && zip -r ../bonjourfoxy-$(BF_VER).xpi *
nixdir:
@echo Creating nix/bonjourfoxy-${BF_VER}
mkdir -p nix/bonjourfoxy-${BF_VER}/src
cp -r ext nix/bonjourfoxy-${BF_VER}/
perl -pi -e "s/%%VER%%/$(BF_VER)/g" nix/bonjourfoxy-${BF_VER}/ext/install.rdf
cp src/*.h nix/bonjourfoxy-${BF_VER}/src/
cp src/*.cpp nix/bonjourfoxy-${BF_VER}/src/
cp src/*.idl nix/bonjourfoxy-${BF_VER}/src/
cp src/*.js nix/bonjourfoxy-${BF_VER}/src/
cp src/Makefile.nix nix/bonjourfoxy-${BF_VER}/Makefile
nixball: nixdir
@echo Creating bonjourfoxy-nix-$(BF_VER).tar.gz
env COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true \
tar -cvzf bonjourfoxy-nix-$(BF_VER).tar.gz -C nix bonjourfoxy-${BF_VER}
snapshot:
@echo Creating bonjourfoxy-src-$(BF_VER).tar.gz
@find . -type f ! -path "./.git/*" ! -path "./src/3.*" ! -path "./sdk/*" \
! -path "./nix/*" ! -path "./scratch/*" ! -name ".DS_Store" \
! -name "*.xpi" ! -name "*.tar.gz" ! -name ".gitignore" \
! -name "bonjourfoxy.rdf" \
| xargs env COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar -cvzf bonjourfoxy-src-$(BF_VER).tar.gz
componentcheck: xpcom
@for release in $(FF_RELS); do \
for component in BFDNSSDService-darwin-universal.dylib BFDNSSDService.dll; do \
if [ ! -f src/$$release/$$component ]; then \
echo \ ; echo \*\* Please build src/$$release/$$component. Build will continue once it is built. \*\*; \
while [ ! -f src/$$release/$$component ]; do sleep 2; done \
fi; \
done \
done
clean:
make -C src FF_RELS="$(FF_RELS)" clean
rm -fr scratch/ nix/