1CC           ?= clang
 2CFLAGS       := -std=c99 -pedantic -Wall -Wextra -Wunused -Wswitch-enum
 3INCLUDES     := $(shell pkg-config --cflags xft libpulse gio-2.0 gio-unix-2.0)
 4LDFLAGS      := $(shell pkg-config --libs x11 xft libpulse gio-2.0 gio-unix-2.0) -lpthread
 5DESTDIR      ?= /usr/local
 6DISPLAY_NUM  := 69
 7
 8ifdef DEBUG
 9	CFLAGS += -ggdb -DDEBUG
10endif
11
12ifdef OPTIMIZE
13	CFLAGS += -O$(OPTIMIZE)
14endif
15
16all: glitch
17
18glitch: main.c logging.c manager.c widgets.c switcher.c audio.c launcher.c
19	$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LDFLAGS)
20
21config.h:
22	[ -f config.h ] || cp config.def.h config.h
23
24install: all
25	install -Dm755 glitch $(DESTDIR)/bin/glitch
26
27clean:
28	rm -f glitch
29
30virt:
31	Xephyr -br -ac -noreset -no-host-grab -sw-cursor -screen 1000x1000 :$(DISPLAY_NUM)