X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=Makefile;h=dca4f71be6b5fa047254bec1ad373844e0648b25;hb=dcd0518e25d7aa84a720780cb70b3f8fca867972;hp=d357b41cbef2059e3df3001d406d319b1a62ef9b;hpb=1710c206cf82330815b6db82316eb422f8be5370;p=i3%2Fi3status diff --git a/Makefile b/Makefile index d357b41..dca4f71 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ ifndef PREFIX PREFIX=/usr endif +ifndef MANPREFIX + MANPREFIX=$(PREFIX) +endif ifndef SYSCONFDIR ifeq ($(PREFIX),/usr) SYSCONFDIR=/etc @@ -19,6 +22,7 @@ CFLAGS+=-Iinclude LIBS+=-lconfuse LIBS+=-lyajl LIBS+=-lpulse +LIBS+=-lm VERSION:=$(shell git describe --tags --abbrev=0) GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1))" @@ -27,7 +31,8 @@ OS:=$(shell uname) ifeq ($(OS),Linux) CPPFLAGS+=-DLINUX CPPFLAGS+=-D_GNU_SOURCE -LIBS+=-liw +CFLAGS += $(shell pkg-config --cflags libnl-genl-3.0) +LIBS += $(shell pkg-config --libs libnl-genl-3.0) LIBS+=-lasound endif @@ -40,12 +45,8 @@ CFLAGS+=-I/usr/local/include/ LDFLAGS+=-L/usr/local/lib/ endif -ifeq ($(OS),OpenBSD) -LIBS+=-lossaudio -endif - -ifeq ($(OS), NetBSD) -LIBS+= -lprop +ifeq ($(OS),NetBSD) +LIBS+=-lprop endif # This probably applies for any pkgsrc based system @@ -69,6 +70,11 @@ CFLAGS += -idirafter yajl-fallback OBJS:=$(wildcard src/*.c *.c) OBJS:=$(OBJS:.c=.o) +ifeq ($(OS),OpenBSD) +OBJS:=$(filter-out src/pulse.o, $(OBJS)) +LIBS:=$(filter-out -lpulse, $(LIBS)) -lpthread +endif + src/%.o: src/%.c include/i3status.h $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< @echo " CC $<" @@ -95,12 +101,12 @@ manpage: install: install -m 755 -d $(DESTDIR)$(PREFIX)/bin install -m 755 -d $(DESTDIR)$(SYSCONFDIR) - install -m 755 -d $(DESTDIR)$(PREFIX)/share/man/man1 + install -m 755 -d $(DESTDIR)$(MANPREFIX)/share/man/man1 install -m 755 i3status $(DESTDIR)$(PREFIX)/bin/i3status # Allow network configuration for getting the link speed (which setcap && setcap cap_net_admin=ep $(DESTDIR)$(PREFIX)/bin/i3status) || true install -m 644 i3status.conf $(DESTDIR)$(SYSCONFDIR)/i3status.conf - install -m 644 man/i3status.1 $(DESTDIR)$(PREFIX)/share/man/man1 + install -m 644 man/i3status.1 $(DESTDIR)$(MANPREFIX)/share/man/man1 release: [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION}