~sircmpwn/himitsu-firefox

ref: f9b406932c8642b860af4a66f598694e91a991e3 himitsu-firefox/Makefile -rw-r--r-- 1.3 KiB
f9b40693Drew DeVault Makefile: install manifest.json in correct path 5 months ago
                                                                                
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
.POSIX:
.SUFFIXES:
HARE=hare
HAREFLAGS=

DESTDIR=
PREFIX=/usr/local
LIBDIR=$(PREFIX)/lib
LIBEXECDIR=$(PREFIX)/libexec
MOZMSGHOSTDIR=$(LIBDIR)/mozilla/native-messaging-hosts/
MOZADDONDIR=$(LIBDIR)/firefox-esr-addons/distribution/extensions

all: native/himitsu-firefox-native native/manifest.json
all: himitsu@drewdevault.com.xpi

NATIVE_SOURCE=\
	      native/dispatch.ha \
	      native/main.ha

native/himitsu-firefox-native: $(NATIVE_SOURCE)
	cd native && $(HARE) build $(HAREFLAGS) -o himitsu-firefox-native

native/manifest.json: native/manifest.json.in
	sed -e "s:@LIBEXECDIR@:$(LIBEXECDIR):g" <$< >$@

himitsu@drewdevault.com.xpi:
	zip -r -FS $@ content icons manifest.json

install-native: native/himitsu-firefox-native native/manifest.json
	mkdir -p $(DESTDIR)$(MOZMSGHOSTDIR) $(DESTDIR)$(LIBEXECDIR)
	install -Dm755 native/himitsu-firefox-native $(DESTDIR)$(LIBEXECDIR)
	install -Dm644 native/manifest.json $(DESTDIR)$(MOZMSGHOSTDIR)/himitsu.json

install-xpi: himitsu@drewdevault.com.xpi
	mkdir -p $(DESTDIR)$(MOZADDONDIR)
	install -Dm644 himitsu@drewdevault.com.xpi $(DESTDIR)$(MOZADDONDIR)

install: install-native install-xpi

.PHONY: install-native install-xpi install

clean:
	rm -f himitsu@drewdevault.com.xpi 
	rm -f native/himitsu-firefox-native native/manifest.json

.PHONY: all clean