rofi/Makefile

65 lines
1.2 KiB
Makefile
Raw Normal View History

CFLAGS?=-Wall -Wextra -O3
2012-08-27 10:24:30 +00:00
PREFIX?=$(DESTDIR)/usr
BINDIR?=$(PREFIX)/bin
MANDIR?=$(PREFIX)/share/man/man1
2012-06-29 17:10:13 +00:00
SOURCES=$(wildcard *.c)
OBJECTS=$(SOURCES:%.c=%.o)
MANPAGE_PATH=$(MANDIR)/simpleswitcher.1.gz
CFLAGS+=-DMANPAGE_PATH="\"$(MANPAGE_PATH)\""
CFLAGS+=-std=c99
2013-01-20 12:01:13 +00:00
# Check deps.
ifeq (${DEBUG},1)
CFLAGS+=-DTIMING=1 -g3
LDADD+=-lrt
endif
2013-01-20 12:01:13 +00:00
##
# Check dependencies
##
2013-01-20 12:01:13 +00:00
PKG_CONFIG?=$(shell which pkg-config)
ifeq (${PKG_CONFIG},${EMPTY})
$(error Failed to find pkg-config. Please install pkg-config)
endif
CFLAGS+=$(shell ${PKG_CONFIG} --cflags x11 xinerama xft)
LDADD+=$(shell ${PKG_CONFIG} --libs x11 xinerama xft)
2013-01-20 12:01:13 +00:00
ifeq (${LDADD},${EMPTY})
$(error Failed to find the required dependencies: x11, xinerama, xft)
endif
##
# Check for i3.
##
I3?=$(shell which i3)
ifneq (${I3},${EMPTY})
$(info I3 mode is enabled)
CFLAGS+=-DI3 -I${PREFIX}/include/
endif
2012-06-29 17:10:13 +00:00
all: normal
normal: $(OBJECTS) | Makefile
$(CC) -o simpleswitcher $^ $(LDADD) $(LDFLAGS)
2012-06-29 17:10:13 +00:00
2014-01-10 09:35:38 +00:00
install: normal install-man
2012-08-27 10:24:30 +00:00
install -Dm 755 simpleswitcher $(BINDIR)/simpleswitcher
install-man:
install -Dm 644 simpleswitcher.1 $(MANDIR)/simpleswitcher.1
2014-01-10 09:35:38 +00:00
gzip -f $(MANDIR)/simpleswitcher.1
2012-06-29 17:10:13 +00:00
clean:
rm -f simpleswitcher $(OBJECTS)
2014-01-10 09:35:38 +00:00
indent:
@astyle --style=linux -S -C -D -N -H -L -W3 -f simpleswitcher.c textbox.c