forked from mdlavin/firefox-gnome-keyring
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
36 lines (30 loc) · 1.36 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
CXX = g++
CPPFLAGS += -fno-rtti \
-fno-exceptions \
-shared \
-fPIC
DEPENDENCY_CFLAGS = `pkg-config --cflags libxul libxul-unstable gnome-keyring-1`
GNOME_LDFLAGS = `pkg-config --libs gnome-keyring-1`
XUL_LDFLAGS = `pkg-config --libs libxul libxul-unstable`
VERSION = 0.3
FILES = GnomeKeyring.cpp
TARGET = libgnomekeyring.so
XPI_TARGET = gnome-keyring_password_integration-$(VERSION).xpi
ARCH := $(shell uname -m)
# Update the ARCH variable so that the Mozilla architectures are used
ARCH := $(shell echo ${ARCH} | sed 's/i686/x86/')
build-xpi: build-library
sed -i 's/<em:version>.*<\/em:version>/<em:version>$(VERSION)<\/em:version>/' xpi/install.rdf
sed -i 's/<em:targetPlatform>.*<\/em:targetPlatform>/<em:targetPlatform>Linux_$(ARCH)-gcc3<\/em:targetPlatform>/' xpi/install.rdf
mkdir -p xpi/platform/Linux_$(ARCH)-gcc3/components
cp $(TARGET) xpi/platform/Linux_$(ARCH)-gcc3/components
cd xpi && zip -r ../$(XPI_TARGET) *
build-library:
$(CXX) $(FILES) -g -Wall -o $(TARGET) $(DEPENDENCY_CFLAGS) $(XUL_LDFLAGS) $(GNOME_LDFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(GECKO_DEFINES)
chmod +x $(TARGET)
# strip $(TARGET)
build: build-library build-xpi
clean:
rm $(TARGET)
rm xpi/platform/Linux_$(ARCH)-gcc3/components/$(TARGET)
rm gnome-keyring_password_integration-$(VERSION).xpi