aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2010-12-27 19:17:31 -0700
committerGravatar Brendan Taylor <whateley@gmail.com>2010-12-27 19:17:31 -0700
commitb88cac232712ede3235e3ceb33a3d3993fa5c7bb (patch)
treedb3a8e4589a705a96f82220dd1155b7bb18b6f5d /Makefile
parent0db4606fc4daa63f63b30a44832cbc0b99cbd1fa (diff)
only compile with -fPIC when needed
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 9a8454d..ee23065 100644
--- a/Makefile
+++ b/Makefile
@@ -34,11 +34,12 @@ PKG_CFLAGS!=echo pkg-config --cflags $(REQ_PKGS)
LDLIBS:=$(shell pkg-config --libs $(REQ_PKGS) x11)
LDLIBS!=echo pkg-config --libs $(REQ_PKGS) x11
-CFLAGS += -std=c99 $(PKG_CFLAGS) -ggdb -W -Wall -Wextra -pedantic -fPIC -pthread
+CFLAGS += -std=c99 $(PKG_CFLAGS) -ggdb -W -Wall -Wextra -pedantic -pthread
SRC = $(wildcard src/*.c)
HEAD = $(wildcard src/*.h)
-OBJ = $(foreach obj, $(SRC:.c=.o), $(notdir $(obj)))
+OBJ = $(foreach obj, $(SRC:.c=.o), $(notdir $(obj)))
+LOBJ = $(foreach obj, $(SRC:.c=.lo), $(notdir $(obj)))
all: uzbl-browser uzbl-cookie-manager
@@ -46,6 +47,9 @@ VPATH:=src
${OBJ}: ${HEAD}
+${LOBJ}:
+ $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c src/$(@:.lo=.c) -o $@
+
uzbl-core: ${OBJ}
uzbl-cookie-manager: examples/uzbl-cookie-manager.o util.o
@@ -59,8 +63,8 @@ uzbl-browser: uzbl-core uzbl-cookie-manager
force:
# When compiling unit tests, compile uzbl as a library first
-tests: ${OBJ} force
- $(CC) -shared -Wl ${OBJ} -o ./tests/libuzbl-core.so
+tests: ${LOBJ} force
+ $(CC) -shared -Wl ${LOBJ} -o ./tests/libuzbl-core.so
cd ./tests/; $(MAKE)
test-uzbl-core: uzbl-core
@@ -106,7 +110,7 @@ test-uzbl-tabbed-sandbox: uzbl-browser
clean:
rm -f uzbl-core
rm -f uzbl-cookie-manager
- rm -f *.o
+ rm -f *.o *.lo
find ./examples/ -name "*.pyc" -delete
cd ./tests/; $(MAKE) clean
rm -rf ./sandbox/