-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (33 loc) · 1.48 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
FIREFOX_VERSION = 14
EXT_VERSION= 2
VERSION = 1.$(FIREFOX_VERSION).$(EXT_VERSION)
BUILD_DIR = build
XPI_TARGET = kde-wallet_password_integration-$(VERSION)-fx+tb-linux.xpi
TARBAL_TARGET = kde-wallet_password_integration-$(VERSION).tar.gz
XPI_DIR = xpi
ARCH := $(shell uname -m)
# Update the ARCH variable so that the Mozilla architectures are used
ARCH := $(shell echo ${ARCH} | sed 's/i686/x86/')
LIBNAME = libkdewallet_$(ARCH).so
SOURCE = $(BUILD_DIR)/lib/libkdewallet.so
TARGET_DIR = $(XPI_DIR)/components
build: build_lib copy archive
archive: $(XPI_TARGET)
copy: $(SOURCE)
mkdir -p $(TARGET_DIR)
cp $(SOURCE) $(TARGET_DIR)/$(LIBNAME)
build_lib:
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && cmake ../
cd $(BUILD_DIR) && make
$(XPI_TARGET):
sed -i 's/<em:version>.*<\/em:version>/<em:version>$(VERSION)<\/em:version>/' $(XPI_DIR)/install.rdf
# sed -i 's/<em:minVersion>.*<\/em:minVersion>/<em:minVersion>$(FIREFOX_VERSION).0<\/em:minVersion>/' $(XPI_DIR)/install.rdf
sed -i 's/<em:maxVersion>.*<\/em:maxVersion>/<em:maxVersion>$(FIREFOX_VERSION)\.\*<\/em:maxVersion>/' $(XPI_DIR)/install.rdf
rm -f $(XPI_TARGET)
cd $(XPI_DIR) && find . \( ! -regex '.*/\..*' \) | zip ../../$(XPI_TARGET) -@
tarbal: clean
cd .. && tar cvfz $(TARBAL_TARGET) --transform='s,firefox-kde-wallet,[email protected],' --exclude $(BUILD_DIR) --exclude '.*' --exclude '*.so' --exclude '*.xpi' firefox-kde-wallet
clean:
rm -rf $(BUILD_DIR)
# rm -f $(TARGET_DIR)/$(LIBNAME)