author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 22 Feb 2012 08:48:19 +0000 | |
changeset 27 | 8702a28675bd |
parent 23 | b894e51653f4 |
child 28 | 92cce13e174d |
permissions | -rw-r--r-- |
12 | 1 |
# first entries are for gnu make, 2nd for BSD make. see http://lists.uzbl.org/pipermail/uzbl-dev-uzbl.org/2009-July/000177.html |
2 |
||
3 |
# packagers, set DESTDIR to your "package directory" and PREFIX to the prefix you want to have on the end-user system |
|
4 |
# end-users who build from source: don't care about DESTDIR, update PREFIX if you want to |
|
5 |
# RUN_PREFIX : what the prefix is when the software is run. usually the same as PREFIX |
|
6 |
PREFIX?=/usr/local |
|
7 |
INSTALLDIR?=$(DESTDIR)$(PREFIX) |
|
8 |
DOCDIR?=$(INSTALLDIR)/share/uzbl/docs |
|
9 |
RUN_PREFIX?=$(PREFIX) |
|
10 |
||
11 |
# gtk2 |
|
12 |
REQ_PKGS += gtk+-2.0 webkit-1.0 |
|
13 |
CPPFLAGS = |
|
14 |
||
15 |
# gtk3 |
|
16 |
#REQ_PKGS += gtk+-3.0 webkitgtk-3.0 |
|
17 |
#CPPFLAGS = -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED |
|
18 |
||
19 |
# --- configuration ends here --- |
|
20 |
||
27
8702a28675bd
Make fixes for JavaScriptCore
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
23
diff
changeset
|
21 |
REQ_PKGS += javascriptcoregtk-1.0 libsoup-2.4 gthread-2.0 glib-2.0 |
12 | 22 |
|
23 |
ARCH:=$(shell uname -m) |
|
24 |
ARCH!=echo `uname -m` |
|
25 |
||
26 |
COMMIT_HASH:=$(shell ./misc/hash.sh) |
|
27 |
COMMIT_HASH!=echo `./misc/hash.sh` |
|
28 |
||
29 |
CPPFLAGS += -DARCH=\"$(ARCH)\" -DCOMMIT=\"$(COMMIT_HASH)\" |
|
30 |
||
31 |
PKG_CFLAGS:=$(shell pkg-config --cflags $(REQ_PKGS)) |
|
32 |
PKG_CFLAGS!=echo pkg-config --cflags $(REQ_PKGS) |
|
33 |
||
34 |
LDLIBS:=$(shell pkg-config --libs $(REQ_PKGS) x11) |
|
35 |
LDLIBS!=echo pkg-config --libs $(REQ_PKGS) x11 |
|
36 |
||
37 |
CFLAGS += -std=c99 $(PKG_CFLAGS) -ggdb -W -Wall -Wextra -pedantic -pthread |
|
38 |
||
39 |
SRC = $(wildcard src/*.c) |
|
40 |
HEAD = $(wildcard src/*.h) |
|
41 |
OBJ = $(foreach obj, $(SRC:.c=.o), $(notdir $(obj))) |
|
42 |
LOBJ = $(foreach obj, $(SRC:.c=.lo), $(notdir $(obj))) |
|
43 |
||
44 |
all: uzbl-browser |
|
45 |
||
46 |
VPATH:=src |
|
47 |
||
48 |
${OBJ}: ${HEAD} |
|
49 |
||
50 |
uzbl-core: ${OBJ} |
|
51 |
||
23
b894e51653f4
Fixes building of webkit renderer + 64bit precompiled version added
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
52 |
../WebKitRenderer: ${OBJ} |
b894e51653f4
Fixes building of webkit renderer + 64bit precompiled version added
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12
diff
changeset
|
53 |
|
12 | 54 |
uzbl-browser: uzbl-core |
55 |
||
56 |
# the 'tests' target can never be up to date |
|
57 |
.PHONY: tests |
|
58 |
force: |
|
59 |
||
60 |
# this is here because the .so needs to be compiled with -fPIC on x86_64 |
|
61 |
${LOBJ}: ${SRC} ${HEAD} |
|
62 |
$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c src/$(@:.lo=.c) -o $@ |
|
63 |
||
64 |
# When compiling unit tests, compile uzbl as a library first |
|
65 |
tests: ${LOBJ} force |
|
66 |
$(CC) -shared -Wl ${LOBJ} -o ./tests/libuzbl-core.so |
|
67 |
cd ./tests/; $(MAKE) |
|
68 |
||
69 |
test-uzbl-core: uzbl-core |
|
70 |
./uzbl-core --uri http://www.uzbl.org --verbose |
|
71 |
||
72 |
test-uzbl-browser: uzbl-browser |
|
73 |
./bin/uzbl-browser --uri http://www.uzbl.org --verbose |
|
74 |
||
75 |
test-uzbl-core-sandbox: uzbl-core |
|
76 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-uzbl-core |
|
77 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-example-data |
|
78 |
cp -np ./misc/env.sh ./sandbox/env.sh |
|
79 |
. ./sandbox/env.sh && uzbl-core --uri http://www.uzbl.org --verbose |
|
80 |
make DESTDIR=./sandbox uninstall |
|
81 |
rm -rf ./sandbox/usr |
|
82 |
||
83 |
test-uzbl-browser-sandbox: uzbl-browser |
|
84 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-uzbl-core |
|
85 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-uzbl-browser |
|
86 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-example-data |
|
87 |
cp -np ./misc/env.sh ./sandbox/env.sh |
|
88 |
-. ./sandbox/env.sh && uzbl-event-manager restart -avv |
|
89 |
. ./sandbox/env.sh && uzbl-browser --uri http://www.uzbl.org --verbose |
|
90 |
. ./sandbox/env.sh && uzbl-event-manager stop -ivv |
|
91 |
make DESTDIR=./sandbox uninstall |
|
92 |
rm -rf ./sandbox/usr |
|
93 |
||
94 |
test-uzbl-tabbed-sandbox: uzbl-browser |
|
95 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-uzbl-core |
|
96 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-uzbl-browser |
|
97 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-uzbl-tabbed |
|
98 |
make DESTDIR=./sandbox RUN_PREFIX=`pwd`/sandbox/usr/local install-example-data |
|
99 |
cp -np ./misc/env.sh ./sandbox/env.sh |
|
100 |
-. ./sandbox/env.sh && uzbl-event-manager restart -avv |
|
101 |
. ./sandbox/env.sh && uzbl-tabbed |
|
102 |
. ./sandbox/env.sh && uzbl-event-manager stop -ivv |
|
103 |
make DESTDIR=./sandbox uninstall |
|
104 |
rm -rf ./sandbox/usr |
|
105 |
||
106 |
clean: |
|
107 |
rm -f uzbl-core |
|
108 |
rm -f uzbl-core.o |
|
109 |
rm -f events.o |
|
110 |
rm -f callbacks.o |
|
111 |
rm -f inspector.o |
|
112 |
rm -f cookie-jar.o |
|
113 |
rm -f util.o io.o menu.o |
|
114 |
find ./examples/ -name "*.pyc" -delete |
|
115 |
cd ./tests/; $(MAKE) clean |
|
116 |
rm -rf ./sandbox/ |
|
117 |
||
118 |
strip: |
|
119 |
@echo Stripping binary |
|
120 |
@strip uzbl-core |
|
121 |
@echo ... done. |
|
122 |
||
123 |
install: install-uzbl-core install-uzbl-browser install-uzbl-tabbed |
|
124 |
||
125 |
install-dirs: |
|
126 |
[ -d "$(INSTALLDIR)/bin" ] || install -d -m755 $(INSTALLDIR)/bin |
|
127 |
||
128 |
install-uzbl-core: all install-dirs |
|
129 |
install -d $(INSTALLDIR)/share/uzbl/ |
|
130 |
install -d $(DOCDIR) |
|
131 |
install -m644 docs/* $(DOCDIR)/ |
|
132 |
install -m644 src/config.h $(DOCDIR)/ |
|
133 |
install -m644 README $(DOCDIR)/ |
|
134 |
install -m644 AUTHORS $(DOCDIR)/ |
|
135 |
cp -r examples $(INSTALLDIR)/share/uzbl/ |
|
136 |
chmod 755 $(INSTALLDIR)/share/uzbl/examples/data/scripts/* |
|
137 |
install -m755 uzbl-core $(INSTALLDIR)/bin/uzbl-core |
|
138 |
||
139 |
install-uzbl-browser: install-dirs |
|
140 |
install -m755 bin/uzbl-browser $(INSTALLDIR)/bin/uzbl-browser |
|
141 |
install -m755 bin/uzbl-event-manager $(INSTALLDIR)/bin/uzbl-event-manager |
|
142 |
mv $(INSTALLDIR)/bin/uzbl-browser $(INSTALLDIR)/bin/uzbl-browser.bak |
|
143 |
sed 's#^PREFIX=.*#PREFIX=$(RUN_PREFIX)#' < $(INSTALLDIR)/bin/uzbl-browser.bak > $(INSTALLDIR)/bin/uzbl-browser |
|
144 |
chmod 755 $(INSTALLDIR)/bin/uzbl-browser |
|
145 |
rm $(INSTALLDIR)/bin/uzbl-browser.bak |
|
146 |
mv $(INSTALLDIR)/bin/uzbl-event-manager $(INSTALLDIR)/bin/uzbl-event-manager.bak |
|
147 |
sed "s#^PREFIX = .*#PREFIX = '$(RUN_PREFIX)'#" < $(INSTALLDIR)/bin/uzbl-event-manager.bak > $(INSTALLDIR)/bin/uzbl-event-manager |
|
148 |
chmod 755 $(INSTALLDIR)/bin/uzbl-event-manager |
|
149 |
rm $(INSTALLDIR)/bin/uzbl-event-manager.bak |
|
150 |
||
151 |
install-uzbl-tabbed: install-dirs |
|
152 |
install -m755 bin/uzbl-tabbed $(INSTALLDIR)/bin/uzbl-tabbed |
|
153 |
||
154 |
# you probably only want to do this manually when testing and/or to the sandbox. not meant for distributors |
|
155 |
install-example-data: |
|
156 |
install -d $(DESTDIR)/home/.config/uzbl |
|
157 |
install -d $(DESTDIR)/home/.cache/uzbl |
|
158 |
install -d $(DESTDIR)/home/.local/share/uzbl |
|
159 |
cp -rp examples/config/* $(DESTDIR)/home/.config/uzbl/ |
|
160 |
cp -rp examples/data/* $(DESTDIR)/home/.local/share/uzbl/ |
|
161 |
||
162 |
uninstall: |
|
163 |
rm -rf $(INSTALLDIR)/bin/uzbl-* |
|
164 |
rm -rf $(INSTALLDIR)/share/uzbl |