X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=Makefile;h=0b1de7073594e3023c5562ef1a18c134922c1829;hb=7dc53b3c134d941362c63c79b9018b790a452714;hp=b4a1298e1c606fe60433adc6864b8e8047025f42;hpb=1b52ae218fe67928580427723f534fd4d6742dbd;p=uzbl-mobile diff --git a/Makefile b/Makefile index b4a1298..0b1de70 100644 --- a/Makefile +++ b/Makefile @@ -1,51 +1,50 @@ -LIBS := gtk+-2.0 webkit-1.0 gthread-2.0 libsoup-2.4 -ARCH := $(shell uname -m) -COMMIT := $(shell git log | head -n1 | sed "s/.* //") -DEBUG := -ggdb -Wall -W -DG_ERRORCHECK_MUTEXES +# first entries are for gnu make, 2nd for BSD make. see http://lists.uzbl.org/pipermail/uzbl-dev-uzbl.org/2009-July/000177.html -CFLAGS := $(shell pkg-config --cflags $(LIBS)) $(DEBUG) -DARCH="\"$(ARCH)\"" -DCOMMIT="\"$(COMMIT)\"" -std=c99 -LDFLAGS := $(shell pkg-config --libs $(LIBS)) $(LDFLAGS) +CFLAGS:=-std=c99 $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -lgthread-2.0 -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS) -fPIC +CFLAGS!=echo -std=c99 `pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0` -ggdb -Wall -W -DARCH='"\""'`uname -m`'"\""' -lgthread-2.0 -DG_ERRORCHECK_MUTEXES -DCOMMIT='"\""'`git log | head -n1 | sed "s/.* //"`'"\""' $(CPPFLAGS) -fPIC -PREFIX ?= $(DESTDIR)/usr -BINDIR ?= $(PREFIX)/bin -UZBLDATA ?= $(PREFIX)/share/uzbl -DOCSDIR ?= $(PREFIX)/share/uzbl/docs -EXMPLSDIR ?= $(PREFIX)/share/uzbl/examples +LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -pthread $(LDFLAGS) +LDFLAGS!=echo `pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0` -pthread $(LDFLAGS) all: uzbl uzblctrl -uzbl: uzbl.c uzbl.h config.h +PREFIX?=$(DESTDIR)/usr -%: %.c - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< +# When compiling unit tests, compile uzbl as a library first +tests: uzbl.o + $(CC) -DUZBL_LIBRARY -shared -Wl uzbl.o -o ./tests/libuzbl.so + cd ./tests/; $(MAKE) test: uzbl - ./uzbl --uri http://www.uzbl.org + ./uzbl --uri http://www.uzbl.org --verbose + +test-dev: uzbl + XDG_DATA_HOME=./examples/data XDG_CONFIG_HOME=./examples/config ./uzbl --uri http://www.uzbl.org --verbose + +test-share: uzbl + XDG_DATA_HOME=/usr/share/uzbl/examples/data XDG_CONFIG_HOME=/usr/share/uzbl/examples/config ./uzbl --uri http://www.uzbl.org --verbose -test-config: uzbl - ./uzbl --uri http://www.uzbl.org < examples/configs/sampleconfig-dev -test-config-real: uzbl - ./uzbl --uri http://www.uzbl.org < $(EXMPLSDIR)/configs/sampleconfig - clean: rm -f uzbl rm -f uzblctrl + rm -f uzbl.o + cd ./tests/; $(MAKE) clean install: - install -d $(BINDIR) - install -d $(DOCSDIR) - install -d $(EXMPLSDIR) - install -D -m755 uzbl $(BINDIR)/uzbl - install -D -m755 uzblctrl $(BINDIR)/uzblctrl - cp -ax docs/* $(DOCSDIR) - cp -ax config.h $(DOCSDIR) - cp -ax examples/* $(EXMPLSDIR) - install -D -m644 AUTHORS $(DOCSDIR) - install -D -m644 README $(DOCSDIR) + install -d $(PREFIX)/bin + install -d $(PREFIX)/share/uzbl/docs + install -d $(PREFIX)/share/uzbl/examples + install -m755 uzbl $(PREFIX)/bin/uzbl + install -m755 uzblctrl $(PREFIX)/bin/uzblctrl + cp -rp docs $(PREFIX)/share/uzbl/ + cp -rp config.h $(PREFIX)/share/uzbl/docs/ + cp -rp examples $(PREFIX)/share/uzbl/ + install -m644 AUTHORS $(PREFIX)/share/uzbl/docs + install -m644 README $(PREFIX)/share/uzbl/docs uninstall: - rm -rf $(BINDIR)/uzbl - rm -rf $(BINDIR)/uzblctrl - rm -rf $(UZBLDATA) + rm -rf $(PREFIX)/bin/uzbl + rm -rf $(PREFIX)/bin/uzblctrl + rm -rf $(PREFIX)/share/uzbl