-
Notifications
You must be signed in to change notification settings - Fork 4
/
makefile
50 lines (36 loc) · 1.24 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
NAME ?= 'libnamecoin.so'
.PHONY: ${NAME} clean cleanmoz
# build the shared object
${NAME}:
go generate github.com/namecoin/pkcs11mod
go get github.com/namecoin/pkcs11mod
CGO_ENABLED=1 go build -buildmode c-shared -o ${NAME}
# install libnamecoin.h and libnamecoin.so to /usr/local/namecoin/
install:
mkdir -p /usr/local/namecoin
install libnamecoin.so /usr/local/namecoin/
clean: cleanmoz
rm -vf libnamecoin.h libnamecoin.so
cleanmoz:
rm -rvf moz/web-ext-artifacts
# build extension
moz-ext: cleanmoz
cd moz && web-ext build
# test-run sandbox firefox
moz-run: cleanmoz
cd moz && web-ext run --verbose
# install pkcs11 module to mozilla directory (not extension)
moz-install:
mkdir -p /usr/lib/mozilla/pkcs11-modules/
install moz/namecoin_module.json /usr/lib/mozilla/pkcs11-modules/
# add pkcs11 module to NSS shared database
nss-shared-install:
./install_nssdb.sh ~/.pki/nssdb
# add pkcs11 module to Firefox's NSS database
nss-firefox-install:
./install_nssdb.sh ~/.mozilla/firefox/*.default
all: clean ${NAME} moz-ext
@echo now run "${MAKE} all-install" to install all (requires root)
# install all the things
install-all: install moz-install nss-shared-install
@echo now the mozilla extension zip file is ready to install on this machine